[MPlayer-users] -oac copy results in out of sync audio with mencoder ?

389 views
Skip to first unread message

a a

unread,
Feb 4, 2012, 7:13:12 AM2/4/12
to mplaye...@mplayerhq.hu
If I transcode
the video but copy the audio the audio ends up totally out of sync. Is
there an option i need to keep the audio in sync when transcoding the
video

mencoder in.mkv -af volume=6:0 -mc 0 -oac copy -ovc x264 -x264encopts
preset=slow:tune=film:crf=15:frameref=15:fast_pskip=0:threads=auto:bitrate=2000
-nosub -vf scale=1280:-10 -o out.mkv
_______________________________________________
MPlayer-users mailing list
MPlaye...@mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users

Linards Ticmanis

unread,
Feb 4, 2012, 9:37:22 AM2/4/12
to MPlayer usage questions, feature requests, bug reports
On 02/04/2012 01:13 PM, a a wrote:
> If I transcode
> the video but copy the audio the audio ends up totally out of sync. Is
> there an option i need to keep the audio in sync when transcoding the
> video
>
> mencoder in.mkv -af volume=6:0 -mc 0 -oac copy -ovc x264 -x264encopts
> preset=slow:tune=film:crf=15:frameref=15:fast_pskip=0:threads=auto:bitrate=2000
> -nosub -vf scale=1280:-10 -o out.mkv

To quote the manual: "-mc 0 should always be combined with -noskip for
mencoder, otherwise it will almost certainly cause A-V desync."

Also, -af doesn't make sense when you're copying the audio; have you
tried without?

--
Linards Ticmanis

a a

unread,
Feb 4, 2012, 10:43:52 AM2/4/12
to feature requests bug reportsMPlayer usage questions
Thanks for the suggestion. I will try -noskip tonight and report what happens.

I actually tired without -mc 0 the first time and it did not work then I saw a comment that suggested -mc 0 to fix the issue.

The actual command I used did not have -af but i failed to remove it from the pasted command. I've been working on a small script to transcode but I keep running into 1 off issues (here the transcoded sound is really bad so I want to do a direct copy of the audio track).
-
After your comment about the manual I re-checked the man page and I do not see the comment that indicates one should use -noskip with -mc 0; can you provide a pointer to the manual that I should be using.

Thanks!


--- On Sat, 2/4/12, Linards Ticmanis <ticm...@gmx.de> wrote:

Linards Ticmanis

unread,
Feb 4, 2012, 1:28:15 PM2/4/12
to MPlayer usage questions, feature requests, bug reports
On 02/04/2012 04:43 PM, a a wrote:

> After your comment about the manual I re-checked the man page and I do not see the comment that indicates one should use -noskip with -mc 0; can you provide a pointer to the manual that I should be using.

It's in the man page of the current SVN version. Maybe it's not yet
there in the official release version you're probably using.

a a

unread,
Feb 4, 2012, 4:10:02 PM2/4/12
to feature requests bug reportsMPlayer usage questions
noskip doesn't seem to help - i used this command line:


mencoder in.mkv -mc 0 -noskip -oac copy -ovc x264 -x264encopts preset=slow:tune=film:crf=15:frameref=15:fast_pskip=0:threads=auto:bitrate=2000 -nosub -vf scale=1280:-10 -of avi -o x.avi

Appreciate any other suggestions you might have.

--- On Sat, 2/4/12, Linards Ticmanis <ticm...@gmx.de> wrote:

From: Linards Ticmanis <ticm...@gmx.de>
Subject: Re: [MPlayer-users] -oac copy results in out of sync audio with mencoder ?
To: "MPlayer usage questions, feature requests, bug reports" <mplaye...@mplayerhq.hu>

Linards Ticmanis

unread,
Feb 4, 2012, 11:27:48 PM2/4/12
to MPlayer usage questions, feature requests, bug reports
On 02/04/2012 10:10 PM, a a wrote:
> noskip doesn't seem to help - i used this command line:
>
> mencoder in.mkv -mc 0 -noskip -oac copy -ovc x264 -x264encopts preset=slow:tune=film:crf=15:frameref=15:fast_pskip=0:threads=auto:bitrate=2000 -nosub -vf scale=1280:-10 -of avi -o x.avi
>
> Appreciate any other suggestions you might have.

Hmmm.... I don't really have any other "good" ideas. As for a
"not-so-good" idea, try encircling the problem - remove all options that
aren't 100% essential for what you're trying to do, then add them one by
one to see which causes the problem. Play around with the other stuff -
for example, what happens when you encode to to divx instead of x264, is
the problem still there. What happens when you do -ovc copy. What
happens when the input file is avi or mpeg instead of mkv. Try filters
that deal with FPS stuff - for example the harddup filter is sometimes
helpful. You get the idea, you just have to be an experimenting
scientist so to speak. Go on from there.

Ron Johnson

unread,
Feb 4, 2012, 11:59:56 PM2/4/12
to MPlayer usage questions, feature requests, bug reports
On 02/04/2012 03:10 PM, a a wrote:
> noskip doesn't seem to help - i used this command line:
>
>
> mencoder in.mkv -mc 0 -noskip -oac copy -ovc x264 -x264encopts preset=slow:tune=film:crf=15:frameref=15:fast_pskip=0:threads=auto:bitrate=2000 -nosub -vf scale=1280:-10 -of avi -o x.avi
>
> Appreciate any other suggestions you might have.
>

When converting MJPEG .mov files to DVD-compatible MPEG2 files, I was
faced with a similar problem. The solution was a 2-step conversion:


VCODEC="vcodec=mpeg2video:aspect=4/3:vbitrate=6000:trell:nr=100"
mencoder \
*.mov \
-o ${FOO}.avi \
-ovc lavc -lavcopts $VCODEC \
-oac pcm -channels 1 -srate 8000

ffmpeg -i ${FOO}.avi -target ntsc-dvd ${FOO}-0.0.mpeg

This example is tuned to my specific circumstance, but should be
adjustable to yours.

--
How does being physically handicapped make me Differently-Abled?
What different abilities do I have?

a a

unread,
Feb 5, 2012, 7:05:09 AM2/5/12
to feature requests bug reportsMPlayer usage questions
I'm not sure if I understand what hte second pass is doing here;but if I use pcm or anything but copy for oac then the audio is in sync. Its only when I try to copy the audio that it ends up out of sync.

I can't get mencoder to just copy the video; but I was thinking I could use mkvextra and merge to insert the original audio track.

Still I don't understand why the copy ends up with the audio out of sync :(


--- On Sat, 2/4/12, Ron Johnson <ron.l....@cox.net> wrote:

From: Ron Johnson <ron.l....@cox.net>
Subject: Re: [MPlayer-users] -oac copy results in out of sync audio with mencoder ?
To: "MPlayer usage questions, feature requests, bug reports" <mplaye...@mplayerhq.hu>

a a

unread,
Feb 5, 2012, 7:50:41 AM2/5/12
to feature requests bug reportsMPlayer usage questions
It seems that running mkvmerge as a second pass fixes the issue

mkvmerge -o x.mkv  in.avi
-
no clue why but sounds like an issue with the keyframes ? The new file is marginally smaller (about 1%).

--- On Sun, 2/5/12, a a <you2...@yahoo.com> wrote:

mx2927

unread,
Mar 24, 2012, 10:39:48 AM3/24/12
to mplaye...@mplayerhq.hu
Have you tried -mc 0 -vf harddup (no -noskip) in mencoder ?
Reply all
Reply to author
Forward
0 new messages