How shall I convert AVCHD to mp4 by ffmpeg?

Asked by reindeer

I am forced to convert my AVCHD videos for editing.

(My Panasonic camera generates AVCHD videos in three HD (1920x1080) compression levels. They call it HA1920, HG1920 and HX1920. In addition, there is a mode HE1440.
My computer seems to be at its limits even when playing AVCHD with VLC in the highest two modes HA1920, HG1920. The two lower modes are played without stuttering.

In Openshot, I additionally suffer from the general AVCHD issue that large frames are needed. So when scrubbing throught the timeline of an MTS file, some pictures contain gray squares or are only displayed as silhouettes.)

But what is the best file format and codec to edit in OpenShot? Mov or AVI? HuffYuv, MPEG4,...?
My personal limitations are: To be able to afford saing approx. 50 hours of uncut video material, one minute of video storage shouldn't take more than 1,5 GB.
In addition, with my Athlon64 DualCore 3.8 GHz, converting one hour of video should not take more than one hour converting time.

Currently , I am recording videos like this:
Input #0, mpegts, from '00000.MTS':
  Duration: 00:00:52.83, start: 0.801400, bitrate: 8321 kb/s
  Program 1
    Stream #0.0[0x1011]: Video: h264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 50 tbr, 90k tbn, 50 tbc
    Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, 5.1, s16, 384 kb/s

What would be the best ffmpeg command line to get the best quality time storage compromise?

Question information

Language:
English Edit question
Status:
Answered
For:
OpenShot Video Editor Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jonathan Thomas (jonoomph) said :
#1

MP4 files work especially good for me. Here is an ffmpeg command to convert a folder full of MTS files into MP4 files (which should work fine in OpenShot):

$ find '/home/jonathan/Desktop/Caveman Movie/Videos' -iname "*.MTS" -exec ffmpeg -i {} -acodec libfaac -ab 128k -ac 2 -r 60 -vcodec mpeg4 -f mp4 -y -sameq {}.mp4 \;

If libfaac is not available, you might have to try another audio codec, such as 'ac3'. Good luck!
-Jonathan

Revision history for this message
Olivier Girard (eolinwen) said :
#2

You should use a tool like EKD : http://ekd.tuxfamily.org/ which convert in one click a plenty of files whitout hard parameters. And he manages too the AVCHD, in fact it is a knife swiss. The website is in french but he is available in english with googletranslate. (for the installation's instruction). You should use DV it is a good format for working video with after without loose quality . A lof of documentation is available too.

Revision history for this message
Deactivated Account (narren96c-deactivatedaccount) said :
#3

$ find '/home/jonathan/Desktop/Caveman Movie/Videos' -iname "*.MTS" -exec ffmpeg -i {} -acodec libfaac -ab 128k -ac 2 -r 60 -vcodec mpeg4 -f mp4 -y -sameq {}.mp4 \;

Why not use "-acodec copy" switch in this workflow? Is there a point to reencode audio stream?

Revision history for this message
Olivier Girard (eolinwen) said :
#4

Try a tool like EKD who use FFmpeg and Mencoder. More explanations here : http://openshotusers.com/forum/viewtopic.php?f=13&t=267
I'm thinking that your configuration is a little light for working with AVCHD Format. Be careful, playing a AVCHD file and working with a AVCHD file is different. The best solution is to encode in another format and EKD is a tool who help you in your better choice.

Can you help with this problem?

Provide an answer of your own, or ask reindeer for more information if necessary.

To post a message you must log in.