[FFmpeg-user] Encoding and Concatenating end-to-end MPEG-TS Files to MPEG-TS

Jeff Kirby jeffreyskirby at gmail.com
Thu Sep 8 20:32:41 CEST 2011


I’m having a problem with concatenating similarly x264/libfaac encoded MPEG
TS files end-to-end.  The problem is a visible via a 1 to 2 second
visual/audible interrupt/break during playback of the output file at the
point where one segment ends and the subsequent segments begins.  If I
concatenate the raw mpegts files, via “cat” or the concat option in FFMpeg,
the playback is smooth.  I’m wondering if there is something that I can do
to help alleviate this interrupt/break in the playback of my compressed
concatenated file. Any information or help is much appreciated.  If
necessary I can provide links to the actual files being used.

ffprobe Output of a raw mpegts segment

ffprobe capture-2.ts
ffprobe version N-32226-ga9c6936, Copyright (c) 2007-2011 the FFmpeg
developers
 built on Aug 31 2011 15:56:19 with gcc 4.4.3
 configuration: --enable-gpl --enable-version3 --enable-nonfree
--enable-postproc --enable-libfaac --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libtheora --enable-libvorbis
--enable-libx264 --enable-libxvid --enable-x11grab --enable-libvpx
--enable-libmp3lame
 libavutil    51. 14. 0 / 51. 14. 0
 libavcodec   53. 12. 0 / 53. 12. 0
 libavformat  53. 10. 0 / 53. 10. 0
 libavdevice  53.  3. 0 / 53.  3. 0
 libavfilter   2. 37. 0 /  2. 37. 0
 libswscale    2.  0. 0 /  2.  0. 0
 libpostproc  51.  2. 0 / 51.  2. 0
[mpegts @ 0x2538420] Continuity Check Failed
[mpegts @ 0x2538420] max_analyze_duration 5000000 reached at 5013333
[mpegts @ 0x2538420] Continuity Check Failed
[mpegts @ 0x2538420] Continuity Check Failed
Input #0, mpegts, from 'capture-2.ts':
 Duration: 00:00:30.58, start: 30.083044, bitrate: 7187 kb/s
 Program 1
   Metadata:
     service_name    : Service01
     service_provider: FFmpeg
   Stream #0.0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p,
1280x720 [SAR 1:1 DAR 16:9], 59.96 fps, 59.94 tbr, 90k tbn, 119.88 tbc
   Stream #0.1[0x101]: Audio: aac ([15][0][0][0] / 0x000F), 48000 Hz,
stereo, s16, 127 kb/s

ffprobe output of the encoded file

ffprobe encoded-segment-2.ts
ffprobe version N-32226-ga9c6936, Copyright (c) 2007-2011 the FFmpeg
developers
 built on Aug 31 2011 15:56:19 with gcc 4.4.3
 configuration: --enable-gpl --enable-version3 --enable-nonfree
--enable-postproc --enable-libfaac --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libtheora --enable-libvorbis
--enable-libx264 --enable-libxvid --enable-x11grab --enable-libvpx
--enable-libmp3lame
 libavutil    51. 14. 0 / 51. 14. 0
 libavcodec   53. 12. 0 / 53. 12. 0
 libavformat  53. 10. 0 / 53. 10. 0
 libavdevice  53.  3. 0 / 53.  3. 0
 libavfilter   2. 37. 0 /  2. 37. 0
 libswscale    2.  0. 0 /  2.  0. 0
 libpostproc  51.  2. 0 / 51.  2. 0
[mpegts @ 0x235a420] Continuity Check Failed
[mpegts @ 0x235a420] Continuity Check Failed
[mpegts @ 0x235a420] max_analyze_duration 5000000 reached at 5003333
[mpegts @ 0x235a420] Continuity Check Failed
[mpegts @ 0x235a420] Continuity Check Failed
Input #0, mpegts, from 'encoded-segment-2.ts':
 Duration: 00:00:30.56, start: 1.400000, bitrate: 1945 kb/s
 Program 1
   Metadata:
     service_name    : Service01
     service_provider: FFmpeg
   Stream #0.0[0x100]: Video: h264 (Constrained Baseline) ([27][0][0][0] /
0x001B), yuv420p, 856x480 [SAR 320:321 DAR 16:9], 59.96 fps, 59.94 tbr, 90k
tbn, 119.88 tbc
   Stream #0.1[0x101]: Audio: aac ([15][0][0][0] / 0x000F), 48000 Hz,
stereo, s16, 61 kb/s


Currently I’m compressing the segments with the command

ffmpeg -y -i capture-1.ts -copyts -s 856x480 -vcodec libx264 -bt 2M
-vprofile baseline -acodec libfaac -ab 64K -ac 2 -async 1 -threads 0 -f
mpegts encoded-segment-1.ts


More information about the ffmpeg-user mailing list