OESF Portables Forum

Everything Else => General Support and Discussion => Zaurus General Forums => Archived Forums => Software => Topic started by: Joshp on April 10, 2004, 10:24:49 pm

Title: Mplayer sound out of sync.
Post by: Joshp on April 10, 2004, 10:24:49 pm
I just got mplayer working with my videos.  Used the script I found on zug.  But for some reson the sound becomes out of sync about 10 mins into the file.  Does any one know howto fix this.  I am useing a sl-5500 oz 335.  Thx in ADV.

JP
Title: Mplayer sound out of sync.
Post by: cmisip on April 11, 2004, 01:19:22 am
Look at the status line of mplayer. If you can run it via ssh, the status line should be visible on your terminal.  


Q: What is the meaning of the numbers on the status line?
        A: Example: A: 2.1 V: 2.2 A-V: -0.167 ct: 0.042 57/57 41% 0%
        2.6% 0 4 49%
              * A: audio position in seconds
              * V: video position in seconds
              * A-V: audio-video difference in seconds (delay)
              * ct: total A-V sync correction done
              * frames played (counting from last seek)
              * frames decoded (counting from last seek)
              * video codec cpu usage in percent (for slices and DR this
                includes video_out)
              * video_out cpu usage
              * audio codec cpu usage in percent
              * frames needed to drop to maintain A-V sync
              * current level of image postprocessing (when using
                -autoq)
              * current cache size used (around 50% is normal)


Look at the value of A-V:. It should be a very small number close to zero.
Look at frames needed to drop to maintain A-V Sync (third from right).  

My guess is that you are dropping  a lot of frames during playback and not enough to maintain A-V sync.  You might try to reduce the bitrate, or reduce the framerate on encode.
Title: Mplayer sound out of sync.
Post by: cmisip on April 11, 2004, 02:03:15 am
or did you run mplayer with the -framedrop option?
Title: Mplayer sound out of sync.
Post by: Joshp on April 11, 2004, 09:13:58 am
Ok just ran mplayer on my zaurus over ssh.  There is no status line.  I encoded this move with 15 fps and a bitrate of 150.  I got the script form this site http://cmisip.home.insightbb.com/zaurus.htm (http://cmisip.home.insightbb.com/zaurus.htm) .  And I did not run mplayer with the -framedrop option.  

JP
Title: Mplayer sound out of sync.
Post by: cmisip on April 11, 2004, 03:22:18 pm
Forget my first post, just run mplayer this way :

nice -n -5 mplayer -dr -lavdopts idct=7 -cache 2048 -framedrop -quiet videofile.ogm

Do it outside of qtopia.

If you still have problems, try running with -hardframedrop instead
Title: Mplayer sound out of sync.
Post by: Joshp on April 11, 2004, 04:49:06 pm
Did not work.  I have also found out that the sound does go out of sync when I play it on my laptop.

JP
Title: Mplayer sound out of sync.
Post by: cmisip on April 11, 2004, 05:39:15 pm
There is an audio video sync problem with conversion of movies to ogm.  That is why there is an audio delay parameter. This seems to vary but for my use 200 ms seems to work fine.    In the first version of the script, the audio delay parameter was incorreclty typed.  It was missing the $.   However this a-v sync problem should be constant throughout the playback of the file which is why it can be corrected with the -delay option in mplayer.    It would be nice if you can see the output of the status line of mplayer to see what is really happening.   When you tried with ssh, make sure to not run mplayer with the -quiet option.  See what happens with the status line in your laptop first.     Let me know what happens with A-V:
Title: Mplayer sound out of sync.
Post by: cmisip on April 11, 2004, 05:41:48 pm
By the way, if you can\'t see the status line even if you don\'t specify the -quiet in the command line, your config file may have it enabled.  Look for your config file in the usual locations ( ~/.mplayer  or wherever else mplayer looks for it.)
Title: Mplayer sound out of sync.
Post by: Joshp on April 11, 2004, 06:36:34 pm
Here is the status line form my SL-5500.
A: 337.7 V: 337.8 A-V: -0.054 ct:  0.129  5068/5068  51% 16% 12.7% 76 0 0%
And form my laptop.
A: 334.6 V: 334.6 A-V:  0.032 ct:  0.078  5021/5021   1%  0%  0.7% 2 0 0%

Here is my mplayer.conf file form my Z.
vo = fbdev
#quiet = yes
ao = oss
fb = /dev/fb0
framedrop = yes

And the one on my laptop is emptey.
One more thing after I commented out quiet=yes I can now get the status line.
JP
Title: Mplayer sound out of sync.
Post by: lbotez on April 11, 2004, 06:45:23 pm
Has anyone gotten VLC to work on the Z?  Last time I checked, they had code, but didn\'t have Zaurii to try it out.
Title: Mplayer sound out of sync.
Post by: cmisip on April 11, 2004, 07:07:35 pm
The value o A-V: is pretty close to zero which is good.  But this is just a snapshot of the entire movie.  Is this pretty much the case for the entire movie?  If that is the case, it should have pretty good A-V sync.    There are some dropped frames but that shouldn\'t be too bad.  If your A-V: is pretty close to zero all the time during playback, then the problem might be the audio stream is ahead or behind the video stream during encode.  If that is the case a -delay option should fix the problem.

Experiment with mplayer playback on the encoded video file first.  If the audio is ahead of the video, use a delay with a negative number.  For example, to delay the audio by 200 ms, use -delay -.2 (mplayer values are entered in seconds).   Once you have figured out this magic number, use that on your encode script.  Like I said, I use 200 ms and it works pretty well for me.  

Don\'t expect perfect sync all the time though as mplayer is always struggling to keep the A-V sync and some frames just are harder to decode than others.   The A-V: value will not always be close to zero but it should be pretty close.  If you fast forward or rewind, you will see the A-V: value jump up and then gradually go down to near zero.

If that still does not fix your problem, try experimenting with lower bitrates and  resolutions.  The zaurus 5500 I think has a 200 Mhz processor whereas the 5600 (which I have) has a 400 Mhz one.  You however have the benefit of more memory.

If you still have version 1.0 of the createogm script, fix the AV_DELAY variable in ogmmerge by adding the $ in front of it.
Title: Mplayer sound out of sync.
Post by: Joshp on April 11, 2004, 07:47:25 pm
I have already fixed the AV_DELAY.  And like I siad the moive plays fine for about 10 min or so than it becomes out of sync.  I will play around with the sound dely and see how that goes.  Thx for the help.

JP
Title: Mplayer sound out of sync.
Post by: Joshp on April 12, 2004, 11:58:38 am
Ok I have tryed the -delay and -autosync both have had no effect.  I should also note that the status lines I had posted was form where the sound goes out of sync.  I am going to try the v1.1 script and see how that goes.

JP
Title: Mplayer sound out of sync.
Post by: Joshp on April 12, 2004, 12:03:36 pm
In your script there is option that reads cbp.  When ever I run mplayer to encode with this I get \"Option lavcopts: Unknown suboption cbp\".  I also took a look at the other script v1.0 and remenbuerd that in oreder for me to run the script  I had to delete this suboption could that be the cause of my problume?

JP
Title: Mplayer sound out of sync.
Post by: Joshp on April 12, 2004, 09:48:00 pm
So far no luck I tryed recodeing with your new script and had the same problum.  I am wondering about that cdp suboption.  And also way the sound becomes out of sync about 10 min into the move and not right away.  Any more ideas?

JP
Title: Mplayer sound out of sync.
Post by: cmisip on April 12, 2004, 11:15:59 pm
Are you using the latest vesrion of mplayer on your laptop?
Title: Mplayer sound out of sync.
Post by: Joshp on April 13, 2004, 09:10:31 am
I am useing mplayer 1.0pre3try2-3.2.3
Title: Mplayer sound out of sync.
Post by: cmisip on April 13, 2004, 07:30:54 pm
are you using the latest version of mplayer/mencoder to encode?
Title: Mplayer sound out of sync.
Post by: Joshp on April 13, 2004, 07:57:39 pm
As far as I know I download mplayer and compiled it a few days ago.  I download it form mplayers main site.  What is cdp?

JP
Title: Mplayer sound out of sync.
Post by: cmisip on April 18, 2004, 11:35:57 pm
Sorry for the double post, I didn\'t realize this was two pages already.  

I am stumped as to what\'s causing your problem.  If you read my site, it explains where I got the cbp setting.  man mplayer would give you more information.

You might try not using ogg.  Instead encode the movies to divx with mp3 sound.   In this way, mencoder does not have to separate the audio from the video stream.  You might maintain better sync.   You are probably going to need the mad library to decode this on the zaurus as fpu emulation is very slow and impractical.