Question / Help File output framerate differs from specification

bertieb

New Member
A quick question: I am doing a combined livestream+output to file, with framerate set to 60.

01:32:29: Video Encoding: x264
01:32:29: fps: 60

However, checking the output files created (using ffprobe), it seems that they are actually 62.5 FPS:

Stream #0:0: Video: h264 (Main), yuv420p(tv, bt709/bt709/iec61966-2-1), 1280x720, SAR 1:1 DAR 16:9, 62.50 fps, 62.50 tbr, 1k tbn, 120 tbc (default)

Is there a technical reason for this? Can I safely override this behaviour by passing custom x264 parameters? An example log file is attached, as well as detailed ffprobe output.

Thanks

(For context, I am trying to match the encoding parameters so I can splice video files using ffmpeg's concat demuxer, but can't match the codec time base (tbc). More info: http://superuser.com/questions/9319...ideos-for-ffmpegs-concat-demuxer-to-avoid-a-l)
 

Attachments

OBS always seems to do this. Pretty sure it just records the wrong information in the media info, nothing to worry about.
 
Thanks for the reply, Boildown! I should perhaps have made the reasoning and context a little clearer- I'm hoping to change the codec time base or at least get it to something I can match so that I can (try to) stitch files together with ffmpeg.

The reason I am trying to achieve this is to (programmatically) create a set of 'highlights' from a video file while doing as little transcoding as possible, while having fade transitions between the highlights. However, because the files output by OBS are actually 62.5 FPS, any manipulation of them with ffmpeg ends up with a resulting time base of 125 instead of 120, and when stitching them together I get artifacts - possibly for that reason.

There's a plethora of detail in the link I included in OP, but it's a wall of text. The short version is that I cannot seem to affect the timebase of the transition clips I generate, so I was wondering if I could get OBS to output a different codec time base.

Perhaps I should post another question where that is clearer! :)
 
Try using Avidemux to cut on keyframes a part of the video (a lossless process btw), and see if it still happens. I still think its because of the mediainfo problem, but maybe you can re-write the media info.

If you count the frames at any random point in the video, are there actually 62 or 63 of them in 1 second?
 
Good thinking- I could give that a try; but I am already specifying cut on keyframes with ffmpeg (per https://trac.ffmpeg.org/wiki/Seeking).

Edit: All the clips I've checked so far start with an I-frame

Per your second suggestion, is there a frame-advancing player with a decent timecode display? Advancing by frame (using 'e') in VLC doesn't seem to advance by 1 frame! Right, Avidemux.
 
Last edited:
Well well well. Counting frames by hand in Avidemux indicates there are only 60 per second in the originals despite ffprobe reporting 62.5. Merged transitional clips are indeed 62-63 per second to match their 125 timebase.
 
Well well well. Counting frames by hand in Avidemux indicates there are only 60 per second in the originals despite ffprobe reporting 62.5. Merged transitional clips are indeed 62-63 per second to match their 125 timebase.

Yup, so if its possible to re-write the Media Info, the problem would be solved. No idea why OBS has the 62.5 figure in there for max FPS, and I'm sure my workflow is very different than yours, but all my 60FPS recordings have the same "problem". It hasn't seemed to negatively effect any of the tools I use so I've ignored it.

What I suspect is happening is that there isn't a perfect 1/60th of a second between all the frames even when in CFR mode. It would be nice if there was a tool to force the timing between frames to be perfect, if that really is the problem. I assume that would be a lossless process although maybe some of the movement prediction depends on the time between the frames? Dunno. Also, maybe it is rounding error or the result of not enough precision in a variable somewhere.
 
Yeah, it seems to be a case of a minor difference causing no end of problems. However, using a combination of framerate and timebase munging I produced a file with 120 timebase (and 60FPS) to match the original. Of course, the reported framerate differs (in that it is actually 60FPS) from the original material.

Unfortunately, muxing this in still results in artifacting, so it looks like the problem is larger than just the timebase mismatch. I figured the problem might be with the I-frames, so I fired up Avidemux. Turns out things indeed go south just after an I-frame, but it not the I-frame at the cut. Given the clip with the crossfade itself plays fine, and the frames just after the join seem fine; I'm wondering why one particular I-frame is throwing everything off-kilter?

I may experiment with different means of generating the short transitional crossfades and seeing if the problem still occurs. I had tried this before, but not after making advances matching codec parameters.

Update: Even if I generate a crossfade transition clip using a different tool, I still get artifacts. Thinking the problem was I-frame related, I decreased the GOP length to include more I-frames. Still has artifacts :-/
 
Last edited:
From the OBS side, I've never tried it, but maybe I will next time I record... what happens if you turn on "Allow 61-120 FPS entry in video settings" (Advanced settings) but still record at 60FPS?

As for what you're doing, do you have other 60 FPS sources where it works as expected? What if you record with the multiplatform version? The regular OBS version isn't being developed any more, but if you find this is a problem in the MP version, there's a chance they could A) realize there's a problem with the media info / timebase that's generated and B) fix it. I wouldn't expect them to put any effort into this for standard OBS as its such an edge case.
 
Last edited:
From the OBS side, I've never tried it, but maybe I will next time I record... what happens if you turn on "Allow 61-120 FPS entry in video settings" (Advanced settings) but still record at 60FPS?

I will give that a try and report back. I've tried with CRF off, but that just moves the goalposts from 120 timebase to 2k.

As for what you're doing, do you have other 60 FPS sources where it works as expected? What if you record with the multiplatform version? The regular OBS version isn't being developed any more, but if you find this is a problem in the MP version, there's a chance they could A) realize there's a problem with the media info / timebase that's generated and B) fix it. I wouldn't expect them to put any effort into this for standard OBS as its such an edge case.

Funnily enough, I've just recently moved to MP. Even more funnily the output there shows the same symptoms too. I checked the bug tracker and could find any mention of it, so you may be right in that it may be worthwhile raising the issue, even to get confirmation. Unfortunately I don't think I have any other 60FPS sources to hand, but I'll dig through my archives ;)

I am planning on finding out what the recommendations are for recording audio / video formats (codecs) and/or encoder options that might allow for easier manipulation while minimising transcoding and without a ballooning filesize. I've asked on IRC but may need to lay requirements out in a[nother] post :)
 
Back
Top