[FFmpeg-user] MPEG-TS file to x264 TS (dropped packets?)
Henk D. Schoneveld
belcampo at zonnet.nl
Tue Nov 26 10:41:39 CET 2013
On 26 Nov 2013, at 03:52, Ibrahim Tachijian <barhom at gmail.com> wrote:
> There is no damage of the input file (which in this case is actually a live
> feed from a satellite link). The playback of the input in mpeg2 is perfect
> but for some reason transcoding just produced the dropped packets.
>
> Can somebody confirm that they get the same results (The input file is
> linked below)
With an OSX ffmpeg binary I do get the same results. All video frames are dropped.
With Handbrake however it works fine.
ffmpeg binary
ffmpeg version 1.2-tessus Copyright (c) 2000-2013 the FFmpeg developers
built on Mar 15 2013 01:18:55 with llvm-gcc 4.2.1 (LLVM build 2336.1.00)
Handbrake output
[10:22:58] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[10:22:58] Found the following PIDS
[10:22:58] Video PIDS :
[10:22:58] 0x204 type MPEG2 (0x2) (PCR)
[10:22:58] Audio PIDS :
[10:22:58] 0x2aa type MPEG2 (0x4)
[10:22:58] Subtitle PIDS :
[10:22:58] Other PIDS :
[10:22:58] stream id 0x2aa (type 0x4 substream 0x0) audio 0x2aa
[10:22:58] scan: decoding previews for title 1
[10:22:58] scan: audio 0x2aa: mp2, rate=48000Hz, bitrate=200000 Unknown (MPEG2) (2.0 ch)
[10:22:58] scan: 10 previews, 720x576, 25.000 fps, autocrop = 0/0/0/0, aspect 4:3, PAR 16:15
[10:22:58] stream: 17 good frames, 0 errors (0%)
[10:22:58] libhb: scan thread found 1 valid title(s)
[10:22:58] macgui: ScanDone state received from fQueueEncodeLibhb
[10:22:58] macgui: Preset: Normal (Default)
[10:22:58] macgui: processNewQueueEncode number of passes expected is: 1
[10:22:58] macgui: Start / Stop set to chapters
[10:22:58] macgui: prepareJob exiting
[10:22:58] 1 job(s) to process
[10:22:58] starting job
[10:22:58] sync: expecting 1556 video frames
[10:22:58] job configuration:
[10:22:58] * source
[10:22:58] + /Users/belcampo/Downloads/test.ts
[10:22:58] + title 1, chapter(s) 1 to 1
[10:22:58] * destination
[10:22:58] + /Users/belcampo/Downloads/test.mp4
[10:22:58] + container: MPEG-4 (.mp4 and .m4v)
[10:22:58] * video track
[10:22:58] + decoder: mpeg2
[10:22:58] + bitrate 15000 kbps
[10:22:58] + frame rate: same as source (around 25.000 fps)
[10:22:58] + filters
[10:22:58] + Framerate Shaper (0:27000000:1080000)
[10:22:58] + frame rate: same as source (around 25.000 fps)
[10:22:58] + Crop and Scale (720:576:0:0:0:0)
[10:22:58] + source: 720 * 576, crop (0/0/0/0): 720 * 576, scale: 720 * 576
[10:22:58] + custom anamorphic
[10:22:58] + storage dimensions: 720 * 576, mod 2
[10:22:58] + pixel aspect ratio: 64 / 45
[10:22:58] + display dimensions: 1024 * 576
[10:22:58] + encoder: H.264 (x264)
[10:22:58] + x264 preset: veryfast
[10:22:58] + h264 profile: main
[10:22:58] + h264 level: 4.0
[10:22:58] + quality: 20.00 (RF)
[10:22:58] * audio track 1
[10:22:58] + decoder: Unknown (MPEG2) (2.0 ch) (track 1, id 0x2aa)
[10:22:58] + bitrate: 200 kbps, samplerate: 48000 Hz
[10:22:58] + mixdown: Stereo
[10:22:58] + encoder: AAC (CoreAudio)
[10:22:58] + bitrate: 160 kbps, samplerate: 48000 Hz
[10:22:58] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[10:22:58] encx264: encoding with stored aspect 64/45
[10:22:58] encx264: Encoding at constant RF 20.000000
[10:22:58] reader: first SCR 6599129229 id 0x2aa DTS 6599141338
x264 [warning]: --psnr used with psy on: results will be invalid!
x264 [warning]: --tune psnr should be used if attempting to benchmark psnr!
x264 [info]: using SAR=64/45
[10:22:58] mpeg2: "Chapter 1" (1) at frame 0 time 83722
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
x264 [info]: profile Main, level 4.0
[10:22:59] sync: first pts is 83722
[10:23:04] hb_ts_stream_decode - eof
[10:23:04] reader: done. 1 scr changes
[10:23:04] work: average encoding speed for job is 266.627655 fps
[10:23:04] sync: got 1541 frames, 1556 expected
[10:23:04] render: lost time: 0 (0 frames)
[10:23:04] render: gained time: 0 (0 frames) (0 not accounted for)
[10:23:05] mpeg2 done: 1541 frames
x264 [info]: frame I:8 Avg QP:18.00 size: 41144 PSNR Mean Y:47.00 U:50.60 V:50.65 Avg:47.89 Global:47.81
x264 [info]: frame P:721 Avg QP:21.56 size: 12177 PSNR Mean Y:42.18 U:47.85 V:48.43 Avg:43.41 Global:43.28
x264 [info]: frame B:812 Avg QP:23.44 size: 2735 PSNR Mean Y:41.80 U:47.99 V:48.44 Avg:43.07 Global:42.83
x264 [info]: consecutive B-frames: 12.4% 45.7% 19.1% 22.8%
x264 [info]: mb I I16..4: 20.9% 0.0% 79.1%
x264 [info]: mb P I16..4: 11.3% 0.0% 3.0% P16..4: 34.9% 20.1% 14.5% 0.0% 0.0% skip:16.2%
x264 [info]: mb B I16..4: 1.9% 0.0% 0.1% B16..8: 24.2% 7.4% 1.1% direct: 8.9% skip:56.4% L0:32.5% L1:44.8% BI:22.7%
x264 [info]: coded y,uvDC,uvAC intra: 32.4% 46.7% 8.7% inter: 18.3% 14.0% 0.2%
x264 [info]: i16 v,h,dc,p: 64% 17% 13% 5%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 47% 14% 17% 3% 3% 5% 3% 5% 2%
x264 [info]: i8c dc,h,v,p: 48% 13% 36% 3%
x264 [info]: Weighted P-Frames: Y:0.4% UV:0.0%
x264 [info]: SSIM Mean Y:0.9862643 (18.622db)
x264 [info]: PSNR Mean Y:42.078 U:47.978 V:48.481 Avg:43.322 Global:43.092 kb/s:1448.55
[10:23:05] mp2-decoder done: 0 frames, 0 decoder errors, 0 drops
[10:23:05] mux: track 0, 1541 frames, 11329184 bytes, 1448.74 kbps, fifo 2048
[10:23:05] mux: track 1, 2920 frames, 1074097 bytes, 137.35 kbps, fifo 4096
[10:23:05] stream: 1557 good frames, 0 errors (0%)
[10:23:05] libhb: work result = 0
[10:23:05] macgui: incrementQueueItemDone there are no more pending encodes
>
>
> On Mon, Nov 25, 2013 at 4:02 PM, Ibrahim Tachijian <barhom at gmail.com> wrote:
>
>> We usually have no issues with transcoding mpeg2 video to x264. Audio in
>> this case is mp2 -> aac.
>>
>> However this particular file doesnt want to transcode and its just giving
>> me a bunch of dropped packets. I have no issues with using the *exact* same
>> command line to produce what I want, its just this particular channel
>> (source is from sat) that doesnt want to transcode.
>>
>>
>> The issue with how to reproduce:
>>
>> 1. Download the input file (mpeg2 video with mp2 audio)
>> 2. Run the following command to transcode to x264+aac
>>
>> ffmpeg -analyzeduration 1000000 -i test.ts -c:v libx264 -preset superfast
>> -g 25 -crf 15 -maxrate 9000k -bufsize 1500k -filter:v yadif -c:a libfdk_aac
>> -b:a 96k -f mpegts test-x264.ts
>>
>> 3. All frames are dropped for some reason.
>>
>> Files:
>>
>> Input file can be downloaded from here (its a recording of a satellite
>> channel called MBC MAGHREB AL ARABIA)
>>
>> https://mega.co.nz/#!PRcHCaJB!IfRFawaT8Kmlc4u_Rxk4cHyNJgFjxvWCq23VYDIofGU
>>
>>
>>
>>
>> COMPLETE UNCUT:
>>
>> root at transcoder0:~# ffmpeg -analyzeduration 1000000 -i test.ts -c:v
>> libx264 -preset superfast -g 25 -crf 15 -maxrate 9000k -bufsize 1500k
>> -filter:v yadif -c:a libfdk_aac -b:a 96k -f mpegts test-x264.ts
>> ffmpeg version 1.0.7 Copyright (c) 2000-2013 the FFmpeg developers
>> built on Jul 19 2013 07:14:44 with gcc 4.7 (Debian 4.7.2-5)
>> configuration: --prefix=/usr --extra-cflags='-g -O2 -fstack-protector
>> --param=ssp-buffer-size=4 -Wformat -Werror=format-security '
>> --extra-ldflags='-Wl,-z,relro' --cc='ccache cc' --enable-shared
>> --enable-libmp3lame --enable-gpl --enable-nonfree --enable-libvorbis
>> --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc
>> --enable-x11grab --enable-libgsm --enable-libtheora
>> --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264
>> --enable-libspeex --enable-nonfree --disable-stripping --enable-libvpx
>> --enable-libschroedinger --disable-encoder=libschroedinger
>> --enable-version3 --enable-libopenjpeg --enable-librtmp --enable-avfilter
>> --enable-libfreetype --enable-libvo-aacenc --disable-decoder=amrnb
>> --enable-libvo-amrwbenc --enable-libaacplus
>> --libdir=/usr/lib/x86_64-linux-gnu --disable-vda --enable-libbluray
>> --enable-libcdio --enable-gnutls --enable-frei0r --enable-openssl
>> --enable-libass --enable-libopus --enable-fontconfig --enable-libfdk-aac
>> --enable-libdc1394 --disable-altivec --dis libavutil 51. 73.101 / 51.
>> 73.101
>> libavcodec 54. 59.100 / 54. 59.100
>> libavformat 54. 29.104 / 54. 29.104
>> libavdevice 54. 2.101 / 54. 2.101
>> libavfilter 3. 17.100 / 3. 17.100
>> libswscale 2. 1.101 / 2. 1.101
>> libswresample 0. 15.100 / 0. 15.100
>> libpostproc 52. 0.100 / 52. 0.100
>> [mpeg2video @ 0x1f5a4a0] 0x0 is invalid
>> Last message repeated 3 times
>> [mp2 @ 0x1f5fbc0] Header missing
>> [mpeg2video @ 0x1f5a4a0] 0x0 is invalid
>> Last message repeated 6 times
>> [mpegts @ 0x1f4fd80] max_analyze_duration 1000000 reached at 1008000
>> [mpegts @ 0x1f4fd80] PES packet size mismatch
>> Last message repeated 1 times
>> Input #0, mpegts, from 'test.ts':
>> Duration: 19:00:07.54, start: 4978.976522, bitrate: 3 kb/s
>> Program 9515
>> Metadata:
>> service_name : MBC MAGHREB AL ARABIA
>> service_provider: Du
>> Stream #0:0[0x204]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002),
>> yuv420p, 720x576 [SAR 16:15 DAR 4:3], 15000 kb/s, 45.42 fps, 25 tbr, 90k
>> tbn, 50 tbc
>> Stream #0:1[0x2aa]: Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz,
>> stereo, s16, 128 kb/s
>> No Program
>> Stream #0:2[0x1023]: Audio: mp2, 48000 Hz, stereo, s16, 128 kb/s
>> [libx264 @ 0x1fce320] using SAR=16/15
>> [libx264 @ 0x1fce320] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
>> AVX
>> [libx264 @ 0x1fce320] profile High, level 3.0
>> [mpegts @ 0x1f5e780] muxrate VBR, pcr every 2 pkts, sdt every 200, pat/pmt
>> every 40 pkts
>> Output #0, mpegts, to 'test-x264.ts':
>> Metadata:
>> encoder : Lavf54.29.104
>> Stream #0:0: Video: h264, yuv420p, 720x576 [SAR 16:15 DAR 4:3],
>> q=-1--1, 90k tbn, 25 tbc
>> Stream #0:1: Audio: aac, 48000 Hz, stereo, s16, 96 kb/s
>> Stream mapping:
>> Stream #0:0 -> #0:0 (mpeg2video -> libx264)
>> Stream #0:1 -> #0:1 (mp2 -> libfdk_aac)
>> Press [q] to stop, [?] for help
>> PES packet size mismatch0 size= 0kB time=00:00:00.00 bitrate=
>> 0.0kbits/s dup=0 drop=1421
>> [mpeg2video @ 0x1f5a4a0] ac-tex damaged at 8 29
>> [mpeg2video @ 0x1f5a4a0] Warning MVs not available
>> [mpeg2video @ 0x1f5a4a0] concealing 315 DC, 315 AC, 315 MV errors in P
>> frame
>> [mp2 @ 0x1f5ae00] incomplete frame
>> Error while decoding stream #0:1: Invalid data found when processing input
>> frame= 0 fps=0.0 q=0.0 Lsize= 820kB time=00:00:00.00 bitrate=
>> 0.0kbits/s dup=0 drop=1544
>> video:0kB audio:731kB subtitle:0 global headers:0kB muxing overhead
>> 12.227332%
>> root at transcoder0:~#
>>
>> --
>> Ibrahim Tachijian
>>
>
>
>
> --
> Ibrahim Tachijian
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
More information about the ffmpeg-user
mailing list