How I fixed my Mplayer audio/video sync problem

How to do things, solutions, recipes, tutorials
Message
Author
User avatar
666philb
Posts: 3615
Joined: Sun 07 Feb 2010, 12:27
Location: wales ... by the sea

How I fixed my Mplayer audio/video sync problem

#1 Post by 666philb »

i've been unable to use mplayer as my main video player in puppy, due to audio and video going out of sync. i found the problem is more pronounced on higher bitrate files, but can manifest itself even on lower bitrate stuff. And so i've always installed and used vlc as my main player as it works.

after a google session i think i've found a fix. :)

add

Code: Select all

mc=0
to the bottom of your hidden /root/.mplayer/config file.

let me know if it works for you
Bionicpup64 built with bionic beaver packages http://murga-linux.com/puppy/viewtopic.php?t=114311
Xenialpup64, built with xenial xerus packages http://murga-linux.com/puppy/viewtopic.php?t=107331

User avatar
Coffe
Posts: 6
Joined: Thu 20 Dec 2012, 21:23

#2 Post by Coffe »

Hi 666philb,

Desktop : Packard Bell, PIII, 1Ghz, 512 RAM, cache size 256 KB, NVIDIA GeForce2 MX / 32 Mbytes SDRAM.
Puppy : Wary 5.1.4

Thanks for the fix but it didn't work for me. By the way, my config file is empty, so I added mc=0 on the top.It seems that my problem is elswere since the video slightly stucks from time to time, so that the audio stream is always ahead.

postfs1

#3 Post by postfs1 »

http://www.mplayerhq.hu/DOCS/HTML/en/MP ... dp11175184
Information about the Internet page: Copyright © 2000-2010 MPlayer team

http://www.mplayerhq.hu/DOCS/HTML/en/MP ... dp11146064
Information about the Internet page: Copyright © 2000-2010 MPlayer team

http://www.mplayerhq.hu/DOCS/HTML/en/MP ... dp11192256
Information about the Internet page: Copyright © 2000-2010 MPlayer team

http://www.mplayerhq.hu/DOCS/HTML/en/MP ... #streaming
Information about the Internet page: Copyright © 2000-2010 MPlayer team

http://www.mplayerhq.hu/DOCS/HTML/en/MP ... dp11124736
Information about the Internet page: Copyright © 2000-2010 MPlayer team

http://www.mplayerhq.hu/DOCS/HTML/en/MP ... dp11162352
Information about the Internet page: Copyright © 2000-2010 MPlayer team

http://www.mplayerhq.hu/DOCS/HTML/en/MP ... dp11164720
Information about the Internet page: Copyright © 2000-2010 MPlayer team

Also if there is a need to find technical information about a video file --TOOL-->
http://www.murga-linux.com/puppy/viewto ... 243#587243
Last edited by postfs1 on Tue 25 Dec 2012, 21:08, edited 3 times in total.

User avatar
scabz
Posts: 364
Joined: Thu 30 Apr 2009, 18:14
Location: Tallahassee FL US
Contact:

#4 Post by scabz »

For me i get better playback if you just dont use the gui.
On my fast computer with nvidia vid card i use this script.

Code: Select all

#!/bin/sh
exec mplayer -vo vdpau -vc ffmpeg12vdpau,ffwmv3vdpau,ffvc1vdpau,ffh264vdpau,ffodivxvdpau, -ao alsa -cache 8192 "$@"
you could just drag and drop video files onto the script and it plays without the gui. you get better performance that way. Script above only works on nvidia vid cards with vdpau.

for most other video cards i would use -vo gl first, if doesnt work right then i would try -vo xv and last resort would be -vo x11.
Script would look like this.

Code: Select all

#!/bin/sh
exec mplayer -vo gl -ao alsa -cache 8192 "$@"
of course it all depends on your vid card on what options work best for you.

if you dont want to make a script or you just want to try it out just test in terminal

Code: Select all

mplayer -vo gl -ao alsa -cache 8192 /location/of/file/no/spaces/or/video/will/fail.avi
for key comands or option and stuff run mplayer --help in terminal.
you will have to mess with the options for better playback for you pc but i have been able to watch 720p hd content on my old netbook and on my moms even older P3.

User avatar
Coffe
Posts: 6
Joined: Thu 20 Dec 2012, 21:23

#5 Post by Coffe »

Hi postfs1 and scabz,
thanks for your help :) , I'll try all those fixes.

keniv
Posts: 583
Joined: Tue 06 Oct 2009, 21:00
Location: Scotland

#6 Post by keniv »

Hi Scabz

I have an old Toshiba plll 800MHz 320MB. My son-in-law sends me video of my grandchildren sent from an iPhone4. They show up as mp4 but I am not sure of the resolution. They have always run on mplayer with the video running slowly and behind the sound which runs at the correct speed. However, have just tried your code. It makes a big difference with the video just behind the sound though hardly noticeable. I am using lupu 528 with the appropriate video driver. I used your code to make a little script and made it executable with a desktop icon. Now all I do is drag the video file onto the desktop icon and it plays. I am no expert on this and there might be a better way but here's what I used.

Code: Select all

#!/bin/sh 
 /usr/bin/roxterm -e mplayer -vo xv -ao alsa -cache 8192 "$@"
Is there anything you can suggest that I could experiment with that would speed up the video a little bit more?

Regards,

Ken.

User avatar
scabz
Posts: 364
Joined: Thu 30 Apr 2009, 18:14
Location: Tallahassee FL US
Contact:

#7 Post by scabz »

maybe add framedrop, code would look like this.

Code: Select all

#!/bin/sh 
 /usr/bin/roxterm -e mplayer -vo xv -ao alsa -framedrop -cache 8192 "$@"
or you could try hardframedrop

Code: Select all

#!/bin/sh 
 /usr/bin/roxterm -e mplayer -vo xv -ao alsa -hardframedrop -nocorrect-pts -cache 8192 "$@"
What is you vid card there might be options for you card?

keniv
Posts: 583
Joined: Tue 06 Oct 2009, 21:00
Location: Scotland

#8 Post by keniv »

Bellow is what PupSysInfo reports on video.

Chip description:
0.0 VGA compatible controller
S3 Inc. 86C270-294 Savage/IX-MV (rev 11)
oem: S3 Incorporated. M7 BIOS

X Server: Xorg
Driver used: savage

X.Org version: 1.7.6
dimensions: 1024x768 pixels (271x203 millimeters)
depth of root window: 16 planes

The driver that was recommended for this was the xorg_high-1.1-lucid which is what I have installed. I hope this is the info your looking for. I tried both your suggestions. The first seemed to bring up the first frame of the video but did not play the rest. Sound was OK. The second played both sound and video in better sync although video might have been a little jerkier but still useable.

Regards,

Ken.

User avatar
scabz
Posts: 364
Joined: Thu 30 Apr 2009, 18:14
Location: Tallahassee FL US
Contact:

#9 Post by scabz »

Sorry man i cant help more, there might me someone else that can help you more but i am not a expert.

keniv
Posts: 583
Joined: Tue 06 Oct 2009, 21:00
Location: Scotland

#10 Post by keniv »

OK the help you have already given me has improve things a lot.

Thanks again.

Ken.

User avatar
rjbrewer
Posts: 4405
Joined: Tue 22 Jan 2008, 21:41
Location: merriam, kansas

#11 Post by rjbrewer »

keniv;

I've often had Mplayer problems with Lucid 528.

I switched to Wary 5.3 and Mplayer works fine.

Inspiron 700m, Pent.M 1.6Ghz, 1Gb ram.
Msi Wind U100, N270 1.6>2.0Ghz, 1.5Gb ram.
Eeepc 8g 701, 900Mhz, 1Gb ram.
Full installs

User avatar
666philb
Posts: 3615
Joined: Sun 07 Feb 2010, 12:27
Location: wales ... by the sea

#12 Post by 666philb »

for info purposes, here's an example of my /root/.mplayer/config

Code: Select all

[default]

[gnome-mplayer]
vo=vdpau
msglevel=all=5
mc=0
Bionicpup64 built with bionic beaver packages http://murga-linux.com/puppy/viewtopic.php?t=114311
Xenialpup64, built with xenial xerus packages http://murga-linux.com/puppy/viewtopic.php?t=107331

keniv
Posts: 583
Joined: Tue 06 Oct 2009, 21:00
Location: Scotland

#13 Post by keniv »

Hi rjbrewer

I have lazy, lupu, slacko and precise all frugal and xp (rarly used) booting with grub. I have had similar problems with pups and mplayer playing this form of video. I also use vlc but it performs less well with this. I had just assumed it was due to the limits of my hardware. I have not tried wary but will give it a go.

Regards,

Ken.

postfs1

#14 Post by postfs1 »

keniv wrote:...

Chip description:
0.0 VGA compatible controller
S3 Inc. 86C270-294 Savage/IX-MV (rev 11)
oem: S3 Incorporated. M7 BIOS

X Server: Xorg
Driver used: savage

...
http://web.njit.edu/all_topics/Prog_Lan ... eo.html#xv
and lower on the page:
Title: 2.3.1.2.1.2 S3 cards

User avatar
charlie6
Posts: 1230
Joined: Mon 30 Jun 2008, 04:03
Location: Saint-Gérard / Walloon part of Belgium

audio/video out of sync playing a mp4 file

#15 Post by charlie6 »

Hi,
- playing a .mp4 music solfege lesson (downloaded from you tube using You2pup) resulted in a dramatic :( out of sync between images and «metronomic tap» sounds.
Here is what itried:
- converting that .mp4 file to .AVI (using ffmpeg) helped to recover the sync. Now just clicking on the AVI file and mplayer runs it OK. :D (This seems to me the most straightforward solution with minimal lost of time for maximum result).
last edited: But...it worked only on one tested file. Further downloaded mp4 files are still out of sync after avi conversion.
This did not helped either:
- applying forum member scabz's (thankx!) 1st post above + applying mplayers various audio/video bitrates manuals settings did not help.
Hope this helps
Charlie[/u]
Last edited by charlie6 on Fri 28 Dec 2012, 05:47, edited 1 time in total.

keniv
Posts: 583
Joined: Tue 06 Oct 2009, 21:00
Location: Scotland

#16 Post by keniv »

Hi postfs1

I've had a look at the link you were good enough to provided and found this.

"2.3.1.2.1.2 S3 cards

S3 Savage3D's should work fine, but for Savage4, use XFree86 version 4.0.3 or greater (in case of image problems, try 16bpp). As for S3 Virge.. there is xv support, but the card itself is very slow, so you better sell it."

The trouble is I don't know if my card is "3D" and don't know how to try 16bpp. Is this something that can be set up by editing an mplayer file?

Thanks for your help.

Ken.

keniv
Posts: 583
Joined: Tue 06 Oct 2009, 21:00
Location: Scotland

#17 Post by keniv »

Hi charlie6

Have just tried converting from .mp4 to .avi. However, I find the video is a bit pixelated and is still out of sync with the sound. Oh well it was worth a try.

Thanks,

Ken.

User avatar
charlie6
Posts: 1230
Joined: Mon 30 Jun 2008, 04:03
Location: Saint-Gérard / Walloon part of Belgium

#18 Post by charlie6 »

Hi keniv,
keniv wrote:Have just tried converting from .mp4 to .avi. However, I find the video is a bit pixelated and is still out of sync
:oops: you are right !
it only worked for one file :( ...not on further downloaded ones ...
thanks
charlie

User avatar
scabz
Posts: 364
Joined: Thu 30 Apr 2009, 18:14
Location: Tallahassee FL US
Contact:

#19 Post by scabz »

all the .mp4 or .m4v , .flv or .avi are just container files the the encoding inside can all be the same, so the type of file doesnt really matter much.

keniv
Posts: 583
Joined: Tue 06 Oct 2009, 21:00
Location: Scotland

#20 Post by keniv »

Hi All

The previous post is perhaps an explanation of another thing that made me wonder about these .mp4 files produced by the iPhone4 as I have earlier mp4 files which work OK on mplayer. I should have said that I also tried 666philb's idea in the first post but It did not seem to make any difference.

Regards,

Ken.

Post Reply