VideoHelp Forum
+ Reply to Thread
Results 1 to 4 of 4
Thread
  1. Member
    Join Date
    Mar 2012
    Location
    Argentina
    Search PM
    Hello. This is my first post to the forum. I own a Canon SX130 which shoots movies using h264 and PCM wav into a MOV container. Always had synch problems using MPEG Streamclip and QuickTime Player 7.6.6. They worked pretty good when just joining original clips from the camera, but if I split or trimmed those clips then serious out of synch took place when joining them.

    Then I started to use Avidemux. You can Open a MOV clip then Append others. Now by selecting A and B markers delete the parts you don't want, always cutting at (I)frames. Once you've finished, save using MKV format (leave Video and Audio at Copy mode). Done. Play the new MKV with your favorite player to check if there's any A/V synch issues (none with the SX130's MOV files).

    Ok so we now have a MKV file. Not good if you use Sony Vegas, as I do. It just doesn't see them. So lets get that file back to MOV format. Here's where we need FFMEG to extract the audio and video tracks then mux them into a MOV container. I assume you already got FFMPEG installed and working. So these are the lines to get the job done.

    To extract the H.264 video track,
    ffmpeg -i "file.mkv" -an -vcodec copy "file.mp4"

    To extract the WAV audio track,
    ffmpeg -i "file.mkv" -vn -acodec copy "file.wav"

    To merge both tracks into the final MOV file,
    ffmpeg.exe -i "file.mp4" -i "file.wav" -vcodec copy -acodec copy -f mov "file.mov"

    Ignore all FFMPEG warnings and check if the final file is ok. Here's a batch file I finally got working. You can drag and drop one or several MKV files into it and you'll get the three lines above executed.

    ************************************************** ****
    @echo off

    set "arg=%*"
    set "arg=%arg=^)%"
    set "arg=%arg=^(%"
    set "arg=%arg:.mkv=%"

    for %%a in (%arg%) do (
    ffmpeg -i "%%~fa".mkv -an -vcodec copy "%%~fa"_video_mp4.mp4
    ffmpeg -i "%%~fa".mkv -vn -acodec copy "%%~fa"_audio_wav.wav
    ffmpeg.exe -i "%%~fa"_video_mp4.mp4 -i "%%~fa"_audio_wav.wav -vcodec copy -acodec copy -f mov "%%~fa"_mov.mov
    del "%%~fa"_video_mp4.mp4
    del "%%~fa"_audio_wav.wav )

    pause
    ************************************************** ****

    Sorry if I wasn't clear enough explaining this drill. Hope it works with other MOV files other than the Canon SX130's. Always a good thing to keep yourself away from re-encoding
    Last edited by truchopol; 11th Mar 2012 at 20:37.
    Quote Quote  
  2. Member bat999's Avatar
    Join Date
    Feb 2008
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by truchopol View Post

    To extract the H.264 video track,
    ffmpeg -i "file.mkv" -an -vcodec copy "file.mp4"

    To extract the WAV audio track,
    ffmpeg -i "file.mkv" -vn -acodec copy "file.wav"

    To merge both tracks into the final MOV file,
    ffmpeg.exe -i "file.mp4" -i "file.wav" -vcodec copy -acodec copy -f mov "file.mov"

    Hi
    This part can all be done in one step.
    Code:
    ffmpeg.exe -i "file.mkv" -vcodec copy -acodec copy "file.mov"
    And with latest versions of FFmpeg:-
    Code:
    ffmpeg.exe -i "file.mkv" -c copy "file.mov"
    Quote Quote  
  3. Member
    Join Date
    Mar 2012
    Location
    Argentina
    Search PM
    Well that simplifies things a lot. Thanks for the tip.
    Quote Quote  
  4. Jackson jvcbpl's Avatar
    Join Date
    Feb 2012
    Location
    India
    Search Comp PM
    hi i have same canon sx130, but i use super converter, join and convert to avi in one go, as the HD files are huge.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!