Page 1 of 1

Converting MP4 to AVi with Avidemux

Posted: Sat Sep 01, 2012 6:48 pm
by bicky
I have converted x264-ftp.mp4 videos to Avi ( Xvid ) using avidemux, my problem is - sound is slightly out of sync - any suggestions as to the best Audio codec to resolve this problem, at the moment I am using mp3.

Re: Converting MP4 to AVi with Avidemux

Posted: Sun Sep 02, 2012 1:38 pm
by Flemur
I do mp4 -> avi quite a bit with avidemux, and sound sync is a problem with some files and not others.

My two solutions are kinda bogus:

1 - convert it, then make *another* convert with "copy video" and change the sound offset until it sounds right. It'll run fast without the video re-encode.
Edit: the time often seems to be shifted by 600ms or -600ms (others have found this value, too), tho sometimes around 3500ms...you might try the +/-600ms while converting.

2 - use ffmpeg (Edit: the 'winff' GUI to ffmpeg writes some stuff to the ffmpeg command line that ffmpeg can't understand...I just delete them so it looks like the below ffmpeg command).

If you're not used to ffmpeg, it can be a PITA until you get it set up.

FWIW, here's for 480x360 files that I crop to 480x328 (takes 16 pixels off the top and bottom) - you can prolly delete that part and use the rest to start from. If the file is different than 480x360, I *think* it scales, then crops. Also, my bit rates/quality are probably lower than you want... same for the sound.

Code: Select all

#
/usr/bin/ffmpeg -i  $1                         \
-f avi -vcodec libxvid -vtag XVID               \          # if it can't find 'libxvid', try 'libxvid' -> 'xvid' (ffmpeg versions...sigh).
-vf scale=480:360,crop=iw-0-0:ih-16-16:0:16     \   # throw this away, probably
-maxrate 450k -b 384k -qmin 7 -qmax 9           \   # change these quality settings, probably
-acodec libmp3lame -ab 64k -ac 2                \      # sound portion, probably change.
$1.avi
#
For an input file named hello.mp4, the output is hello.mp4.avi (sometimes the input is flv rather then mp4 -> hello.flv.avi). If ffpeg claims it's missing codecs (after libxvid -> xvid), install libavcodec-extra-53.

Converting MP4 to AVi with Avidemux (SOLVED )

Posted: Sun Sep 02, 2012 6:00 pm
by bicky
Simple solution - has worked perfectly for four conversions.
Install " ARISTA" Transcoder it's in the repositories - I did it via Synaptic.
Two clicks and the job is done.
Enter you file in Source, sort your Destination and Device preset I used" DivX. Home Theatre". Then Create Conversion.
Voila it works - perfect video and sound sync.

Re: Converting MP4 to AVi with Avidemux (SOLVED )

Posted: Fri Oct 12, 2018 9:04 pm
by Flemur
bicky wrote: Sun Sep 02, 2012 6:00 pmSimple solution - has worked perfectly for four conversions.
Install " ARISTA" Transcoder it's in the repositories - I did it via Synaptic.
Two clicks and the job is done.
Enter you file in Source, sort your Destination and Device preset I used" DivX. Home Theatre". Then Create Conversion.
Voila it works - perfect video and sound sync.
1 - "arista" not in the repos for Mint 18.3
2 - avidemux doesn't have any sync problems when you just convert, only when you edit - and this thread is from 2012 and the problem's been mostly or completely fixed since then.