AVCHD quicktime wrapper

I've seen many posts like this around the net and I've yet to see syntax to do this.

Please post an example of ffmpeg syntax to do this.

Thanks.

Agreed.

Through trial and error, I found a few combinations that certainly appear to re-wrap the file without re-encoding. But, I'm positive I could do better if I knew what I was doing. I haven't had any success with h.264 (x264).

This example re-wraps 1080/60i to MPEG4, preserving the AC3 audio (MediaInfo reports the output as progressive, but the framerate is 29.97 - 59.94?):

ffmpeg -i E:\Media\Pictures\2009\000000.m2ts -vcodec mpeg4 -sameq -deinterlace -acodec copy E:\Media\Pictures\2009\000000.mp4

The key to re-wrapping vs. re-encoding appears to be the 'sameq' switch. The 'copy' switch preserves the original stream as-is.
 
This is what I found from ffmpeg document

`-vcodec codec' Force video codec to codec. Use the copy special value to tell that the raw codec data must be copied as is. `-sameq' Use same video quality as source (implies VBR). So, if I understand it correctly, the following command

ffmpeg -i E:\Media\Pictures\2009\000000.m2ts -vcodec mpeg4 -sameq -deinterlace -acodec copy E:\Media\Pictures\2009\000000.mp4

tells ffmpeg to:

take input file E:\Media\Pictures\2009\000000.m2ts and convert it into E:\Media\Pictures\2009\000000.mp4 using mpeg4 video codec with same quality as is, de-interlace and copy the audio stream as is. It does NOT look like it is using sameq switch to re-wrapping the video which is to be in mpeg4 format. Maybe it should use copy keyword right after -vcodec mpeg4?
 
It does NOT look like it is using sameq switch to re-wrapping the video which is to be in mpeg4 format. Maybe it should use copy keyword right after -vcodec mpeg4?

Whatever it does, it does it really fast with these switches. It won't accept the copy switch if I specify a vcodec (-vcodec mpeg4 copy). It crashes if I omit a specific vcodec (-vcodec copy). That may be a problem with my Toshiba laptop.

And... I think we have officially hijacked the thread.
 
This example re-wraps 1080/60i to MPEG4, preserving the AC3 audio (MediaInfo reports the output as progressive, but the framerate is 29.97 - 59.94?):

ffmpeg -i E:\Media\Pictures\2009\000000.m2ts -vcodec mpeg4 -sameq -deinterlace -acodec copy E:\Media\Pictures\2009\000000.mp4

Nope, this does transcode the H.264 (AVC) MTS stream into an .MP4 container using the MPEG-4 video codec which is not the same as H.264. AC3 is also not officially supported by the .MP4 container format (Quicktime will not play it, but VLC does).

If you want to change the container format without transcoding this is what you want:

ffmpeg -i input.MTS -vcodec copy -acodec pcm_s16le output.mov

It will not re-encode video but only transcode audio from AC3 to uncompressed PCM.
 
Back
Top