View Single Post
Old 04-03-2019, 07:10 AM   #1
David Else
Human being with feelings
 
Join Date: Mar 2012
Posts: 610
Default How To Convert .MTS Video (Sony Cameras) to .MKV using FFMPEG

I had no idea how simple it was! I used to actually re-encode the file, no need, you can convert in about 2 seconds and then edit your video in Reaper

You just need to copy the video and audio into a new container and strip the subtitles.

If for some crazy reason you are not using Linux, the FFMPEG commands are inside the script:

Just save this and make it executable, make sure FFMPEG is in the $PATH and enter the script name followed by the file name, or the script name followed by --all to convert the entire directory.

#!/usr/bin/env bash

OPTION="$1"

if [[ $OPTION =~ \.MTS$ ]]; then
# -sn blocks all subtitle streams from being filtered/automatically selected/mapped for any output
ffmpeg -i "$OPTION" -c copy -sn "$OPTION".mkv
fi

if [[ $OPTION == '--all' ]]; then
for i in *.MTS; do
[ -f "$i" ] || break
ffmpeg -i "$i" -c copy -sn "$i".mkv
done
fi

echo 'Please add the name of an .MTS file or --all'
__________________
----------> Debian Linux Distribution = Computing Joy & Freedom <----------
David Else is offline   Reply With Quote