Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > VLC/FFMPEG to transcode .MTS to .MP4 (w/no loss)?

VLC/FFMPEG to transcode .MTS to .MP4 (w/no loss)?
Thread Tools
Oneota
Professional Poster
Join Date: May 2000
Location: Urbandale, IA
Status: Offline
Reply With Quote
Sep 28, 2009, 11:40 AM
 
Hey all,

I've got a project where we'll be recording some HD footage on a Canon camcorder that records to .MTS files. We're recording a number of events in rapid succession, and want to quickly burn data DVDs of each event, so we'll be cycling through 3 SDHC cards, recording onto one while processing/burning data from the other 2.

What I want to happen is this:

Event 1 Filmed --> Card inserted/data copied --> [Changed/converted/transcoded] from .MTS to .MP4 (H.264) --> Burn to Data DVD

Hopefully in a short enough time that while we're burning the disc from event 1, we're not rolling around to event 4 so that we don't run out of cards.

Can someone help me out with a command-line VLC or FFMPEG command that'll do this as losslessly as possible? I don't want to scale the video down to 720x480 or anything -- I want it as close to the original quality as possible, just in a format that QuickTime can read natively.

My only alternative, that I can tell, is to enclose a copy of VLC for Mac and Windows on the DVDs that we provide to our event attendees (so they can just open the raw .MTS files), but I'd like to avoid going down that road if possible.
( Last edited by Oneota; Sep 28, 2009 at 12:58 PM. )
"Yields a falsehood when preceded by its quotation" yields a falsehood when preceded by its quotation.
     
mduell
Posting Junkie
Join Date: Oct 2005
Location: Houston, TX
Status: Offline
Reply With Quote
Sep 28, 2009, 12:32 PM
 
You should be able to do this without transcoding the video (probably want to transcode the audio), but I can't find a simple solution to do it. Handbrake should work (you may need the latest svn rather than the last release), but will transcode the video.

Fortunately the need to convert will go away in the near future; Win7 has native AVCHD (MTS) support so I expect Apple will catch up soon.
     
Oneota  (op)
Professional Poster
Join Date: May 2000
Location: Urbandale, IA
Status: Offline
Reply With Quote
Sep 28, 2009, 12:55 PM
 
Originally Posted by mduell View Post
You should be able to do this without transcoding the video (probably want to transcode the audio), but I can't find a simple solution to do it. Handbrake should work (you may need the latest svn rather than the last release), but will transcode the video.

Fortunately the need to convert will go away in the near future; Win7 has native AVCHD (MTS) support so I expect Apple will catch up soon.
Yeah, I had considered Handbrake; but due to the time constraints, re-encoding the video with that app probably won't work -- the conversion needs to happen very quickly (the events being filmed are max 15 minutes long, so if it's going to take an hour to process the video, the whole thing won't work).

This is needed by Oct. 3, so unless the need to convert is going away this week, I still need a solution.
"Yields a falsehood when preceded by its quotation" yields a falsehood when preceded by its quotation.
     
mduell
Posting Junkie
Join Date: Oct 2005
Location: Houston, TX
Status: Offline
Reply With Quote
Sep 28, 2009, 02:51 PM
 
Well that timeframe rules out transcoding the video, which wasn't a great solution anyway but was a path of low resistance.

You're going to have to suck it up and learn ffmpeg. Here's a good place to start:

ffmpeg -i canon_file.mts -vcodec copy -acodec copy -o outfile.mp4

You'll probably also want to convert the audio from AC3 to AAC or similar.
     
Oneota  (op)
Professional Poster
Join Date: May 2000
Location: Urbandale, IA
Status: Offline
Reply With Quote
Sep 30, 2009, 02:35 PM
 
In case anyone runs into this in the future, here's the AppleScript I wrote to tackle this:

Code:
on open files_ set myPath to quoted form of POSIX path of (path to me) repeat with file_ in files_ set file_path to quoted form of POSIX path of file_ set theDate to (do shell script "date +'%H.%M.%S'") try do shell script myPath & "Contents/Resources/ffmpeg -i " & file_path & " -vcodec copy -acodec aac -ab 384k ~/Desktop/OutputMovie-" & theDate & ".mp4" on error e display dialog "Error:" & return & e end try end repeat tell application "Finder" activate display dialog "All done!" & return & "The movie's name is OutputMovie-" & theDate & ".mp4" end tell end open
It has to convert the soundtrack from AC3 to AAC, because AC3 audio isn't allowed in an MP4 file, per the spec (QT complains and refuses to open the file if you do a -acodec copy instead of the conversion that's happening in this code).

Usage: Save as an Application Bundle, drop a binary of ffmpeg into the bundle's Contents/Resources folder, and drag your .MTS file onto the app's icon. A .mp4 icon will appear on your Desktop, but it's not done converting it until you see a dialog box reading saying "All done!" so don't try to open it until then. The file's name will be suffixed with the time of day the script was run, in case the script is run multiple times without renaming the output file.
( Last edited by Oneota; Oct 1, 2010 at 05:41 PM. )
"Yields a falsehood when preceded by its quotation" yields a falsehood when preceded by its quotation.
     
Xu Wei
Banned
Join Date: Nov 2012
Status: Offline
Reply With Quote
Nov 29, 2012, 09:18 PM
 
Hello, this problem is not very difficult to solve a lot of software now can be converted, but can guarantee quality conversion software I've been using the Piece of Crap Converter for MAC the effect is very good, high quality,you can try, and hope to be able to help you. You can google browser inside search keywords:Piece of Crap Converter for MAC to find this software.
     
Xu Wei
Banned
Join Date: Nov 2012
Status: Offline
Reply With Quote
Nov 29, 2012, 09:19 PM
 
very good!~
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 07:41 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,