Color Format seems to change recorded frame-rate

[DE]Glen

New Member
Recording only, using NVENC, I noticed that my resulting MKV or MOV file ends up with slightly different frame-rate when using I444 instead of NV12 for Color Format; this can confuse editing software but I'm not sure what other problems it may cause.

I first noticed when taking clips into Kdenlive that I'd tried to record using ProRes using Custom Output (FFmpeg); KDenlive showed a prompt offering to change my project frame-rate because it turns out my clip wasn't 59.94 as it should have been. Historically I had no trouble with clips I'd recorded with NVENC so I thought it was some missing parameter to the custom encoder settings but after much fussing around I discovered that I could reproduce this merely but switching OBS from NV12 to I444 (Settings -> Advanced -> Video -> Color Format), even with my old NVENC settings.

Here's the FFProbe output for two clips recorded normally with NVENC (I can share settings if needed).

NV12:
Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 20573 kb/s, 59.94 fps, 59.94 tbr, 60k tbn, 119.88 tbc (default)

I444:
Stream #0:0: Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv444p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 26990 kb/s, 60.15 fps, 59.94 tbr, 60k tbn, 119.88 tbc (default)

I don't think it's a performance issue but I can try to rule that out if necessary; I can try on a much faster machine on Monday.

A similar but probably unrelated issue is that if I switch from the standard NVENC encoder to Custom Output, even with the NVENC encoder with nearly the same settings I get the same problem: the frame-rate in the file isn't 59.54 any more.

I'm interested in this configuration (ProRes in particular) because I'm hoping to capture from a 4:2:2 source for grading and editing later (ie: using my PC like at Atomos Ninja V). Even if ProRes doesn't work out I'd love to use Custom Output so I can record my audio in PCM for cleanup in post (AFAIK you can't save PCM any other way), but in either case I'm worried that if the frame rate isn't locked it'll cause problems with sync and editing.
 

[DE]Glen

New Member
I did some more testing:

I made a basic scene with only a color source -- ie: for minimal CPU load.

I used NVENC with settings I believe are recommended by NVidia:

RecordSettings.png


I left the Color Format at NV12, and recorded a 5 second clip. I then switched the Color format to I444:

I444.png


I recorded another 5 second clip.

I then ran both output files through FFprobe:

Code:
ffprobe -hide_banner -i "2022-05-15 16-47-58.mov"
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2022-05-15 16-47-58.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf58.76.100
  Duration: 00:00:05.44, start: 0.000000, bitrate: 213 kb/s
    Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 42 kb/s, 59.94 fps, 59.94 tbr, 60k tbn, 119.88 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 160 kb/s (default)
    Metadata:
      handler_name    : SoundHandler

ffprobe -hide_banner -i "2022-05-15 16-48-39.mov"
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2022-05-15 16-48-39.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf58.76.100
  Duration: 00:00:05.44, start: 0.000000, bitrate: 2880 kb/s
    Stream #0:0: Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv444p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 2743 kb/s, 60.13 fps, 59.94 tbr, 60k tbn, 119.88 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 159 kb/s (default)
    Metadata:
      handler_name    : SoundHandler

Note how the second clip is in yuv444p (which is kind of cool!) but is somehow 60.13 fps!

I have the obs-studio log if that helps but I can't see any clues in it.

I'll try with x264 software encoding after dinner.

Should I be filing a bug about this?
 

[DE]Glen

New Member
Remarkably software x264 CFR was fine -- unless you use Custom Output (FFmpeg)

Using the standard recording settings:

Standard_x264.png


I get:

Stream #0:0: Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv444p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 36 kb/s, 59.94 fps, 59.94 tbr, 60k tbn, 119.88 tbc (default)

Which is great -- except no PCM audio -- for that we need to use Custom Output, something like this:

CustomOutput_x264.png


But that hits the same 'not quite 59.94 FPS' problem:

Stream #0:0: Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv444p(tv, bt709), 1920x1080, 41 kb/s, 60.59 fps, 59.94 tbr, 60k tbn, 119.88 tbc (default)

Maybe this is missing something in the custom output (clearly it's missing aspect ratio annotation) but I haven't been able to figure out how to fix this. And again, if I try to use NVEnc or ProRes instead of x264 here, I get the same problem.

Using software x264 wouldn't be too bad but it seems like figuring out how to make it work for ProRes would be ideal because if you're only going to bother with 4:4:4 if going to be editing anyway.

Summary, changing color format to i444:
- does *not* change frame-rate when using x264 with the standard encoder
- changes the frame-rate using NVEnc (standard encoder)
- changes the frame-rate using anything I've tried with the custom output (ffmpeg): x264, nvenc, or prores
 

[DE]Glen

New Member
I did a test on another machine (Ryzen 9 3950X, RTX 2080) and reproduced the issue easily:
  1. Downloaded OBS zip, extracted, ran with --portable so it wouldn't use any of my normal settings
  2. Cancelled setup wizard
  3. Settings => Video => Canvas Res & Output Res 1920x1080, FPS 59.94
  4. Settings => Output => Output Mode Advanced, Match settings for NVENC at start of thread
  5. Sources => Add color source => Pick some random color
  6. Mute all audio
  7. Record 5 second clip
  8. Settings => Advanced => Video => Color Format I444
  9. Record 5 second clip
  10. Run both MOVs through ffprobe:
    1. NV12 clip 59.94 fps, 59.94 tbr
    2. I444 clip 60.13 fps, 59.94 tbr
Log uploaded here.

Possible workarounds:
  • use software x264
  • use mkv as a container (worked once, needs more testing)
 

[DE]Glen

New Member
On another machine MKV works with Standard output however Custom Output, with libx264, nvenc, and nvenc_h264 codec I still get the same problem. Perhaps there's some sort of muxer arg I can pass to match the standard encoder, I'm not sure.
 
Top