[FFmpeg-user] joining avchd files

Jan Ehrhardt phpdev at ehrhardt.nl
Mon Oct 29 02:48:30 CET 2012


sean darcy in gmane.comp.video.ffmpeg.user (Sun, 28 Oct 2012 12:51:31
-0400):
>My Canon camcorder writes avchd in mpegts container with h264 video and 
>ac3 audio.
>
>Input #0, mpegts, from '00006.MTS':
>   Duration: 00:04:10.77, start: 1953.927489, bitrate: 16851 kb/s
>   Program 1
>     Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), 
>yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 59.94 fps, 59.94 tbr, 90k tbn, 
>59.94 tbc
>     Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 
>stereo, s16, 256 kb/s

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. 

You might have to transform your fps to an integer, say 30, at first
filter in the filter_complex. See
http://comments.gmane.org/gmane.comp.video.ffmpeg.user/40741

In this discussion I also made a note to myself: "I really have to test
my setup on 29.97fps files". Maybe you can do that ;-)

See this discussion as well:
http://comments.gmane.org/gmane.comp.video.ffmpeg.user/40986

Both references are to earlier discussions on this list, but Gmane
presents them quite readable on the web...

Jan



More information about the ffmpeg-user mailing list