LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 01-31-2009, 05:22 PM   #1
MikeP
LQ Newbie
 
Registered: Oct 2002
Location: In the upper middle, North Island of NZ
Distribution: MX Linux
Posts: 26

Rep: Reputation: 18
need help with converting HiDef (sony) .mts video using mencoder - audio losing time


I have been trying to decode Sony Hi Definition AVCHD Video as taken by their hard disk camcorder.

Mencoder is doing a very good job at converting the video but the audio is lagging behind ~1 second for every 10 seconds of video, so each minute, the audio goes ~6 seconds out of sync and its accumulative, so a 7 minute long video segment is out by around 40-45 seconds as the video nears the end.

The code below is what I am using to convert the 1920x1080 AVCHD .mts files to 1280x720 avi using a 2 pass encode.

Code:
mencoder 00466.mts -o 00466.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=8000:vpass=1:turbo -fps 60 -vf scale=1280:720
mencoder 00466.mts -o 00466.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=8000:vpass=2 -fps 60 -vf scale=1280:720
Does anybody know of a method to get the audio synced correctly?

I have tried with ffmpeg, but all I can get is the following
Code:
michael@mikepav:~/Movies/Temp$ ffmpeg -i 00466.mts
ffmpeg: symbol lookup error: ffmpeg: undefined symbol: ffm_nopts
Thanks in advance

Mike P
 
Old 12-05-2009, 12:05 AM   #2
wesleybailey
LQ Newbie
 
Registered: Dec 2009
Posts: 2

Rep: Reputation: 1
Hi MikeP,
What Linux OS are you running? It seems the ffmpeg package on your system needs to be removed. Then install the latest version of ffmpeg.

I have successfully converted AVCHD videos using ffmpeg.

I wrote about my experience installing ffmpeg, and converting AVCHD videos here How to Install FFmpeg and Transcode AVCHD

Basically you download the lastest ffmpeg
Code:
svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
Then .configure ffmpeg
Code:
cd ffmpeg
./configure --enable-gpl --enable-libmp3lame --enable-libxvid --enable-libfaac --enable-nonfree
make
sudo make install
And finally transcode your video.
Code:
ffmpeg -i input.mts -vcodec libxvid -b 18000k -acodec libmp3lame -ac 2
-ab 320k -deinterlace -s 1440x1080 output.avi
If you experience issues with the audio syncing up, you can use the
-async 1 ffmpeg switch to correct this
Code:
ffmpeg -i input.mts -vcodec libxvid -b 18000k -acodec libmp3lame -ac 2 -ab 320k -async 1 -deinterlace -s 1440x1080 output.avi

Last edited by wesleybailey; 12-05-2009 at 12:07 AM.
 
Old 12-05-2009, 04:55 AM   #3
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Indeed, I agree with wesleybailey, however I recommend you use '-async 48000' (or use the frequency of the audio), because if you use '-async 1' it does:

Code:
-async samples_per_second
    Audio sync method. "Stretches/squeezes" the audio stream to match the timestamps, the parameter is the maximum samples per second by which the audio is changed. -async 1 is a special case where only the start of the audio stream is corrected without any later correction.
That usually works ok too, but not if the distortion still happens while encoding.
 
Old 12-05-2009, 01:16 PM   #4
MikeP
LQ Newbie
 
Registered: Oct 2002
Location: In the upper middle, North Island of NZ
Distribution: MX Linux
Posts: 26

Original Poster
Rep: Reputation: 18
Fixed a long time back, now using Winff, much easier

Thanks guys.

This thread is very old, with me having started it on the 2nd January 2009. I had already found what I needed and no longer have access to the Sony handycam that produced the video. Nevertheless, I found the fix on my own within a few days of my original post on the MepisLovers forums. The people there are awesome and thee is not a lot there that gets missed.

The handycam was configured for PAL, which is not surprising, since everything here is PAL, not NTSC, so it comes as no surprise that my issue stemmed from my following the only prescriptions I could find, which were for NTSC based systems, so all I had to change was the FPS. The 60 fps was sampling too fast, I simply changed the fps to 50 had it all corrected and properly synced in no time at all.

I now use a much simpler method than playing around at the CLI level. I use
Winff 1.0.4 as the front end and a combination of ffmpeg 5:0.5+svn20090521 and mencoder 2:10.rc3svn20091002 as the backends.http://winff.org/html_new/

@wesleybailey, you might be interested in adding winff to your website

Mike P
 
Old 06-21-2010, 03:12 AM   #5
oudinmelanie09
LQ Newbie
 
Registered: Jun 2010
Posts: 2

Rep: Reputation: 0
Thumbs up

there are many software which can help you to convert .mts video file to other video formats directly.
what i use is Aunsoft MTS converter which helps you to convert mts file to almost any other video format with the least loss of video quality.
and its conversion is quite fast.
you can google it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting 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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Making a video with 1 jpeg plus audio with mencoder slothpuck Linux - Software 1 08-01-2013 11:57 AM
problem on converting photos of different aspect ratio into a video with mencoder jackandking Linux - Software 1 04-27-2007 12:10 AM
Recording Video and Audio using mencoder OR13 Linux - Desktop 3 01-19-2007 04:19 PM
mpg321 is losing time; alternate audio console app andrewstr Linux - Software 0 12-29-2006 06:22 PM
mencoder/mplayer and splitting both audio and video streams from source... bai_design Linux - Software 0 02-06-2005 04:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 12:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration