0

I'm working on web project where the position of the user's mouse triggers a video to play forward and backwards.

Here's my problem: The code I'm using to achieve this requires the video file to be exactly 29.97000 fps, but exporting my work from Photoshop/Premiere gives me 29.970030 fps. Re-encoding the video with Handbrake gave me the same result. Currently using OSX 10.11.6.

Is there a way to "force" Adobe Suite Applications/Handbrake to export video @ exactly 29.97000 fps, or do I need to use a more barebones method (VirtualDubMod, AviSynth, ffmpeg, etc) to achieve this?

Any help/advice is much appreciated!

1
  • If your code literally requires 29.97, then use ffmpeg with the argument -r 29.97.
    – Gyan
    Oct 26, 2016 at 1:56

2 Answers 2

2

The definition of "29.97" is correctly 30 * (1000 / 1001), which is 29.97002997. That's what you have. I don't know why do you think you need exactly 29.97000, but it's probably a misunderstanding.

5
  • Thanks for clarifying! In my case, when I inspected the video file I intend to replace with VLC, the media information panel listed it's frame rate as 29.970000, while the file I created to replace it shows up as 29.970030. original - - replacement
    – Androbaut
    Oct 26, 2016 at 2:27
  • Following up, any idea why the exact frame rate these two files report would be different?
    – Androbaut
    Oct 26, 2016 at 22:46
  • @Androbaut No idea. In many cases the "frame rate" is actually stored as the frame interval, the inverse of the rate. So true 29.97 might be stored as 33.36666... (mSec per frame), where 29.970000 would be stored as 33.36670. But that doesn't explain where the error arose. As I said, maybe a misunderstanding on someone's part, a bad assumption that "29.97" meant exactly 29.97. It could also be premature rounding, or carrying a double-precision number as a float, or... something else.
    – Jim Mack
    Oct 27, 2016 at 0:25
  • Thanks for getting back to me! So, to settle this once and for all, let's say I make my goal (as quixotic as it may be) to have the video file I rendered show up as 29.970000 when examined in VLC (like the other file I referenced above) instead of 29.970030. Is there a way I might be able to modify the frame interval (from 33.36666 to 33.36670)?
    – Androbaut
    Oct 27, 2016 at 0:43
  • @Androbaut It depends on which codec and container you're using. I don't see any mention of that in your post or comments. If the container is (say) MP4 then you'd need to get the layout of the MP4 header, locate the field(s) that contains this value, and use a binary / hex editor to change the field(s). No change should need to be made to the video data. There may also be tools available to edit the header, like MP4Box or mp4ui.sourceforge.net or possibly avconv or ffmpeg. Google "video header change frame rate" for more.
    – Jim Mack
    Oct 27, 2016 at 13:17
1

This is most likely just a rounding error in the display of a floating point integer. Even if that is not the case, 0.00003 fps is one extra frame every nine and a half hours of video. If the software consuming this file can not handle that, you should change that component, not the encoder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.