[FFmpeg-user] transcoding multicast into multiple stream in one multicast speed issue

Jakub Vojáček jakub at jacon.cz
Thu May 3 21:36:09 EEST 2018


we're using ffmpeg ffmpeg version N-90933-g177133a0f4. We have one input
multicast that has video and audio. We are transcoding the video into 4
different bitrates along with the one audio into another multicast (that we
work with - package with shaka packager for live streams and capture
recordings with ffmpeg into a mp4 file).

The reason we're doing 1:1 and not 1:5 multicast is because when capturing
recording, its easier to record just one multicast instead of 5 of them and
then having to synchronize audio and video.

A sample command is:
ffmpeg -y  -hwaccel_device 3 -hwaccel cuvid -c:v h264_cuvid -vsync 0 -deint
2 -drop_second_field 1 -surfaces 10 -i 'udp://@' \
 -map i:0x6ae -filter:v:0
fps=30,scale_npp=640:360:format=same:interp_algo=lanczos -r:v:0 30
-aspect:v:0 16:9 -g:v:0 96 -vcodec:v:0 h264_nvenc -b:v:0 400K -minrate:v:0
400k -maxrate:v:0 400k \
 -map i:0x6ae -filter:v:1
fps=30,scale_npp=720:410:format=same:interp_algo=lanczos -r:v:1 30
-aspect:v:1 16:9 -g:v:1 96 -vcodec:v:1 h264_nvenc -b:v:1 1000K -minrate:v:1
1000k -maxrate:v:1 1000k \
 -map i:0x6ae -filter:v:2
fps=30,scale_npp=1280:720:format=same:interp_algo=lanczos -r:v:2 30
-aspect:v:2 16:9 -g:v:2 96 -vcodec:v:2 h264_nvenc -b:v:2 2500K -minrate:v:2
2500k -maxrate:v:2 2500k \
 -map i:0x6ae -filter:v:3
fps=30,scale_npp=1920:1080:format=same:interp_algo=lanczos -r:v:3 30
-aspect:v:3 16:9 -g:v:3 96 -vcodec:v:3 h264_nvenc -b:v:3 4500K -minrate:v:3
4500k -maxrate:v:3 4500k \
 -map i:0x6ab -ab:a:0 128k -ar:a:0 48k -acodec:a:0 aac -ac:a:0 2 \
 -f mpegts "udp://@"

In a perfect situation, the output of ffmpeg looks like

frame=1088278 fps= 30 q=30.0 q=26.0 q=24.0 q=24.0 size=40809966kB
time=10:04:37.26 bitrate=9215.6kbits/s speed=   1x
frame=1088295 fps= 30 q=30.0 q=25.0 q=24.0 q=24.0 size=40810654kB
time=10:04:37.83 bitrate=9215.6kbits/s speed=   1x

What we're aiming on, is to have speed 1x. Not slower. Since we're
packaging the output of ffmpeg, we cannot let the ffmpeg be slower then 1x
and fall behind live and be slow. What does sometimes happen is that
ffmpege is running like

frame= 2554 fps= 22 q=23.0 q=13.0 q=15.0 q=16.0 size=   88595kB
time=00:01:26.10 bitrate=8429.4kbits/s speed=0.748x
frame= 2564 fps= 22 q=21.0 q=14.0 q=16.0 q=17.0 size=   88639kB
time=00:01:26.43 bitrate=8401.0kbits/s speed=0.747x

that is with a low speed. It is not due to hardware issues, the server
we're testing on server that has got 32 core cpu, 380gb ram and 4x Quadro
P5000 GPU and we're only transcoding 2 channels like this. It seems rather
random whether it's 1x or slower. most of the times, a restart is enough to
get back the speed to 1x.

Do you please have any idea what are we doing wrong or what we can do to
force the ffmpeg to run at 1x speed?

Thank you
[image: jacon] *Jakub Vojacek*
*Senior developer*
*JACON s.r.o*
*email:* jakub at jacon.cz || *web:* http://www.jacon.cz <http://jacon.cz/>

More information about the ffmpeg-user mailing list