How I fixed my Mplayer audio/video sync problem

How to do things, solutions, recipes, tutorials
Message
Author
postfs1

#21 Post by postfs1 »

keniv wrote:...
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?
...
Operating System:
QUIRKY LINUX 1.40
Video Card:
S3 Virge
Variant of booting:
from CD-ROM
Options of booting:
puppy pfix=nox,ram
Command for receiving the information about video card:
lspci|grep VGA
Command for preparing the launch of X Window System:
xorgwizard
Steps in XORGWIZARD:
[ Xorg ] ---> [ Probe ] ---> [ 1024x768x16 ] ---> [ OK ]

:arrow:

If X Window System has been activated:

Steps in JWM:
[ Menu ] ---> [ Multimedia ] ---> [ MPlayer media player ]

:arrow:

If MPlayer has been activated:

Steps in MPlayer:
(when mouse's arrow is above the player's box, then one click by right button will give the menu)

[ Menu ] ---> [ Preferences ] --->
Audio = alsa
Video = x11 / xshm

:arrow:

I tested one publicly accessible .MP4 file and MPLayer was good at this experiment.
Information(about video file), which was taken from SMPlayer box:

Video:
Resolution=640 x 480
Aspect ratio=1.33333
Format=H264
Bitrate=512 kbps
Frames per second=29.970

Audio:
Format=MP4A
Bitrate=149 kbps
Rate=44100 Hz
Channels=2

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

#22 Post by keniv »

Hi postfs1

I made the changes you suggested i.e.

Audio from default to alsa.

Video from xv to x11.

Unfortunately video and audio still out of sync. However, I think if I click on an mp4 file I am using gmplayer rather than mplayer which I am using when running from a terminal. I'm not sure how much difference using the gui makes but I guess it slows things down a bit.

Thanks,

Ken.

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

#23 Post by charlie6 »

Hi,
here running under Xorg X11 without extra video/audio card (just the intel on board devices);
the following mplayers command line code runs a/c sync nice on .avi files(*):
#!/bin/sh
exec mplayer -vo x11 -framedrop -autosync 30 -nocache "$@"
(*)files converted from .mp4 to .avi using ffmpeg converter.
notes:
- the above code does not solve the a/v sync on .mp4 files.

- i believe the -framedrop option to be unnecessary.

best regards, charlie

postfs1

#24 Post by postfs1 »

http://tattatthrow.blogspot.ru/2009/09/ ... layer.html
---Internet page as source--->

Operating System:
QUIRKY LINUX 1.40
Video Card:
S3 Virge
Variant of booting:
from CD-ROM

If SDL available:

Code: Select all

mplayer -quiet -vo sdl -ao sdl:alsa -vfm ffmpeg -lavdopts lowres=0:fast:skiploopfilter=all /folder/Video.mp4
http://web.njit.edu/all_topics/Prog_Lan ... o.html#sdl

If XV available:

Code: Select all

mplayer -quiet -vo xv -ao alsa -vfm ffmpeg -lavdopts lowres=0:fast:skiploopfilter=all /folder/Video.mp4

If XV is not available:

Code: Select all

mplayer -quiet -vo x11 -ao alsa -vfm ffmpeg -lavdopts lowres=0:fast:skiploopfilter=all /folder/Video.mp4
************************************************
**** Your system is too SLOW to play this! ****
************************************************

Possible reasons, problems, workarounds:
- Most common: broken/buggy _audio_ driver
- Try -ao sdl or use the OSS emulation of ALSA.
- Experiment with different values for -autosync, 30 is a good start.
- Slow video output
- Try a different -vo driver (-vo help for a list) or try -framedrop!
- Slow CPU
- Don't try to play a big DVD/DivX on a slow CPU! Try some of the lavdopts,
e.g. -vfm ffmpeg -lavdopts lowres=1:fast:skiploopfilter=all.
- Broken file
- Try various combinations of -nobps -ni -forceidx -mc 0.
- Slow media (NFS/SMB mounts, DVD, VCD etc)
- Try -cache 8192.
- Are you using -cache to play a non-interleaved AVI file?
- Try -nocache.
Read DOCS/HTML/en/video.html for tuning/speedup tips.
If none of this helps you, read DOCS/HTML/en/bugreports.html.



Exiting... (End of file)

Code: Select all

mplayer -quiet -vo x11 -ao alsa -vfm ffmpeg -lavdopts lowres=0:fast:skiploopfilter=all -cache 8192 /folder/Video.mp4
ImageImageImage

If MAN PAGE for MPLAYER is available:
man mplayer|grep --before-context=68 --after-context=50 lowres
man mplayer|grep --before-context=2 --after-context=1 vfm

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

#25 Post by charlie6 »

Hi,
@postfs1 ==> thanks for your posts !
i also get this working playing a mp4 file with good audio/video sync:
#!/bin/sh
exec mplayer -quiet -vo x11 -ao alsa -vf crop=1024:500:100:140,scale=640:352,harddup "$@"

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

#26 Post by charlie6 »

Hi postfs1,
your previous post...

Code: Select all

mplayer -quiet -vo x11 -ao alsa -vfm ffmpeg -lavdopts lowres=0:fast:skiploopfilter=all -cache 8192 /folder/Video.mp4 
Running that code again returned a audio/video out of sync of about 1sec (video too slow), together with a full screen display. As the dispay is full scren, I believe the video cpu needs to be too high.
Running here a PC with lean video/audio resources, without extra sound/video card, I tried to reduce the display size in order to reduce the video CPU needs.
I then found the code given in my above post: the display is not full size nor complete screen, but enough for the current needs).
Cheers,
Charlie

strzygaa
Posts: 1
Joined: Wed 26 Mar 2014, 22:23

#27 Post by strzygaa »

thanks, it's helped me alot!!

Post Reply