ExifTool Forum

General => Metadata => Topic started by: stanpete78 on May 14, 2013, 02:14:03 PM

Title: Timecode
Post by: stanpete78 on May 14, 2013, 02:14:03 PM
Hey,
impressive software you made :)
I found it following an advice that exiftool can read
the MDPM 0x0013 message in h264 videos. I'm glad it does.
The only thing I'm wondering is why it's still shown as raw data since it's just a reversed
timecode.
For example: The file made by my Panasonic camera has a MDPM 13 shown as
12100100, which is a reversed timecode. It would be nice if exiftool just showed
"Timecode:  00:01:10:12"

Do you think this might be possible to do?
Thank you
stanpete
Title: Re: Timecode
Post by: Phil Harvey on May 14, 2013, 02:20:57 PM
Hi Stanpete,

Thanks for the suggestion.

I don't think I have any sample M2TS videos with the MDPM 0x0013 metadata.  If you send me a sample (philharvey66 at gmail.com), I'll see what I can do about decoding this.

Or if you tell me the model of camera I may be able to find a sample myself.

- Phil
Title: Re: Timecode
Post by: stanpete78 on May 14, 2013, 03:57:51 PM
Great!
This would be a cool improvement considering
there are already a lot of cameras with timecode
option und there will be even more in the future.
I sent you an email.

st
Title: Re: Timecode
Post by: Phil Harvey on May 15, 2013, 07:19:56 AM
Hi Stanpete,

Thanks for the sample.  ExifTool 9.29 will decode this as "TimeCode" (or would you prefer "TitleTimeCode"? which is the name I found in some documentation somewhere).  Is this stored as binary coded decimal or hexadecimal?  In your email you say that a timecode of 12345678 (presumably hexadecimal) equates to 78:56:34:12, which would be binary coded decimal.  In your sample, the hexadecimal bytes are "12 24 32 00".  Does this decode as "00:32:24:12" or "00:50:36:18"?

Your sample also contains MDPM 0x14 (all zeros).  Do you have any idea about the format of this tag?  The name I have for this is TitleBinaryGroup.

- Phil

Edit:  I realized that there are many timecodes in your sample that may be extracted with the -ee option in ExifTool.  These do look like they are BCD coded, but the values jump around a bit:

TimeCode: 00:32:24:12
TimeCode: 00:32:24:13
TimeCode: 00:32:24:17
TimeCode: 00:32:24:15
TimeCode: 00:32:24:16
TimeCode: 00:32:24:20
TimeCode: 00:32:24:18
TimeCode: 00:32:24:19
TimeCode: 00:32:24:23
TimeCode: 00:32:24:21
TimeCode: 00:32:24:22
TimeCode: 00:32:24:24
TimeCode: 00:32:25:00
TimeCode: 00:32:25:04
TimeCode: 00:32:25:02
TimeCode: 00:32:25:03
TimeCode: 00:32:25:07
TimeCode: 00:32:25:05
TimeCode: 00:32:25:06
TimeCode: 00:32:25:10
TimeCode: 00:32:25:08
TimeCode: 00:32:25:09
TimeCode: 00:32:25:11
TimeCode: 00:32:25:12
TimeCode: 00:32:25:16
TimeCode: 00:32:25:14
TimeCode: 00:32:25:15
TimeCode: 00:32:25:19
TimeCode: 00:32:25:17
TimeCode: 00:32:25:18
TimeCode: 00:32:25:22
TimeCode: 00:32:25:20
TimeCode: 00:32:25:21
TimeCode: 00:32:25:23
TimeCode: 00:32:25:24
TimeCode: 00:32:26:03
TimeCode: 00:32:26:01
TimeCode: 00:32:26:02
...


Do you have any idea why the jumpiness?
Title: Re: Timecode
Post by: stanpete78 on May 15, 2013, 08:29:22 AM
Wow, you are impressing me even more.
You're right about it being binary coded decimal.
So the timecode of that video is indeed 00:32...

The industry standard would be "Timecode", as this is written
in other containers with a real TC tag.

I don't know what the MDPM 14 means but I can try to find out.
I'll tell you if i find sometjing.

As for the other jumping timecodes - that doesn't make any sense.
You might as well just ignore them since only the first mdpm 0x0013
value will be read by other software.

Thank you!
st
Title: Re: Timecode
Post by: stanpete78 on May 15, 2013, 09:06:21 AM
Wait, maybe I mixed the whole decimal/hexadecimal thing up.
Just to be sure: When you read the hex value from the file these
are all decimal numbers. 01=01 , 12=12, etc
No 1A=11 :)

But you probably guessed that already when I said that 00:32:... is correct.
Title: Re: Timecode
Post by: Phil Harvey on May 15, 2013, 09:09:41 AM
I agree that BCD is confusing.  When looking at the original data in hexadecimal, there should be no letters (no A-F) if it is BCD coded.  So 0x12 converts to twelve decimal ("12" in the output).

- Phil

Edit: If you think this is confusing, you should try decoding the exponential golomb format used for storing numbers in the H264 video stream. ;)
Title: Re: Timecode
Post by: stanpete78 on May 15, 2013, 09:22:22 AM
 ;)

I just openend about 14 different sample files that i got online.
Only the ones with a timecode have the MDPM 0x0014 tag. And every single one is 00000000.
Title: Re: Timecode
Post by: Phil Harvey on May 15, 2013, 09:25:43 AM
OK, thanks for checking.  Let me know if you discover anything else that I could be decoding.

- Phil
Title: Re: Timecode
Post by: stanpete78 on May 15, 2013, 01:32:57 PM
Will do!
Title: Re: Timecode
Post by: stanpete78 on May 16, 2013, 04:38:22 PM
I found another timecode metadata riddle. Are you interested? :-)
Title: Re: Timecode
Post by: stanpete78 on May 16, 2013, 05:13:45 PM
Well, I'm gonna post anyways, just in case :-)

This time I found a hidden timecode in Sony XDCAM EX (Like EX1, EX1R, EX3, F3 cameras use) files that i tested.

The Sony Software says:


Timecode: 01:06:07:22
Timecode of the last frame: 01:06:18:12



Exiftool says:


Non Real Time Meta Duration Value: 266
Non Real Time Meta Ltc Change Table Tc Fps: 25
Non Real Time Meta Ltc Change Table Half Step: false
Non Real Time Meta Ltc Change Table Ltc Change Frame Count: 265
Non Real Time Meta Ltc Change Table Ltc Change Value: 12180601
Non Real Time Meta Ltc Change Table Ltc Change Status: end



So "LTC Change Value" is the timecode of the last frame. Reversed again... Meaning 12180601 = 01:06:18:12
Subtracting the "Frame Count" of 265 gives us the real timecode of this video.

Considering the camera might as well record with a different FPS setting, it would be important to include the FPS
into the calculation.
Title: Re: Timecode
Post by: Phil Harvey on May 17, 2013, 07:10:32 AM
Interesting.  Could you send me this sample too?

Thanks.

- Phil
Title: Re: Timecode
Post by: Phil Harvey on May 17, 2013, 09:49:06 AM
Thanks for the sample.

I was afraid of this.  The information you mentioned is stored in the XML section of the QuickTime metadata.  ExifTool extracts this information for completeness, but currently doesn't convert the format of any of these values.

- Phil
Title: Re: Timecode
Post by: stanpete78 on May 18, 2013, 02:46:23 AM
Hey Phil,
ok, didn't even know there were xmls in
quicktime files :)
So if this is a problem I'll be going back to finding
strange MDPM values ;)

Thanks
st
Title: Re: Timecode
Post by: stanpete78 on May 21, 2013, 05:19:04 AM
Thank you for 9.29. It works :)