Determining Framerate of H.264 stream

3

1

I have encoded a video from Lagarith to H.264 using x264, and I might have inadvertently forgotten to write down it's framerate. The video stream itself isn't in any container (just a h264 file), so it doesn't have any dimension or framerate headers. I can't re-encode the video as it took 4 days to encode and is 66gb.

If it helps, I know that fps = (number of frames)/duration, and I have a FLAC file that is exactly the same length, but I don't know to get the number of frames from the h264 file and the exact length of the FLAC file.

How would I go about finding the framerate of the video?

user108168

Posted 2012-07-15T13:44:05.553

Reputation:

Answers

1

You could try and wrap the .264 bitstream into a container with MP4Box:

mp4box -add input.264 -new out.mov

Then, identify the frame rate as usual with any playback tool, or MediaInfo. That, however, might not work out of the box. You can try specifying the frame rate like this:

mp4box -add input.264 -fps 30 out.mov

Now, all you have to do is try different frame rates and see if they'll give you correct output. Start with these:

  • 24
  • 25
  • 29.97
  • 30
  • 50
  • 60

slhck

Posted 2012-07-15T13:44:05.553

Reputation: 182 472

1

It turned out that the master was encoded incorrectly. Apparently Adobe Media Encoder CS6 has some issues with the Lagarith VfW codec. I played it in VirtualDub and the audio was almost an hour out of sync with the video (It's 3hrs long). So I'll have to get AME to export it to raw video(which I know works) then encode to H.264 and Lagarith.

And looking at the x264 logs in my temp folder, apparently the framerate was 5650/143 fps.

Thanks for the help anyway :)

user108168

Posted 2012-07-15T13:44:05.553

Reputation: