OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Mplayer Audio Sync
Rodre
post Jan 8 2007, 09:39 AM
Post #1





Group: Members
Posts: 12
Joined: 4-January 07
Member No.: 13,693



Hello,

I have a C760 running Cacko 1.23. I have encoded a DVD using mencoder and various other retail dvd encoders from pinnacle, Intervideo, and 123 Copy DVD. My problem is that when I play the ripped/encoded dvd file on my desktop the audio and video are synced perfectly, but when I play the video on my Z in mplayer the audio is 2-3 seconds faster than the video. What gives? How are others playing video on their Z? I have also encoded a .mpg file shot with my handycam and it does the same thing.

It appears that mplayer has the ability to resync the audio using either the + and - keys or by using a '-delay' switch on startup, but it appears that the mplayer for the Z either doesn't support this or doesn't have the input key mapping file. Does anyone know about this file?

~Rodre
Go to the top of the page
 
+Quote Post
Serge
post Jan 8 2007, 03:05 PM
Post #2





Group: Members
Posts: 51
Joined: 8-October 06
Member No.: 11,724



AFAIK mplayer has troubles with variable bitrate mp3 audio in libmad decoder. See more details and a link in the first post from this thread: http://www.oesf.org/forums/index.php?showt...ndpost&p=148188

You can try encoding constant bitrate audio or use '-ac ffmp3' decoder. Please report if that information helped to resolve your issue.
Go to the top of the page
 
+Quote Post
Rodre
post Jan 8 2007, 05:12 PM
Post #3





Group: Members
Posts: 12
Joined: 4-January 07
Member No.: 13,693



Hi Serge, thanks for your response.

I tried the '-ac ffmp3' flag in kino2's "preferences" (File -> Preferences... -> Options for mplayer) and that didn't work. I am a newbie when it comes to encoding video. Can you tell me what mencoder flags I can use to encode the audio stream with a constant bitrate? I am looking to get the best quality sound and video as file size doesn't matter to me because I have a 4GB SD card.

Also, is there any way to get mplayer to accept the - and + keys so that I could adjust the lag on the fly? The "o" for on screen display works, but not many of the other ones. Thanks.

~Rodre
Go to the top of the page
 
+Quote Post
Serge
post Jan 8 2007, 10:38 PM
Post #4





Group: Members
Posts: 51
Joined: 8-October 06
Member No.: 11,724



QUOTE(Rodre @ Jan 8 2007, 05:12 PM)
I tried the '-ac ffmp3' flag in kino2's "preferences" (File -> Preferences... -> Options for mplayer) and that didn't work.

Did it refuse to run with this option? Or you still have this audio sync problem? Also please report what version of mplayer are you using.

QUOTE
I am a newbie when it comes to encoding video. Can you tell me what mencoder flags I can use to encode the audio stream with a constant bitrate? I am looking to get the best quality sound and video as file size doesn't matter to me because I have a 4GB SD card.

man mencoder, search for 'lameopts' there.
Go to the top of the page
 
+Quote Post
Rodre
post Jan 9 2007, 12:00 AM
Post #5





Group: Members
Posts: 12
Joined: 4-January 07
Member No.: 13,693



Hi Serge,

It ran but the audio was still faster than the video. mplayer version is:

MPlayer 1.0pre7-3.4.2 for Zaurus 1.1.5

I will check the lameopts for constant bit rate and re-encode and see what happens.

~Rod
Go to the top of the page
 
+Quote Post
Serge
post Jan 10 2007, 02:13 PM
Post #6





Group: Members
Posts: 51
Joined: 8-October 06
Member No.: 11,724



Well, don't know then, ffmp3 decoder should have correct audio/video sync. This problem could be also audio driver related, but as I don't have zaurus myself, I can't help much here. Anyway, did you try playing this movie using mplayer on desktop pc just to check if this problem is really zaurus specific (and not a result of bad encoding)?
Go to the top of the page
 
+Quote Post
Rodre
post Jan 10 2007, 07:43 PM
Post #7





Group: Members
Posts: 12
Joined: 4-January 07
Member No.: 13,693



Hi Serge,

Yes the file plays fine on my deskyop using mplayer. I am pretty sure that you are on the right track because I re-encoded the file using windows media encoder 9 (blah) and the audio/video rates were synced, but I lost a lot of the video quality. Is there a way I can have my mplayer on zaurus tell me what -ac audio decoders it supports?

~Rodre
Go to the top of the page
 
+Quote Post
Serge
post Jan 10 2007, 11:14 PM
Post #8





Group: Members
Posts: 51
Joined: 8-October 06
Member No.: 11,724



Well, now I think everything can have quite a simple explanation smile.gif Your zaurus is just not fast enough to process video and audio in real time. So it is able to process audio, but can't also decode video in time so it lags behind. Did you get error messages from mplayer about your system being too slow to play this video? Adding -framedrop option can help to fix this problem at the cost of dropping some frames, but only if mplayer is still able to decode video in time (without displaying and scaling it).

You can do some benchmarking to get more information about how much cpu is used for decoding video, showing it to screen and audio (see -benchmark option in mplayer man).
Go to the top of the page
 
+Quote Post
Rodre
post Jan 10 2007, 11:47 PM
Post #9





Group: Members
Posts: 12
Joined: 4-January 07
Member No.: 13,693



I Encoded it using these instructions:

http://www.oesf.org/index.php?title=Mencoder_Encoding

Specifically:

mencoder dvd://1 -srate 24000 -vop scale=320:240 -o office_space.avi -oac mp3lame -lameopts preset=15:mode=3 -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=150 -ofps 15 -sws 2

and it does the same thing.

I still have to try and re-encode using CBR. I guess I'll see what happens then.

Thanks for your advice, it still really helped me.

~Rodre
Go to the top of the page
 
+Quote Post
bubox
post Jan 23 2007, 11:14 PM
Post #10





Group: Members
Posts: 25
Joined: 25-December 06
From: japan
Member No.: 13,405



QUOTE(Rodre @ Jan 10 2007, 11:47 PM)
I Encoded it using these instructions:

http://www.oesf.org/index.php?title=Mencoder_Encoding

Specifically:

mencoder dvd://1 -srate 24000 -vop scale=320:240 -o office_space.avi -oac mp3lame -lameopts preset=15:mode=3 -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=150 -ofps 15 -sws 2

and it does the same thing.

I still have to try and re-encode using CBR. I guess I'll see what happens then.

Thanks for your advice, it still really helped me.

~Rodre
*


Rodre,

any luck? I've got the exact same issue: audio faster than video (out of sync) issues with my c700.

I've been trying a bunch of different encoding options in ffmpeg and mencoder and haven't quite go t it yet. please let me know if you find the magical encoder combination.

I'll post if I stumble on the answer.

bubox
Go to the top of the page
 
+Quote Post
bubox
post Jan 25 2007, 05:26 AM
Post #11





Group: Members
Posts: 25
Joined: 25-December 06
From: japan
Member No.: 13,405



Rodre,

I've got video playing on my c700 with audio and vid in sync. Thanks to Serge for his last post about the cpu not being fast enough. My previous attempt involved finding the perfect codec, but what I really needed to do was crunch the vid down a little more.

Once I cut the fps down to 15 things got better sync-wise. It's still faily viewable. The -b parameter is bitrate, so first try that at 300 or 400 and see if it will work, then work your way down.

Here's what working for my c700:
CODE
ffmpeg -i infile.avi -b 200 -s 320x240 -r 15 -vcodec mpeg4 out.avi



add this:
CODE
-ss 00:00:00 -t 00:00:30

to encode the first 30 seconds only as a test.

questions:
is mono audio less cpu intensive?
is two-pass encoding more cpu intensive?


I think I can eek out a bit more quality without pushing the cpu with some two-pass encoding. That's next.

regards,

bubox
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 24th November 2014 - 04:44 PM