[FFmpeg-user] MPEG-2 to H264 jerky output - soccer match

José María Infanzón jocheinfa at gmail.com
Mon Jan 8 02:37:36 EET 2018


The outputs of the encoder is mpeg-2 and is encoded to h.264. Running
ffprobe on the encoder output we have:

Input #0, mpegts, from 'udp://@224.2.2.2:1005':
  Duration: N/A, start: 5006.384056, bitrate: 5256 kb/s
  Program 1025
    Metadata:
      service_name    : DTV4
      service_provider:
    Stream #0:0[0x401]: Video: *mpeg2video* (Main) ([2][0][0][0] / 0x0002),
*yuv420p*(tv, bottom first), *720x576* [SAR 64:45 DAR 16:9], Closed
Captions, 5000 kb/s,* 25 fps*, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x402]: Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz,
stereo, fltp, 256 kb/s

*PROBLEM*

When we encode another stream, let's say a movie from mpeg-2 to h264 final
result is pretty good, but when we encode on a sport channel the result is
very jerky. For example on a soccer match, *around the players* is kind of
"micro" pixelated or blurred. The TV used to stream is a *full HD *and the
output image can be seen in

https://drive.google.com/file/d/1TnjkEsq5IOtwMUoCnwa6W5TPAz-gJ2i9/view?usp=sharing


All *the commands I've tried* are:

ffmpeg -loglevel debug -threads 0 -y -i udp://@224.2.2.2:1005 -vprofile
main -acodec aac -b:a 96k -vcodec libx264 -preset slow -r 25 -g 45
-filter:v "yadif,scale=720:576" -maxrate 2000k -bufsize 4000k -f flv
rtmp://localhost/live/tnt_sport


ffmpeg -loglevel debug -threads 0 -y -i udp://@224.2.2.2:1005 -vprofile
main -acodec aac -b:a 96k -vcodec libx264 -preset slow -filter:v
"yadif,scale=720:576:-1" -maxrate 2000k -bufsize 4000k -f flv
rtmp://localhost/live/tnt_sport



ffmpeg -loglevel debug -threads 0 -y -i udp://@224.2.2.2:1005 -vprofile
main -acodec aac -b:a 96k -vcodec libx264 -preset slow -r 25 -g 45 -bf 2
-trellis 2 -cmp 2 -subcmp 2 -s 720x576 -maxrate 2000k -bufsize 4000k -f flv
rtmp://localhost/live/tnt_sport

ffmpeg -loglevel debug -threads 0 -y -i udp://@224.2.2.2:1005 -vprofile
main -acodec aac -b:a 96k -vcodec libx264 -preset slow -r 25 -g 45 -bf 2
-trellis 2 -cmp 2 -subcmp 2 -filter:v "yadif,scale=720:576" -maxrate 2000k
-bufsize 4000k -f flv rtmp://localhost/live/tnt_sport


ffmpeg -loglevel debug -threads 0 -y -i udp://@224.2.2.2:1005 -vprofile
main -acodec aac -b:a 96k -vcodec libx264 -preset slow -filter:v
"yadif,scale=720:576" -maxrate 2000k -bufsize 4000k -f flv
rtmp://localhost/live/tnt_sport


ffmpeg -loglevel debug -threads 0 -i udp://@224.2.2.2:1005 -deinterlace
-pix_fmt yuv420p -vcodec libx264 -preset slow -vprofile high -trellis 2
-crf 20 -acodec libfaac -ac 2 -ab 192k -y -f flv rtmp://localhost/live/tnt_
sport


ffmpeg -loglevel error -threads 0 -y -i udp://@224.2.2.2:1005 -vprofile
main -s 854x480 -acodec aac -b:a 96k -vcodec libx264  -g 50 -framerate 25
-preset slower -force_key_frames "expr:gte(t,n_forced*2)" -pix_fmt yuv420p
-aspect 16:9 -filter:v yadif=0:-1:0 -maxrate 2000k -bufsize 4000k -f flv
rtmp://localhost/live/tnt_sport


*The one I've got the best result, but not as good as expected:*

/root/ffmpeg_sources/ffmpeg/ffmpeg -loglevel debug -threads 0 -y -i udp://@
224.2.2.2:1005 -vprofile main -acodec aac -b:a 96k -vcodec libx264 -preset
slow -r 25 -g 45 -filter:v "yadif,scale=720:576" -maxrate 2000k -bufsize
4000k -f flv rtmp://localhost/live/tnt_sport
-- 
José María Infanzón


More information about the ffmpeg-user mailing list