User Tools

Site Tools


howto_convert_canon_mts_files

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

howto_convert_canon_mts_files [2019/07/27 09:50] (current)
anton created
Line 1: Line 1:
  
 +**    How to convert Canon HD *.mts files and batch process them?**
 +
 +(old) as complexity of Cinelerra and direct supported import in Kdeinlive, I decided to move on.
 +
 +(ffmpeg changed a name)
 +
 +<​code>​
 +sudo apt-get install libav-tools
 +sudo apt-get install libavcodec-extra-53
 +</​code>​
 +
 +if you prefer, use command line interface
 +
 +<​code>​
 +sudo apt-get install winff
 +wget http://​www.g-raffa.eu/​Cinelerra/​HOWTO/​Cinelerra4Grandma.wff
 +</​code>​
 +
 +import preset file to winff
 +
 +choose whatever you want, for cinelerra advised:
 +
 +"​Cinelerra intermediate formats > mjpeg , (convert)"​ or "​DNxHD"​
 +
 +after one evening, I realised that my Canon Legria HF M307 was recording audio stream in 256 kb/s and 48000 sample rate.
 +
 +I took a small video, about 10s to play with, because 60sec file is big for testing.
 +
 +and Cinelerra would import such audio steam and hangs with internal Canon codec.
 +
 +So I decided to try to transcode streams inside of *.mts container with follow command:
 +
 +avconv -i cup.mts -ar 44100 -ab 128k -vcodec dnxhd -b 185M cupED.mov
 +
 +let's look what happened:
 +
 +<​code>​
 +anton@LNX-ANTON:​~/​Videos/​test$ ls -l
 +</​code>​
 +
 +size is changed, but not dramaticly, it is good
 +
 +use "​avconv -i file" for information
 +
 +<​code>​
 +anton@LNX-ANTON:​~/​Videos/​test$ avconv -i cup.mts
 +anton@LNX-ANTON:​~/​Videos/​test$ avconv -i cup128k.mov
 +</​code>​
 +
 +That what had to be proven [].
 +
 +cinelerra, load files, cupED.mov
 +
 +add effect (title)
 +
 +file, render
 +
 +path, name i.e. "​RENDERED.mov"​
 +
 +file format: quicktime for linux,
 +
 +(x) render audio tracks (settings: MPEG-4 Audio, 128000, 100%)
 +
 +(x) render video tracks (settings: MPEG-4 Video, 2000000 (x) fix bitrate, 500000, 10 ( ) fix quantization ( ) interlaced, keyframe interval 45)
 +
 +insert nothing
 +
 +"​OK"​
 +
 +<​code>​
 +anton@LNX-ANTON:​~/​Videos/​test$ avconv -i RENDERED.mov
 +</​code>​
 +
 +which is OKAY! :v)
 +
 +to summarize this task: it is necessary to check which quality is a file and how to transcode it.
 +
 + 
 +
 +Today I took a test session and after copying from SD card to HDD *.MTS files, I had to batch convert them. Using shell "​for"​ loop:
 +
 +<​code>​
 +anton@LNX-ANTON:​~/​Videos/​2013 03 06 - myyrmanni/​PRIVATE/​AVCHD/​BDMV/​STREAM$ for file in *.MTS; do avconv -i "​$file"​ -ar 44100 -ab 128k -vcodec dnxhd -b 185M "​$file"​.mov;​ done
 +</​code>​
 +
 +worked fine, and then size check:
 +
 +open with Video player to check codec info:
 +
 +old >> 48000 Hz / 256 kbps, new >> 44100 Hz / 134 kbps
 +
 +last check with Cinelerra, file, new, load files,​insertion strategy "​replace currect project and concatenate tracks",​ extension "​*.mov",​ select all, ok, shift+scrollUp,​ check end of video
 +
 +*.MTS files deleted
 +
 +Final files are very large 117 Mb transcoded into 2,8 Gb. That is not actually what I needed.
 +
 +You can also try to transcode only audio track:
 +
 +<​code>​
 +avconv -i cup.mts -ar 44100 -ab 128k -vcodec copy cupED.mov
 +</​code>​
 +
 +After second evening of discovering of disadvantages of transcoding / moving / importing *.MTS files. Suddenly I realised, that, really, I would not do it all the time. There are standartization of AVCHD on Wikipedia, that tells that directly format'​s support is integrated into Linux soft: Blender, Kdenline, LiVeS, Openshot.
 +
 +Second issue, I discovered from the same document that optimal quality is 1920x1080 25fps interlaced, not 50 fps as I thought.
 +
 +Third issue is a final media, if it will be as a final target of video project would be Blu-Ray disc, that is in its maximum resolution 1920x1080 30i, and not 50 fps again as I thought before. Normal DVD is 720x576 25i
 +
 +Fourth issue is that less frames is used, more effective is editing process. =lighter for pc.
 +
 +I read camcoder'​s manual about formats and decided what to use when recording video.
 +
 +Revision: 2014 11 14
howto_convert_canon_mts_files.txt ยท Last modified: 2019/07/27 09:50 by anton