[FFmpeg-user] joining avchd files

Jan Ehrhardt phpdev at ehrhardt.nl
Mon Oct 29 12:38:20 CET 2012


Jan Ehrhardt in gmane.comp.video.ffmpeg.user (Mon, 29 Oct 2012 02:48:30 +0100):
>Aha, the dreaded Canon HF M300 camera (or one of its siblings or
>successors) in the US version. I am struggling with these MTS files
>every time I meet them. At the moment I am trying this filter:
>
>-filter_complex " \
>	[0:v]  setpts=PTS-STARTPTS [v0]; \
>	[0:a] asetpts=PTS-STARTPTS [a0]; \
>	[1:v]  setpts=PTS-STARTPTS [v1]; \
>	[1:a] asetpts=PTS-STARTPTS [a1]; \
>	[v0] [a0] [v1] [a1] concat=n=2:v=1:a=1 [v] [a]; \
>	[v] scale=384:288 [vs]" -map [vs] -map [a]
>
>A little hickup is no problem in my case, but A/V sync is a must. 

I tried this with one of my recordings that hit the 2GB limit at 49:02
minutes. It certainly has issues. See the messages from ffmpeg and
ffprobe below:

[mpegts @ 017d1040] PES packet size mismatch
[ac3 @ 0169fe80] incomplete frame

If you want a smooth transition at the stitch a physical cat might
be the only solution.

Jan

ffmpeg.exe -i "\PRIVATE\AVCHD\BDMV\STREAM\00001.MTS" -i "\PRIVATE\AVCHD\BDMV\STREAM\00002.MTS" -filter_complex
"[0:v]setpts=PTS-STARTPTS[v0];[0:a]asetpts=PTS-STARTPTS[a0];[1:v]setpts=PTS-STARTPTS[v1];[1:a]asetpts=PTS-STARTPTS[a1];[v0][a0][v1][a1]concat=n=2:v=1:a=1[v][a]" -map [v] -map [a] -movflags +faststart -s 448x256 -aspect 16:9 -sws_flags bicubic -vcodec
libx264 -b 336k -r 25 -strict -2 -acodec libfaac -ab 96k -ar 48000 -ac 2 -x264opts
global_header=1:partitions=p8x8+b8x8+i8x8:level_idc=30:cabac=0:subq=3:qp_min=0:qp_max=51:qp_step=4:me=dia:subme=0:mixed_refs=0:me_range=16:chroma_me=1:trellis=0:8x8dct=0:cqm=flat:chroma_qp_offset=0:nr=0:keyint=25:min_keyint=12:scenecut=0:ratetol=1.0:qcomp=0.60:ip_factor=1.4:weightp=0:fast_pskip=1:frameref=1:bframes=0:mbtree=1:rc_lookahead=15:sliced_threads=0:threads=8
-y "/SD_VIDEO/PRG001/JanEhrhardt.tmp.mp4"

frame=73451 fps= 65 q=30.0 size=  155302kB time=00:48:58.11 bitrate= 433.0kbits/s    
frame=73484 fps= 65 q=30.0 size=  155362kB time=00:48:59.45 bitrate= 433.0kbits/s    
frame=73517 fps= 65 q=30.0 size=  155419kB time=00:49:00.71 bitrate= 433.0kbits/s    
frame=73549 fps= 65 q=30.0 size=  155502kB time=00:49:01.99 bitrate= 433.0kbits/s    
PES packet size mismatch
[ac3 @ 00000000018d8a00] incomplete frame
frame=73577 fps= 65 q=30.0 size=  155555kB time=00:49:03.24 bitrate= 433.0kbits/s    
frame=73609 fps= 65 q=30.0 size=  155611kB time=00:49:04.52 bitrate= 432.9kbits/s    
frame=73640 fps= 65 q=30.0 size=  155668kB time=00:49:05.80 bitrate= 432.9kbits/s    
frame=73673 fps= 65 q=30.0 size=  155756kB time=00:49:07.10 bitrate= 433.0kbits/s    
frame=73705 fps= 65 q=30.0 size=  155813kB time=00:49:08.36 bitrate= 432.9kbits/s    

E:\PRIVATE\AVCHD\BDMV\STREAM>\utils\ffprobe -show_frames 00001.mts > 00001.txt
ffprobe version 0.11.1 Copyright (c) 2007-2012 the FFmpeg developers
  built on Jul  9 2012 02:35:30 with gcc 4.6.2
[mpegts @ 017d1040] max_analyze_duration 5000000 reached at 5000000
[mpegts @ 017d1040] PES packet size mismatch
Input #0, mpegts, from '00001.mts':
  Duration: 00:49:02.87, start: 0.820033, bitrate: 5554 kb/s
  Program 1
    Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p, 1440x1080 [SAR 4:3 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, s16,256 kb/s
[mpegts @ 017d1040] PES packet size mismatch
[ac3 @ 0169fe80] incomplete frame




More information about the ffmpeg-user mailing list