[FFmpeg-user] The strange frame stack/overlay problem when streaming the desktop.

Hongyi Zhao hongyi.zhao at gmail.com
Sat Jan 23 02:52:09 EET 2021

On Sat, Jan 23, 2021 at 12:17 AM Hongyi Zhao <hongyi.zhao at gmail.com> wrote:
> On Ubuntu 20.10, I compile the latest git master version of fmpeg with
> exhaustive options as shown below:
> $ ffmpeg -h |& grep configuration:
>   configuration: --enable-gpl --enable-nonfree --enable-version3
> --enable-debug --enable-ffplay --enable-indev=sndio
> --enable-outdev=sndio --enable-fontconfig --enable-frei0r
> --enable-openssl --enable-gmp --enable-libgme --enable-gray
> --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf
> --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb
> --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband
> --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis
> --enable-libopus --enable-libtheora --enable-libvidstab
> --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp
> --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d
> --enable-libxvid --enable-libzvbi --enable-libzimg --enable-rpath
> --enable-shared --enable-avisynth --enable-chromaprint --enable-gcrypt
> --enable-ladspa --enable-libaribb24 --enable-libbluray
> --enable-libbs2b --enable-libcaca --enable-libcelt --enable-libcdio
> --enable-libcodec2 --enable-libdc1394 --enable-libfdk-aac
> --enable-libflite --enable-libfontconfig --enable-libgsm
> --enable-libiec61883 --enable-libjack --enable-libklvanc
> --enable-liblensfun --enable-libmodplug --enable-libopenh264
> --enable-libopenmpt --enable-libpulse --enable-librabbitmq
> --enable-librsvg --enable-librtmp --enable-libshine --enable-libsnappy
> --enable-libssh --enable-libtesseract --enable-libtwolame
> --enable-libv4l2 --enable-libxavs2 --enable-libdavs2 --enable-libxcb
> --enable-libxcb-shm --enable-libxcb-xfixes --enable-libxcb-shape
> --enable-libzmq --enable-lv2 --enable-libmysofa --enable-openal
> --enable-opencl --enable-opengl --enable-pocketsphinx --enable-vulkan
> --enable-libdrm --enable-libmfx --enable-pic --enable-lto
> --enable-hardcoded-tables --enable-memory-poisoning --enable-ftrapv
> --enable-linux-perf --enable-libsvtav1
> Then I try to stream my desktop withe following command based on the
> instructions given by
> <https://trac.ffmpeg.org/wiki/EncodingForStreamingSites>:
> $ ffmpeg -f pulse -i default -f x11grab -framerate 60  -video_size
> 1920x1080 -i :1+0,0 \
> -c:v libx264 -preset veryfast -b:v 3000k -maxrate 3000k -bufsize 3000k \
> -vf "scale=1280:-1,format=yuv420p" -g 60 -c:a aac -b:a 128k -ar 44100  \
> -f flv  "rtmp://"
> Then I try to play the streamed desktop with the following command:
> $ ffplay rtmp://
> But I observed a very strange phenomenon: the frames will
> stack/overlay together when I play them in the ffplay as shown in the
> attachment file.

After some thinking, I understood the reason. To be simple, if we
stream the desktop and afterwards play it in situ, the problem will
happen. Obviously, for the case of stream one's desktop, it should be
played/pulled on another desktop.

Best regards,
Assoc. Prof. Hongyi Zhao <hongyi.zhao at gmail.com>
Theory and Simulation of Materials
Hebei Polytechnic University of Science and Technology engineering
NO. 552 North Gangtie Road, Xingtai, China

More information about the ffmpeg-user mailing list