Bug? Magix AVC w/ NVidia GPU renders "Variable Frame Rate" since 216

joseph-w wrote on 11/27/2017, 12:09 AM

(The above photos are a comparison of stats rendered using the default "Internet HD 1080p 59.94 fps NVidia NVENC" to render out a small section of a vegas project. Left is the initial build of V15 / Right is 216 (update 1). Notice the variable frame rate listing on 216)
----

I was noticing minor A/V sync issues on a couple long projects I'd recently rendered w/ Version 15.  It was driving me crazy that my Magix AVC MP4 renders would not match up for the full duration after I re-imported them back in to my project and lined up the audio.  They would match frame for frame for about 17minutes and then a frame would seemingly get dropped throwing the remainder of the video out of sync (and I think that would happen again after another 17 or so minutes adding to the sync offset).

At first I thought this was probably a codec issue so I tried all sorts of adjustments in that area (disabling so4compound was of course one of the first things I tried).  

What I eventually found w/ help of MediaInfo (https://mediaarea.net/en/MediaInfo) which shows detailed media file codec info/statistics is that the latest build (216) of Vegas creates "Variable Frame Rate" MP4s when Magix AVC w/ NVEnc is used.  For example the following is the fps info listed for MP4s created w/ the default "Internet HD 1080p 59.94 fps (NVidia NVENC)" template using Vegas 15 build 216. :

==
Frame rate mode             : Variable
Frame rate                  : 59.940 (59940/1000) FPS
Minimum frame rate          : 59.940 FPS
Maximum frame rate          : 60.000 FPS
Original frame rate         : 59.940 (60000/1001) FPS
==

I checking a few pre-october mp4 renders I'd made w/ the initial build of V15 using the same templates and those all showed constant fps:

Frame rate mode             : Constant
Frame rate                  : 59.940 (60000/1001) FPS

To confirm this was a bug(?) introduced in the most recent build of Vegas I uninstalled/reinstalled the initial build from late August and rendered a clip from the exact same project.  FPS was constant 59.940 again.

I reproduced the mediainfo variable/constant results by creating a simple project that included only a JPG on a video track and a WAV for an audio track.  Rendered using the default Magix AVC + NVIDIA Enc templates produces "variable frame rate" mp4s in the latest build. These variable fps mp4s seem to have a small decimal remainder (ie: 59.41 instead of 59.40) which eventually causes sync drift.  At least that's what I'm seeing when I reimport the Vegas V15 build 216 MP4 back in to Vegas directly above my 2hr project.  Frames start to mismatch ~17min in.

Rendering out w/ Magix AVC w/o NVENC produces a constant FPS MP4 even w/ the latest build so this seems to be a problem exclusive to GPU rendering. I have been using the latest NVidia driver (388.1x but did roll back to 381.xx to confirm the issue wasn't driver related - it wasn't). I have a GTX960 installed on the system I'm working on.

I think I've tested this enough on my side to make the assumption it's not just my system but if anyone tries to reproduce this please post your results.  Once you install mediainfo you can just right click on any video file and pick "mediainfo" to get statistics.  I did also open the MP4s in virtualdub to confirm the fps interpretation wasn't exclusive to mediainfo.
 

If you have time to render out an MP4 longer than 18 or so minutes that would be the ultimate way to see the problem that this causes. Use build 216 and render out a vegas project that is longer than 18min using the default Internet HD 1080p 59.94 fps (NVidia NVENC) template. When that finishes open the created MP4 back in to the same project on and line it up on new audio/video track directly below what you just rendered out. Align the audio waveforms and then use either the opacity/composite fader (or solo) and switch between the project and imported MP4 watching the preview window to see if the frames match. You should see that somewhere around 17min they'll cease to match up.

Comments

Former user wrote on 11/27/2017, 5:37 AM

I checked out a small Nvenc render from a 4K project to FHD (source and output 25fps). Mediainfo reports audio output clip fps as 46.875 fps (1024 SPF). It reports Video fps as 25. Video frame rate mode=CONSTANT FRAME RATE.

I checked the properties in Windows, it gives 25 fps.

I loaded the rendered clip back into Vegas and it reports 25 fps.

I checked out the audio fps of the same source rendered NOT using the nvenc option and Mediainfo reports the audio fps as 46.875 fps (1024 SPF), video fps as 25.

Mediainfo doesn’t give, in these cases an audio “frame rate mode”.

Musicvid wrote on 11/27/2017, 5:45 AM

It's not variable. It's the way MediaInfo reports certain files, including x264/265.

For some reason it is seeing normal rounding jitter, which is the irrational quotient of the frame rate (60*[1000/1001]) divided by the encoder clock frequency.

joseph-w wrote on 11/27/2017, 7:57 AM

It's not variable. It's the way MediaInfo reports certain files, including x264/265.

For some reason it is seeing normal rounding jitter, which is the irrational quotient of the frame rate (60*[1000/1001]) divided by the encoder clock frequency.

Ahh interesting. I guess my question then is why did it change from build 177 to 216? I couldn't find any MP4s I rendered before October 4 (build 216 release) that show up as variable in mediainfo. (or any after that show up w/ constant)

What i need to do is roll back to build 177 again, render out a full 2hr project w/ Magix AVC NVENC, and see if that aligns perfectly when brought back in to Vegas. If it does on 177 I'll check that same mp4 with 216. If it doesn't on 177 (while still showing constant in media like all other 177 MP4 renders) than I suppose my issue could be with importing (and not rendering) after all.

I'm still curious why CPU only (non-GPU renders) nor my NVENC renders in the previous build don't show the jitter.

Thank you kindly for your replies and to Magix for continuing to develop this wonderful software. I love the speed of the GPU renders. I've read through the forum and I know there will be updates to the codecs/encoders in the next version to fix other issues (like not being able to set the render to exactly 30 or 60fps - only 29.97/59.94) which could fix my problem or give me a workaround.
 

Musicvid wrote on 11/27/2017, 8:30 AM

. I guess my question then is why did it change from build 177 to 216?

There are indications that certain header data is being reported differently, or not at all, in recent versions. The way Magix color space is being reported has changed, too.

But the tendency of MediaInfo to misreport CFR is well known in the wild.

I think your observation may not be as crucial in finding the cause of your audio sync problems.

Musicvid wrote on 11/27/2017, 8:42 AM

Note that MediaInfo guessed the frame rate at (59940/1000), not the correct (60000/1001).

joseph-w wrote on 11/27/2017, 12:27 PM

. I guess my question then is why did it change from build 177 to 216?

There are indications that certain header data is being reported differently, or not at all, in recent versions. The way Magix color space is being reported has changed, too.

But the tendency of MediaInfo to misreport CFR is well known in the wild.

I think your observation may not be as crucial in finding the cause of your audio sync problems.

Thank you and I think you are right. I was able to get build 216 to render an MP4 that showed as "constant frame rate" by replacing files in the FileIO_Plugsin folder with one from the previous build. After I rendered the full project I am still seeing that the frames on my imported render stop matching the project after ~17min (in spite of constant fps showing in mediainfo).

It could be an issue w/ my version of Cineform or something else.

I appreciate people talking this out with me. I'll update the title.

Musicvid wrote on 11/27/2017, 12:33 PM

In my experience, vfr video and/or dropped frames are two of the biggest contributors to audio sync issues.

But this poster does not have vfr video.

Musicvid wrote on 11/27/2017, 1:00 PM

Go to your Project Media and post what Vegas is saying about your file properties.

59.940/60.000 would cause a dropped frame every 999 seconds, or every 16 minutes, 39 seconds. So the header data (or lack of it) may be fooling Vegas, too.

joseph-w wrote on 3/3/2018, 3:29 AM

I've still noticed this problem on my office computer which runs the latest Vegas 15 (version 311). Files will go out of sync after 16min or so and it seems the problem is due to the header (or file) being written as "Variable Frame Rate" (at least using the Magix MP4 codec)

I found a workaround.

I compared the files in the Vegas 15 FileIO folder (Program Files\VEGAS\VEGAS Pro 15.0\FileIO Plug-Ins) to older versions and noticed that a new folder was added in 216+: "mcaacplug" (Main Concept AAC). This folder wasn't there in versions prior to 216 and my renders always had a Constant Frame Rate per MediaInfo. Post 216 all MP4 renders of length seem to drop a frame after 16min or so.

I cut/pasted the mcaaplug directory out of the Vegas folder and moved it elsewhere on the PC (removing it from the Vegas FileIO folder but keep it as a backup). Now my mediainfo shows my renders w/ "Constant 29.970 (30000/1001) FPS" as intended and not "Variable (30000/1001) FPS / Minimum frame rate: 29.970 FPS / Maximum frame rate 30.000 fps" Mp4s w/ the Variable designation go out of sync.

I removed the folder over a month ago and have rendered w/o issue since.

I'm posting this for anyone else who may run in to the same problem and hopefully the content of the mcaacplug folder could be reviewed for a future update. I'm not a coder but seems like a rounding/decimal issue could cause this (I think that's Musicvid above was explaining).