Question / Help Constant frame rate activated, but not active in *.mp4

koala

Active Member
I'm trying to record to a local file only, and all mp4 files Obs creates have variable frame rate. The CFR setting on the advanced configuration page doesn't seem to change anything in the created *.mp4 file. Mediainfo always shows the frame rate as "Variable" and gives a range of used frame rates around the requested frame rate, although I activated CFR in OBS.

OBS logfile:
18:22:45: =====Stream Start: 2014-02-04, 18:22:45===============================================
18:22:45: Multithreaded optimizations: On
18:22:45: Base resolution: 1920x1200
18:22:45: Output resolution: 1920x1200
18:22:45: ------------------------------------------
18:22:45: Loading up D3D10 on NVIDIA GeForce GTX 670 (Adapter 1)...
18:22:45: ------------------------------------------
18:22:45: Audio Format: 44100hz
18:22:45: Playback device Default
18:22:45: ------------------------------------------
18:22:45: Using desktop audio input: Lautsprecher Anlage (2- Realtek High Definition Audio)
18:22:45: ------------------------------------------
18:22:45: Audio Encoding: AAC
18:22:45: bitrate: 128
18:22:45: Using Monitor Capture
18:22:45: Scene buffering time set to 700
18:22:45: 1 CUDA capable devices found
18:22:45: [ GPU #0 - < GeForce GTX 670 > has Compute SM 3.0, NVENC Available ]
18:22:45: NVENC internal init finished successfully
18:22:45: NVENC supports 7 h264 presets
18:22:45: ------------------------------------------
18:22:45: Video Encoding: NVENC
18:22:45: fps: 30
18:22:45: width: 1920, height: 1200
18:22:45: preset: hq
18:22:45: profile: high
18:22:45: level: autoselect
18:22:45: keyint: 30
18:22:45: CBR: no
18:22:45: CFR: yes
18:22:45: max bitrate: 30000
18:22:45: buffer size: 30000
18:22:45: ------------------------------------------
18:22:47: Connection to (null) failed: No server specified to connect to
18:22:48: Total frames encoded: 47, total frames duplicated: 1 (2.13%)
18:22:48: Total frames rendered: 51, number of late frames: 3 (5.88%) (it's okay for some frames to be late)
18:22:48: Number of times waited to send: 0, Waited for a total of 0 bytes
18:22:48: Number of b-frames dropped: 0 (0%), Number of p-frames dropped: 0 (0%), Total 0 (0%)
18:22:48: Number of bytes sent: 0
18:22:48: Encoder closed
18:22:48: NVENC deinitialized
18:22:48:
18:22:48: Profiler time results:
18:22:48:
18:22:48: ==============================================================
18:22:48: video thread frame - [100%] [avg time: 33.158 ms] [children: 96.8%] [unaccounted: 3.25%]
18:22:48: | scene->Preprocess - [96.1%] [avg time: 31.874 ms]
18:22:48: | GPU download and conversion - [0.624%] [avg time: 0.207 ms] [children: 0.866%] [unaccounted: -0.241%]
18:22:48: | | flush - [0.115%] [avg time: 0.038 ms]
18:22:48: | | CopyResource - [0.0302%] [avg time: 0.01 ms]
18:22:48: | | conversion to 4:2:0 - [0.721%] [avg time: 0.239 ms]
18:22:48: Convert444Threads - [100%] [avg time: 1.444 ms] [children: 99.7%] [unaccounted: 0.277%]
18:22:48: | Convert444toNV12 - [99.7%] [avg time: 1.44 ms]
18:22:48: encoder thread frame - [100%] [avg time: 4.588 ms]
18:22:48: ==============================================================
18:22:48:
18:22:48:
18:22:48: Profiler CPU results:
18:22:48:
18:22:48: ==============================================================
18:22:48: video thread frame - [cpu time: avg 8.258 ms, total 421.202 ms] [avg calls per frame: 1]
18:22:48: | scene->Preprocess - [cpu time: avg 7.341 ms, total 374.402 ms] [avg calls per frame: 1]
18:22:48: | GPU download and conversion - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
18:22:48: | | flush - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
18:22:48: | | CopyResource - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
18:22:48: | | conversion to 4:2:0 - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
18:22:48: Convert444Threads - [cpu time: avg 0.557 ms, total 31.2 ms] [avg calls per frame: 2]
18:22:48: | Convert444toNV12 - [cpu time: avg 0.557 ms, total 31.2 ms] [avg calls per frame: 2]
18:22:48: encoder thread frame - [cpu time: avg 0.6 ms, total 15.6 ms] [avg calls per frame: 1]
18:22:48: ==============================================================
18:22:48:
18:22:48: =====Stream End: 2014-02-04, 18:22:48=================================================

Media info of the created mp4:
General
Complete name : D:\Alex\Videos\Aufnahme\nvenc (03).mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom
File size : 2.19 MiB
Duration : 2s 967ms
Overall bit rate mode : Variable
Overall bit rate : 6 185 Kbps
Encoded date : UTC 2014-02-04 17:18:43
Tagged date : UTC 2014-02-04 17:18:43
Writing application : Open Broadcaster Software v0.60b

Video
ID : 2
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L5.0
Format settings, CABAC : Yes
Format settings, ReFrames : 2 frames
Muxing mode : Container profile=High@3.1
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 2s 967ms
Source duration : 2s 934ms
Bit rate mode : Variable
Bit rate : 6 231 Kbps
Maximum bit rate : 30.0 Mbps
Width : 1 920 pixels
Height : 1 200 pixels
Display aspect ratio : 16:10
Frame rate mode : Variable
Frame rate : 30.000 fps
Minimum frame rate : 29.412 fps
Maximum frame rate : 30.303 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.090
Stream size : 2.18 MiB (100%)
Source stream size : 2.18 MiB (100%)
Encoded date : UTC 2014-02-04 17:18:43
Tagged date : UTC 2014-02-04 17:18:43
mdhd_Duration : 2967
Color primaries : BT.709
Transfer characteristics : sYCC
Matrix coefficients : BT.709

Audio
ID : 1
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 2s 957ms
Source duration : 2s 949ms
Bit rate mode : Constant
Bit rate : 3 092 bps
Nominal bit rate : 128 Kbps
Channel count : channel0
Original Channel count : 2 channels
Channel positions : Front: L R
Sampling rate : 44.1 KHz
Compression mode : Lossy
Stream size : 1.12 KiB (0%)
Source stream size : 1.12 KiB (0%)
Language : English
Encoded date : UTC 2014-02-04 17:18:43
Tagged date : UTC 2014-02-04 17:18:43
mdhd_Duration : 2926

Shouldn't "Frame rate mode" be "Constant" instead of "Variable"? And I didn't expect Maximum and Minimum frame rate information for a video recorded in constant frame mode.
Interesting thing is, that this doesn't happen with certain bitrates. 30fps gives the above result, but with 25 or 40 fps OBS actually produces videos where Mediainfo really shows "Constant" for "Frame rate mode".

Activating CFR doesn't actually result in constant frame rate, but setting the frame rate to 25 or 40 (and probably other certain values) do.

I don't understand this - what happens here, and how can I produce 30 fps videos with really constant frame rate?

(by the way: nvenc works fine. I've yet to analyze which quality is better and cpu usage is lower - nvenc or quicksync. With a first check, I think nvenc is a bit better. At least at the high bitrate of 30000, which is only suitable for local recording of course, but this is what I use OBS for)
 

Boildown

Active Member
Its the same way for me, but in effect, it might as well be constant, despite the media info. I can edit the files in Sony Vegas, and if they were actually variable frame rate, that wouldn't work. The min and max are very close to the nominal constant framerate in any case, so as I see it, its just semantics. Although, looking through my archives, in the past I saved at 45fps, and those also showed variable with the very slightly different min and max, not constant.

Also, I read that the quality of Quicksync varies according to which Intel HD Graphics its using. Sandy's Intel HD Graphics 3000 being worse than Ivy's Intel HD Graphics 4000, which is worse than Haswell's Intel HD Graphics 4600, for example. So its important to note which one of those your CPU is using for a proper comparison. I've read that the HD 4600 has a quality between near Fast, which is excellent for live streaming, while the HD 3000 has a quality between Very Fast and Super Fast, which isn't that good.

Here's an excellent article I just found: http://www.tetrachromesoftware.com/q264 ... est_1.html . I wouldn't mind trying to duplicate these results using OBS at 720p30, 720p60, and 1080p30, in case I get really bored some day. :P
 
Top