Retrieving per-frame timestamps from .mov HEVC-encoded files

Started by ereastin, November 08, 2022, 11:31:45 PM

Previous topic - Next topic

ereastin

Hello!

I am looking to retrieve per-frame information, specifically a timestamp or duration value, from variable frame rate .mov files (iPhone, HEVC encoding). I have tried and failed with ffmpeg/ffprobe previously.

Using exiftool version 12.49 on macOS Monterey 12.6.

It seems like I should be looking for the QuickTime Keys Tag 'camera.framereadouttimeinmicroseconds' or the TimeToSampleTable (as per the QuickTime docs) for the video data (other tags?), but am unsure how to get the appropriate results.

Running exiftool -ee3 -U -v 4k_30fps.mov I can find parts of the output that reference TimeToSampleTable (although not within the 'video' track), as well as CompositionTimeToSample, for example:

(from audio track)
  | | | | | | + [Wave directory]
  ...
  | | | | | TimeToSampleTable = .>.
  | | | | | SampleToChunk = ..+....
  | | | | | SampleSizes = >............................................................[snip]
and
(from video track)
  | | | | + [SampleTable directory]
  ...
  | | | | | VideoFrameRate = ..P...<...<...<*...
  | | | | | CompositionTimeToSample = 1.<..<..<..<............<............<...........[snip]
  | | | | | CompositionToDecodeTimelineMapping = (....<<..

But, when piping these tags to a json file with -b and -j, I get a base64 string that I can't decode... although the -VideoFrameRate tag produces the correct output directly when piped to a json file. Has anyone attempted this before? How does exiftool handle this data? Or does the info I'm looking for exist in a more accessible format? I don't mind doing decoding or otherwise, just looking for a place to start.

Thanks!

Phil Harvey

Currently ExifTool doesn't further decode most of this.  See the SampleTable definition in the code for details.  You could create user-defined tags to decode any of these however you want.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

ereastin

Awesome, thanks Phil I will look into that. Great tool and community!