[FFmpeg-user] MPEG-2 to H264 jerky output - soccer match
José María Infanzón
jocheinfa at gmail.com
Mon Jan 8 19:59:33 EET 2018
Since I was not sure if it was interlaced input I've run the following:
ffmpeg -filter:v idet -frames:v 100 -an -f rawvideo -y /dev/null -i udp://@
224.2.2.2:1005
and got:
ffmpeg version N-89707-g89b84cb Copyright (c) 2000-2018 the FFmpeg
developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.5) 20160609
configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static
--extra-cflags=-I/root/ffmpeg_build/include
--extra-ldflags=-L/root/ffmpeg_build/lib --extra-libs='-lpthread -lm'
--bindir=/root/bin --enable-gpl --enable-libass --enable-libfdk-aac
--enable-libfreetype --enable-libmp3lame --enable-libopus
--enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264
--enable-libx265 --enable-nonfree
libavutil 56. 7.100 / 56. 7.100
libavcodec 58. 9.100 / 58. 9.100
libavformat 58. 3.100 / 58. 3.100
libavdevice 58. 0.100 / 58. 0.100
libavfilter 7. 11.100 / 7. 11.100
libswscale 5. 0.101 / 5. 0.101
libswresample 3. 0.101 / 3. 0.101
libpostproc 55. 0.100 / 55. 0.100
[mpeg2video @ 0x3d18800] Invalid frame dimensions 0x0.
Last message repeated 7 times
Input #0, mpegts, from 'udp://@224.2.2.2:1005':
Duration: N/A, start: 1821.583100, 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
Stream mapping:
Stream #0:0 -> #0:0 (mpeg2video (native) -> rawvideo (native))
Press [q] to stop, [?] for help
Output #0, rawvideo, to '/dev/null':
Metadata:
encoder : Lavf58.3.100
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 720x576 [SAR
64:45 DAR 16:9], q=2-31, 124416 kb/s, 25 fps, 25 tbn, 25 tbc
Metadata:
encoder : Lavc58.9.100 rawvideo
frame= 100 fps=0.0 q=-0.0 Lsize= 60750kB time=00:00:04.00
bitrate=124416.0kbits/s dup=11 drop=0 speed= 23x
video:60750kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.000000%
[Parsed_idet_0 @ 0x3d733c0] Repeated Fields: Neither: 90 Top: 0
Bottom: 0
[Parsed_idet_0 @ 0x3d733c0] Single frame detection: TFF: 0 BFF: 90
Progressive: 0 Undetermined: 0
[Parsed_idet_0 @ 0x3d733c0] Multi frame detection: TFF: 0 BFF: 90
Progressive: 0 Undetermined: 0
So apparently it is not interlaced?
2018-01-08 14:54 GMT-03:00 José María Infanzón <jocheinfa at gmail.com>:
>
> Hi Carl - Thanks for your quick reply. This is my first time writing
> through the user list, so my apologies if I miss something. Let me add all
> the outputs with FFPROBE and FFMPEG:
>
> The input is interlaced.
>
>
> *####################### FFPROBE ON INPUT STREAM (MPEG-2)
> #######################*
>
> ffprobe version N-89707-g89b84cb Copyright (c) 2007-2018 the FFmpeg
> developers
> built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.5) 20160609
> configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static
> --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib
> --extra-libs='-lpthread -lm' --bindir=/root/bin --enable-gpl
> --enable-libass --enable-libfdk-aac --enable-libfreetype
> --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis
> --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
> libavutil 56. 7.100 / 56. 7.100
> libavcodec 58. 9.100 / 58. 9.100
> libavformat 58. 3.100 / 58. 3.100
> libavdevice 58. 0.100 / 58. 0.100
> libavfilter 7. 11.100 / 7. 11.100
> libswscale 5. 0.101 / 5. 0.101
> libswresample 3. 0.101 / 3. 0.101
> libpostproc 55. 0.100 / 55. 0.100
> [mpeg2video @ 0x34dcf00] Invalid frame dimensions 0x0.
> Last message repeated 6 times
> Input #0, mpegts, from 'udp://@224.2.2.2:1005':
> Duration: N/A, start: 768.815100, 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
>
> *####################### FFPROBE ON OUTPUT STREAM (H264)
> #######################*
>
> ffprobe version N-89707-g89b84cb Copyright (c) 2007-2018 the FFmpeg
> developers
> built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.5) 20160609
> configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static
> --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib
> --extra-libs='-lpthread -lm' --bindir=/root/bin --enable-gpl
> --enable-libass --enable-libfdk-aac --enable-libfreetype
> --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis
> --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
> libavutil 56. 7.100 / 56. 7.100
> libavcodec 58. 9.100 / 58. 9.100
> libavformat 58. 3.100 / 58. 3.100
> libavdevice 58. 0.100 / 58. 0.100
> libavfilter 7. 11.100 / 7. 11.100
> libswscale 5. 0.101 / 5. 0.101
> libswresample 3. 0.101 / 3. 0.101
> libpostproc 55. 0.100 / 55. 0.100
> [hls,applehttp @ 0x4bead40] Opening 'http://localhost:6081/hls/
> tnt_sport/2_1/index.m3u8?sessId=2541' for reading
> [hls,applehttp @ 0x4bead40] Opening 'http://localhost:6081/hls/
> tnt_sport/2_1/9901_24381.ts?sessId=2541' for reading
> [hls,applehttp @ 0x4bead40] Opening 'http://localhost:6081/hls/
> tnt_sport/2_1/24381_32861.ts?sessId=2541' for reading
> Input #0, hls,applehttp, from 'http://localhost:6081/hls/
> tnt_sport/index.m3u':
> Duration: N/A, start: 9.920000, bitrate: N/A
> Program 0
> Metadata:
> variant_bitrate : 2303320
> Stream #0:0: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz,
> stereo, fltp
> Metadata:
> variant_bitrate : 2303320
> Stream #0:1: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p,
> 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
> Metadata:
> variant_bitrate : 2303320
>
>
> *####################### FFMPEG COMMANDS USED TO ENCODE MPEG2-->H264
> #######################*
>
> /root/ffmpeg_sources/ffmpeg/ffmpeg -loglevel debug -threads 0 y -i udp://@
> 224.2.2.2:1005 -vprofile high -acodec aac -b:a 96k -vcodec libx264
> -preset slow -filter:v "yadif=1" -tune film -b:v 2000k -maxrate 2500k
> -bufsize 4000k -r 25 -f flv rtmp://localhost/live/tnt_sport
>
>
>
> *####################### FFMPEG OUTPUT #######################*
>
> ffmpeg version N-89707-g89b84cb Copyright (c) 2000-2018 the FFmpeg
> developers
> built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.5) 20160609
> configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static
> --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib
> --extra-libs='-lpthread -lm' --bindir=/root/bin --enable-gpl
> --enable-libass --enable-libfdk-aac --enable-libfreetype
> --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis
> --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
> libavutil 56. 7.100 / 56. 7.100
> libavcodec 58. 9.100 / 58. 9.100
> libavformat 58. 3.100 / 58. 3.100
> libavdevice 58. 0.100 / 58. 0.100
> libavfilter 7. 11.100 / 7. 11.100
> libswscale 5. 0.101 / 5. 0.101
> libswresample 3. 0.101 / 3. 0.101
> libpostproc 55. 0.100 / 55. 0.100
> Splitting the commandline.
> Reading option '-loglevel' ... matched as option 'loglevel' (set logging
> level) with argument 'debug'.
> Reading option '-threads' ... matched as AVOption 'threads' with argument
> '0'.
> Reading option '-y' ... matched as option 'y' (overwrite output files)
> with argument '1'.
> Reading option '-i' ... matched as input url with argument 'udp://@
> 224.2.2.2:1005'.
> Reading option '-vprofile' ... matched as AVOption 'vprofile' with
> argument 'high'.
> Reading option '-acodec' ... matched as option 'acodec' (force audio codec
> ('copy' to copy stream)) with argument 'aac'.
> Reading option '-b:a' ... matched as option 'b' (video bitrate (please use
> -b:v)) with argument '96k'.
> Reading option '-vcodec' ... matched as option 'vcodec' (force video codec
> ('copy' to copy stream)) with argument 'libx264'.
> Reading option '-preset' ... matched as AVOption 'preset' with argument
> 'slow'.
> Reading option '-filter:v' ... matched as option 'filter' (set stream
> filtergraph) with argument 'yadif=1'.
> Reading option '-tune' ... matched as AVOption 'tune' with argument 'film'.
> Reading option '-b:v' ... matched as option 'b' (video bitrate (please use
> -b:v)) with argument '2000k'.
> Reading option '-maxrate' ... matched as AVOption 'maxrate' with argument
> '2500k'.
> Reading option '-bufsize' ... matched as AVOption 'bufsize' with argument
> '4000k'.
> Reading option '-r' ... matched as option 'r' (set frame rate (Hz value,
> fraction or abbreviation)) with argument '25'.
> Reading option '-f' ... matched as option 'f' (force format) with argument
> 'flv'.
> Reading option 'rtmp://localhost/live/tnt_sport' ... matched as output
> url.
> Finished splitting the commandline.
> Parsing a group of options: global .
> Applying option loglevel (set logging level) with argument debug.
> Applying option y (overwrite output files) with argument 1.
> Successfully parsed a group of options.
> Parsing a group of options: input url udp://@224.2.2.2:1005.
> Successfully parsed a group of options.
> Opening an input file: udp://@224.2.2.2:1005.
> [NULL @ 0x383dac0] Opening 'udp://@224.2.2.2:1005' for reading
> [udp @ 0x383e3c0] No default whitelist set
> [udp @ 0x383e3c0] end receive buffer size reported is 131072
> [mpegts @ 0x383dac0] Format mpegts probed with size=2048 and score=50
> [mpegts @ 0x383dac0] stream=0 stream_type=2 pid=401 prog_reg_desc=
> [mpegts @ 0x383dac0] stream=1 stream_type=81 pid=402 prog_reg_desc=
> [mpegts @ 0x383dac0] Before avformat_find_stream_info() pos: 0 bytes
> read:347424 seeks:0 nb_streams:2
> [mpeg2video @ 0x3862bc0] Invalid frame dimensions 0x0.
> Last message repeated 2 times
> [mpeg2video @ 0x3862bc0] Format yuv420p chosen by get_format().
> [mpegts @ 0x383dac0] max_analyze_duration 5000000 reached at 5024000
> microseconds st:1
> [mpegts @ 0x383dac0] After avformat_find_stream_info() pos: 3569180 bytes
> read:3570308 seeks:0 frames:286
> Input #0, mpegts, from 'udp://@224.2.2.2:1005':
> Duration: N/A, start: 1232.431100, bitrate: 5256 kb/s
> Program 1025
> Metadata:
> service_name : DTV4
> service_provider:
> Stream #0:0[0x401], 127, 1/90000: Video: mpeg2video (Main), 1
> reference frame ([2][0][0][0] / 0x0002), yuv420p(tv, bottom first, left),
> 720x576 [SAR 64:45 DAR 16:9], 0/1, Closed Captions, 5000 kb/s, 25 fps, 25
> tbr, 90k tbn, 50 tbc
> Stream #0:1[0x402], 159, 1/90000: Audio: ac3 ([129][0][0][0] /
> 0x0081), 48000 Hz, stereo, fltp, 256 kb/s
> Successfully opened the file.
> Parsing a group of options: output url rtmp://localhost/live/tnt_sport.
> Applying option acodec (force audio codec ('copy' to copy stream)) with
> argument aac.
> Applying option b:a (video bitrate (please use -b:v)) with argument 96k.
> Applying option vcodec (force video codec ('copy' to copy stream)) with
> argument libx264.
> Applying option filter:v (set stream filtergraph) with argument yadif=1.
> Applying option b:v (video bitrate (please use -b:v)) with argument 2000k.
> Applying option r (set frame rate (Hz value, fraction or abbreviation))
> with argument 25.
> Applying option f (force format) with argument flv.
> Successfully parsed a group of options.
> Opening an output file: rtmp://localhost/live/tnt_sport.
> [rtmp @ 0x3868500] No default whitelist set
> [tcp @ 0x38a13c0] No default whitelist set
> [rtmp @ 0x3868500] Handshaking...
> [rtmp @ 0x3868500] Type answer 3
> [rtmp @ 0x3868500] Server version 1.2.3.4
> [rtmp @ 0x3868500] Proto = rtmp, path = /live/tnt_sport, app = live, fname
> = tnt_sport
> [rtmp @ 0x3868500] New incoming chunk size = 10240000
> [rtmp @ 0x3868500] Window acknowledgement size = 2500000
> [rtmp @ 0x3868500] Max sent, unacked = 2500000
> [rtmp @ 0x3868500] Releasing stream...
> [rtmp @ 0x3868500] FCPublish stream...
> [rtmp @ 0x3868500] Creating stream...
> [rtmp @ 0x3868500] Sending publish command for 'tnt_sport'
> Successfully opened the file.
> detected 8 logical cores
> Stream mapping:
> Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (libx264))
> Stream #0:1 -> #0:1 (ac3 (native) -> aac (native))
> Press [q] to stop, [?] for help
> cur_dts is invalid (this is harmless if it occurs once at the start per
> stream)
> [graph_1_in_0_1 @ 0x389f340] Setting 'time_base' to value '1/48000'
> [graph_1_in_0_1 @ 0x389f340] Setting 'sample_rate' to value '48000'
> [graph_1_in_0_1 @ 0x389f340] Setting 'sample_fmt' to value 'fltp'
> [graph_1_in_0_1 @ 0x389f340] Setting 'channel_layout' to value '0x3'
> [graph_1_in_0_1 @ 0x389f340] tb:1/48000 samplefmt:fltp samplerate:48000
> chlayout:0x3
> [format_out_0_1 @ 0x3867a00] Setting 'sample_fmts' to value 'fltp'
> [format_out_0_1 @ 0x3867a00] Setting 'sample_rates' to value
> '96000|88200|64000|48000|44100|32000|24000|22050|16000|
> 12000|11025|8000|7350'
> [AVFilterGraph @ 0x3869a40] query_formats: 4 queried, 9 merged, 0 already
> done, 0 delayed
> cur_dts is invalid (this is harmless if it occurs once at the start per
> stream)
> Last message repeated 2 times
> [mpeg2video @ 0x38646c0] Format yuv420p chosen by get_format().
> [mpeg2video @ 0x38646c0] Skipping P slice due to !sync
> Last message repeated 35 times
> cur_dts is invalid (this is harmless if it occurs once at the start per
> stream)
> Last message repeated 1 times
> [mpeg2video @ 0x38646c0] Skipping B slice due to open GOP
> Last message repeated 35 times
> cur_dts is invalid (this is harmless if it occurs once at the start per
> stream)
> Last message repeated 2 times
> [mpeg2video @ 0x38646c0] Skipping B slice due to open GOP
> Last message repeated 35 times
> cur_dts is invalid (this is harmless if it occurs once at the start per
> stream)
> Last message repeated 4 times
> [mpeg2video @ 0x38646c0] Skipping B slice due to open GOP
> Last message repeated 35 times
> cur_dts is invalid (this is harmless if it occurs once at the start per
> stream)
> Last message repeated 1 times
> [mpeg2video @ 0x38646c0] Skipping B slice due to open GOP
> Last message repeated 35 times
> cur_dts is invalid (this is harmless if it occurs once at the start per
> stream)
> Last message repeated 1 times
> [Parsed_yadif_0 @ 0x385dc40] Setting 'mode' to value '1'
> [graph 0 input from stream 0:0 @ 0x386c680] Setting 'video_size' to value
> '720x576'
> [graph 0 input from stream 0:0 @ 0x386c680] Setting 'pix_fmt' to value '0'
> [graph 0 input from stream 0:0 @ 0x386c680] Setting 'time_base' to value
> '1/90000'
> [graph 0 input from stream 0:0 @ 0x386c680] Setting 'pixel_aspect' to
> value '64/45'
> [graph 0 input from stream 0:0 @ 0x386c680] Setting 'sws_param' to value
> 'flags=2'
> [graph 0 input from stream 0:0 @ 0x386c680] Setting 'frame_rate' to value
> '25/1'
> [graph 0 input from stream 0:0 @ 0x386c680] w:720 h:576 pixfmt:yuv420p
> tb:1/90000 fr:25/1 sar:64/45 sws_param:flags=2
> [format @ 0x3857f40] Setting 'pix_fmts' to value 'yuv420p|yuvj420p|yuv422p|
> yuvj422p|yuv444p|yuvj444p|nv12|nv16|nv21|yuv420p10le|
> yuv422p10le|yuv444p10le|nv20le'
> [AVFilterGraph @ 0x385e140] query_formats: 4 queried, 3 merged, 0 already
> done, 0 delayed
> [libx264 @ 0x38c4ec0] using mv_range_thread = 24
> [libx264 @ 0x38c4ec0] using SAR=64/45
> [libx264 @ 0x38c4ec0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
> AVX FMA3 BMI2 AVX2
> [libx264 @ 0x38c4ec0] profile High, level 3.0
> [libx264 @ 0x38c4ec0] 264 - core 155 - H.264/MPEG-4 AVC codec - Copyleft
> 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=5
> deblock=1:-1:-1 analyse=0x3:0x113 me=hex subme=8 psy=1 psy_rd=1.00:0.15
> mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11
> fast_pskip=1 chroma_qp_offset=-3 threads=12 lookahead_threads=2
> sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0
> constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=3
> weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40
> intra_refresh=0 rc_lookahead=50 rc=abr mbtree=1 bitrate=2000 ratetol=1.0
> qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=2500 vbv_bufsize=4000
> nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
> Output #0, flv, to 'rtmp://localhost/live/tnt_sport':
> Metadata:
> encoder : Lavf58.3.100
> Stream #0:0, 0, 1/1000: Video: h264 (libx264), 1 reference frame
> ([7][0][0][0] / 0x0007), yuv420p(left), 720x576 [SAR 64:45 DAR 16:9], 0/1,
> q=-1--1, 2000 kb/s, 25 fps, 1k tbn, 25 tbc
> Metadata:
> encoder : Lavc58.9.100 libx264
> Side data:
> cpb: bitrate max/min/avg: 2500000/0/2000000 buffer size: 4000000
> vbv_delay: -1
> Stream #0:1, 0, 1/1000: Audio: aac (LC) ([10][0][0][0] / 0x000A),
> 48000 Hz, stereo, fltp, delay 1024, 96 kb/s
> Metadata:
> encoder : Lavc58.9.100 aac
> cur_dts is invalid (this is harmless if it occurs once at the start per
> stream)
> Last message repeated 2 times
> Clipping frame in rate conversion by 0.036934
> cur_dts is invalid (this is harmless if it occurs once at the start per
> stream)
> Last message repeated 6 times
> *** dropping frame 4 from stream 0 at ts 13
> cur_dts is invalid (this is harmless if it occurs once at the start per
> stream)
> Last message repeated 2 times
> *** dropping frame 5 from stream 0 at ts 14
> cur_dts is invalid (this is harmless if it occurs once at the start per
> stream)
> Last message repeated 2 times
> *** dropping frame 6 from stream 0 at ts 15
> cur_dts is invalid (this is harmless if it occurs once at the start per
> stream)
> Last message repeated 3 times
> *** dropping frame 7 from stream 0 at ts 16
>
>
> Thanks Indeed!
>
>
> 2018-01-08 13:22 GMT-03:00 Carl Eugen Hoyos <ceffmpeg at gmail.com>:
>
>> 2018-01-08 1:37 GMT+01:00 José María Infanzón <jocheinfa at gmail.com>:
>>
>> > 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.
>>
>> Is the input interlaced?
>>
>> > The TV used to stream is a *full HD *and the output image can be
>> > seen in
>>
>> Providing an output image is nearly always useless, an input frame
>> may be helpful.
>>
>> Complete, uncut console output missing, Carl Eugen
>> _______________________________________________
>> ffmpeg-user mailing list
>> ffmpeg-user at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>> To unsubscribe, visit link above, or email
>> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>
>
>
>
> --
> José María Infanzón
>
--
José María Infanzón
More information about the ffmpeg-user
mailing list