Nvenc render corrupted video on arch
I've posted all the details here.
I know someone else who have the same problem in arch. Apparently this problem doesn't happen in Ubuntu.
Yes, I'm aware of it but I haven't been able to find the cause yet. It used to work, but some update outside of SSR seems to have broken it.
I have this same issue on gentoo - it happens when i upgrade ffmpeg from 3.3.x to 3.4.x - if that helps track it down any
I suspect that there is some kind of race condition or something involving reuse of freed memory, because otherwise I can't explain why it works in the ffmpeg command-line tool but not in SSR. But these things are very hard to track down. Maybe knowing the specific version will allow me to dig through the diffs and figure out the cause - thanks!
Edit: Do you know the exact version numbers you tested? That would narrow it down significantly. It turns out that the NVENC code in FFmpeg is still under very active development with hundreds of commits in that time frame. I can't really go through all of them manually, and compiling and testing FFmpeg repeatedly is a lot of work.
id like to bring this back up, since its been quiet
i noticed this change specifically to ssr v4.3 previous ssr v4.2 doesnt have this corrupted video with nvenc
using the same ffmpeg version 4.3.2 ubuntu 18.04.x LTS
@arrowgent Are you sure that the only difference between the two SSR versions you are testing is the version number v4.2 versus v4.3, and nothing else? Because I haven't made any changes to SSR that would affect Nvenc encoding, and this issue has existed for a very long time, long before v4.2.
this was quite some time ago, december 2020 when i noticed this
recently updating ffmpeg to v4.4-1 and setting nvenc doesnt have any issues in ssr
im not sure what else sorry for old info
@MaartenBaert simplescreenrecorder:amd64 (0.4.3+2~ppa1~bionic1, 0.4.4+1~ppa1~bionic1) vs ssr-master 2021-feb-06 src (4.3) vs ssr-master 2021-june-12 src (4.4)
so i wanted to take a moment and look at these differences
this is 4.3 compiled from src, that i have
https://github.com/MaartenBaert/ssr/commit/f7f1405cbeebf0d86d442e898d9d00795c69a4d1

this is 4.4 updated from the PPA yesterday

this is 4.4 i compiled from src today.
https://github.com/MaartenBaert/ssr/commit/90ff226c0cf8dd887643aefe8f4f29f85747c100

notice the libavformat, libavcodec, etc? this difference must be causing NVENC capture corruption
where am i getting the newer libav? a backport ppa that includes ffmpeg etc, doesnt matter, everything else works fine in other areas of my system (obs, mpv, video editing tools, etc)
compiling the source using system libraries allows proper NVENC capture recording if using your PPA, with different libraries compiled than installed, this is causing a corruption in the video
The strange thing is that not only the headers are different, the library version is also different, which means you must have more than one version of FFmpeg installed on your system. What do you get when you run ldd on each of your simplescreenrecorder binaries? This should tell you where the libraries are being loaded from.
For example:
maarten@desktop-maarten ~ $ ldd /usr/bin/simplescreenrecorder | grep libav
libavformat.so.58 => /usr/lib/libavformat.so.58 (0x00007fba6b8da000)
libavcodec.so.58 => /usr/lib/libavcodec.so.58 (0x00007fba6a4a1000)
libavutil.so.56 => /usr/lib/libavutil.so.56 (0x00007fba6a1f6000)
maarten@desktop-maarten ~ $ ldd ~/Documents/ssr/build-release/src/simplescreenrecorder | grep libav
libavformat.so.58 => /usr/lib/libavformat.so.58 (0x00007f35d6169000)
libavcodec.so.58 => /usr/lib/libavcodec.so.58 (0x00007f35d4d30000)
libavutil.so.56 => /usr/lib/libavutil.so.56 (0x00007f35d4a85000)
sure thing can share with you
/usr/bin $ ll simplescreen*
lrwxrwxrwx 1 root root 36 Aug 11 02:25 simplescreenrecorder -> /usr/bin/simplescreenrecorder4.4_src*
-rwxrwxr-x 1 catbox catbox 1597024 May 9 14:40 simplescreenrecorder4.3*
-rwxr-xr-x 1 root root 1288720 May 24 11:59 simplescreenrecorder4.4_ppa*
-rwxrwxr-x 1 catbox catbox 1597024 Aug 11 02:17 simplescreenrecorder4.4_src*
/usr/bin $ ldd simplescreenrecorder|grep libav
libavformat.so.58 => /usr/lib/x86_64-linux-gnu/libavformat.so.58 (0x00007fe9b90e8000)
libavcodec.so.58 => /usr/lib/x86_64-linux-gnu/libavcodec.so.58 (0x00007fe9b7aec000)
libavutil.so.56 => /usr/lib/x86_64-linux-gnu/libavutil.so.56 (0x00007fe9b761b000)
/usr/bin $ ldd simplescreenrecorder4.3|grep libav
libavformat.so.58 => /usr/lib/x86_64-linux-gnu/libavformat.so.58 (0x00007fe4d152f000)
libavcodec.so.58 => /usr/lib/x86_64-linux-gnu/libavcodec.so.58 (0x00007fe4cff33000)
libavutil.so.56 => /usr/lib/x86_64-linux-gnu/libavutil.so.56 (0x00007fe4cfa62000)
/usr/bin $ ldd simplescreenrecorder4.4_ppa|grep libav
libavformat.so.57 => /usr/lib/x86_64-linux-gnu/libavformat.so.57 (0x00007ff83c484000)
libavcodec.so.57 => /usr/lib/x86_64-linux-gnu/libavcodec.so.57 (0x00007ff83ad62000)
libavutil.so.55 => /usr/lib/x86_64-linux-gnu/libavutil.so.55 (0x00007ff83aad5000)
libavcodec.so.58 => /usr/lib/x86_64-linux-gnu/libavcodec.so.58 (0x00007ff829d25000)
libavutil.so.56 => /usr/lib/x86_64-linux-gnu/libavutil.so.56 (0x00007ff829854000)
/usr/bin $ ldd simplescreenrecorder4.4_src|grep libav
libavformat.so.58 => /usr/lib/x86_64-linux-gnu/libavformat.so.58 (0x00007ff6688f9000)
libavcodec.so.58 => /usr/lib/x86_64-linux-gnu/libavcodec.so.58 (0x00007ff6672fd000)
libavutil.so.56 => /usr/lib/x86_64-linux-gnu/libavutil.so.56 (0x00007ff666e2c000)
understandably youre building with default backports & updates with bionic 18.04, i have newer backports from a ppa
theres only one ffmpeg installed from a backporting ppa https://launchpad.net/~savoury1
ffmpeg --version
ffmpeg version 4.4-1ubuntu0~18.04.sav0.1
/usr/bin $ ldd ffmpeg|grep libav
libavdevice.so.58 => /usr/lib/x86_64-linux-gnu/libavdevice.so.58 (0x00007fa5f00e2000)
libavfilter.so.7 => /usr/lib/x86_64-linux-gnu/libavfilter.so.7 (0x00007fa5efa43000)
libavformat.so.58 => /usr/lib/x86_64-linux-gnu/libavformat.so.58 (0x00007fa5ef59c000)
libavcodec.so.58 => /usr/lib/x86_64-linux-gnu/libavcodec.so.58 (0x00007fa5edfa0000)
libavresample.so.4 => /usr/lib/x86_64-linux-gnu/libavresample.so.4 (0x00007fa5edd7e000)
libavutil.so.56 => /usr/lib/x86_64-linux-gnu/libavutil.so.56 (0x00007fa5ed1d6000)
libavc1394.so.0 => /usr/lib/x86_64-linux-gnu/libavc1394.so.0 (0x00007fa5ec414000)