[FFmpeg-user] ffmpeg transcoding multicast to multicast stuck in disk sleep

Jakub Vojáček jakub at jacon.cz
Fri May 25 22:20:30 EEST 2018


we are receiving multicast and using nvidia, we are transcoding it into 2
bitrates and sending to another multicast. When we are having just one
ffmpeg like this, it is working fine. But as we add more channels to
transcode, the ffmpeg is suddenly having problems. It slows down the
transcoding speed from 1x to less, usually 0.6-0.999. But as it is
live content, we cannot have it slower than 1x. The server has plenty of
available resources (RAM, CPU, GPU) when this problem starts to happen.

By looking deeper into the problem, we found that the ffmpeg process is in
the D state (disk sleep) using cat /proc/PID/status. But according to iotop
the hdd, has still available resources. And why is ffmpeg even using
hdd when transcoding from multicast to multicast (network to network)?
There should be no HDD involved, or am I mistaken?

Sample ffmpeg command:

ffmpeg -y  -gpu 1 -c:v h264_cuvid  -deint adaptive -drop_second_field 1
-resize 1920x1080 -i 'udp://@
-filter_complex "[0:0]drawtext=text='':font=DejaVuSans:fontsize=40:
-map "[v1]" -flush_packets 0 -gpu 1 -r:v:0 25 -aspect:v:0 16:9 -g:v:0 80
-vcodec:v:0 h264_nvenc -b:v:0 400K -minrate:v:0 1000k -maxrate:v:0 1000k
-bufsize:v:0 500k \
-map "[v2]" -flush_packets 0 -gpu 1 -r:v:1 25 -aspect:v:1 16:9 -g:v:1 80
-vcodec:v:1 h264_nvenc -b:v:1 4500K -minrate:v:1 4500k -maxrate:v:1 4500k
-bufsize:v:1 2250k \
-map i:0xb08 -flush_packets 0 -ab:a:0 128k -ar:a:0 48k -acodec:a:0
libfdk_aac -ac:a:0 2 -flags:a:0 +global_header \
-f mpegts "udp://@"

ffmpeg configuration (we tried with latest version as well):

ffmpeg version 3.3.1 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18) 20170516
  configuration: --prefix=/usr/local --enable-nonfree --enable-gpl
--enable-version3 --enable-shared --enable-pic --enable-avresample
--enable-fontconfig --enable-frei0r --enable-ladspa --enable-libass
--enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfdk-aac
--enable-libflite --enable-libfreetype --enable-libfribidi
--enable-libmodplug --enable-libmp3lame --enable-libopus --enable-librtmp
--enable-libsoxr --enable-libspeex --enable-libssh --enable-libtwolame
--enable-libv4l2 --enable-libwavpack --enable-libwebp --enable-libx264
--enable-libx265 --enable-libzvbi --enable-decklink --enable-nvenc

Thank you for your ideas and advice.


More information about the ffmpeg-user mailing list