Recorded GIFs flicker (Nvidia graphic driver)
BrainAxe opened this issue · comments
Thanks for reporting. Could you try if other screen recording software suffers from the same issue?
In the end Peek is just using ffmpeg to do the recording, and issues like this are often driver related in which case there is not much I can do :(
Thanks for replying. I just found out other screen recording software (kazam) also having same problem in screen recording :(
Ok. I would love to offer you a workaround, but I have no experience with the Nvidia driver and the available settings and I also can't test it.
Two things I found that could be related:
http://unix.stackexchange.com/questions/156155/x11grab-flickers-in-opengl-draw-areas
http://askubuntu.com/questions/263996/fixing-the-nvidia-graphics-screen-flicker-issue
I will leave this issue open for a while, maybe somebody else has some idea on this.
I had luck with changing the allow flipping setting for the Nvidia driver.
Glad to help guys!
I know this is an old ticket but I also had the same issue and the above solution resolved it for me. Thank you.
Guys, i'm sorry to be late to the party, but disabling the Flipping in nV settings did help, but not completely SOLVE the issue..
Grabbing high framerate still makes the same glitches even with hardware encoder and lowish bitrate!
Settings below, ffmpeg 4.1 compiled standalone to match my 384.xx driver and codec headers version 8.
$ ./ffmpeg -video_size 1024x768 -framerate 60 -f x11grab -i :0.0+100,200 -vcodec h264_nvenc x11_output.mp4 ffmpeg version 4.1.6 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 4.8 (Ubuntu 4.8.5-4ubuntu8~14.04.2) configuration: --prefix=/apps/libav/11.7 --enable-gpl --enable-version3 --enable-nonfree --enable-runtime-cpudetect --enable-gray --enable-vdpau --enable-libmp3lame --enable-libfdk-aac --enable-libtheora --enable-libxcb --cpu=native --enable-vdpau --enable-libwavpack --enable-libxvid --enable-libx264 --enable-nvenc libavutil 56. 22.100 / 56. 22.100 libavcodec 58. 35.100 / 58. 35.100 libavformat 58. 20.100 / 58. 20.100 libavdevice 58. 5.100 / 58. 5.100 libavfilter 7. 40.101 / 7. 40.101 libswscale 5. 3.100 / 5. 3.100 libswresample 3. 3.100 / 3. 3.100 libpostproc 55. 3.100 / 55. 3.100 [x11grab @ 0x2e8a500] Stream #0: not enough frames to estimate rate; consider increasing probesize Input #0, x11grab, from ':0.0+100,200': Duration: N/A, start: 1601796935.110486, bitrate: N/A Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1024x768, 60 fps, 1000k tbr, 1000k tbn, 1000k tbc File 'x11_output.mp4' already exists. Overwrite ? [y/N] y Stream mapping: Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_nvenc)) Press [q] to stop, [?] for help Output #0, mp4, to 'x11_output.mp4': Metadata: encoder : Lavf58.20.100 Stream #0:0: Video: h264 (h264_nvenc) (Main) (avc1 / 0x31637661), bgr0, 1024x768, q=-1--1, 2000 kb/s, 60 fps, 15360 tbn, 60 tbc Metadata: encoder : Lavc58.35.100 h264_nvenc Side data: cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 4000000 vbv_delay: -1 frame= 233 fps=0.0 q=18.0 size= 0kB time=00:00:03.83 bitrate= 0.1kbits/frame= 264 fps=214 q=18.0 size= 0kB time=00:00:04.35 bitrate= 0.1kbits/frame= 296 fps=170 q=18.0 size= 0kB time=00:00:04.88 bitrate= 0.1kbits/frame= 326 fps=145 q=18.0 size= 0kB time=00:00:05.38 bitrate= 0.1kbits/frame= 357 fps=130 q=18.0 size= 0kB time=00:00:05.90 bitrate= 0.1kbits/frame= 386 fps=119 q=18.0 size= 0kB time=00:00:06.38 bitrate= 0.1kbits/frame= 414 fps=110 q=18.0 size= 0kB time=00:00:06.85 bitrate= 0.1kbits/frame= 447 fps=105 q=18.0 size= 256kB time=00:00:07.40 bitrate= 283.4kbits/frame= 476 fps=100 q=18.0 size= 256kB time=00:00:07.88 bitrate= 266.1kbits/frame= 509 fps= 96 q=18.0 size= 512kB time=00:00:08.43 bitrate= 497.4kbits/frame= 540 fps= 93 q=18.0 size= 512kB time=00:00:08.95 bitrate= 468.7kbits/frame= 570 fps= 90 q=18.0 size= 512kB time=00:00:09.45 bitrate= 443.9kbits/
@KiLLAAA This is still likely a video driver issue. You can try to report this to ffmpeg or Nvidia.
@phw yes, it looks like ffmpeg grabs current frame which is still being written at the time.
My workaround is to create a script to deactivate Allow flipping when launching peek
with /usr/bin/nvidia-settings -a 'AllowFlipping=0'
and reactivate it when closing the program. Here is my script:
#!/bin/bash
/usr/bin/nvidia-settings -a 'AllowFlipping=0'
peek
/usr/bin/nvidia-settings -a 'AllowFlipping=1'
Bonus: for those who want to also close peek
when capture is finished:
#!/bin/bash
TARGET=~/bureau/temp/
/usr/bin/nvidia-settings -a 'AllowFlipping=0'
peek & inotifywait -m -e create $TARGET \
| while read FILENAME
do
/usr/bin/nvidia-settings -a 'AllowFlipping=1'
pkill peek
done
Adapt with your path. Needs inotifywait
to work: sudo apt install inotify-tools