LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Audio completely out of sync with video playback. (FFmpeg/Xine/VLC) 12.2/2.6.27.7-smp (https://www.linuxquestions.org/questions/slackware-14/audio-completely-out-of-sync-with-video-playback-ffmpeg-xine-vlc-12-2-2-6-27-7-smp-702035/)

camphor 02-03-2009 04:29 PM

Audio completely out of sync with video playback. (FFmpeg/Xine/VLC) 12.2/2.6.27.7-smp
 
Hello everyone. Well, I've been in Slack-paradise up until this point!

Been having no end of trouble with getting video playback to work properly. Either the video falls behind or the avi, et. al gets ahead. I've googled extensively, but still can't seem to find the issue. Using ffmpeg with the necessary codecs and sound-output is through alsa. Every player I've tried it with (Xine, gXine, VLC, Codeine) has fallen flat on its face. Mplayer won't install for some reason, saying it has an unmet dependency, which is actually met (cdparanoia).

Nothing seems to be especially strange in vlc's terminal output:

Code:

VLC media player 0.9.8a Grishenko
[00000001] main libvlc debug: VLC media player - version 0.9.8a Grishenko - (c) 1996-2008 the VideoLAN team
[00000001] main libvlc debug: libvlc was configured with ./configure '--prefix=/usr' '--sysconfdir=/etc' '--localstatedir=/var' '--enable-hal' '--enable-dbus' '--enable-telepathy' '--enable-release' '--enable-optimize-memory=no' '--enable-shout' '--enable-libproxy=no' '--disable-audioscrobbler' '--disable-taglib' '--enable-live555' '--enable-dc1394=no' '--enable-dv' '--enable-dvdread' '--enable-dvdnav' '--enable-dvbpsi' '--enable-v4l' '--enable-v4l2' '--enable-pvr' '--enable-cddax' '--enable-vcdx' '--enable-faad' '--enable-real' '--enable-realrtsp' '--enable-flac' '--enable-theora' '--enable-svg' '--enable-snapshot' '--enable-svgalib' '--enable-ggi' '--enable-aa' '--enable-caca' '--enable-esd' '--enable-pulse' '--enable-portaudio' '--enable-arts' '--enable-jack' '--enable-cyberlink' '--enable-skins2' '--enable-qt4' '--enable-xosd' '--enable-galaktos' '--enable-goom' '--enable-twolame' '--enable-loader' '--enable-mozilla' '--with-live555-tree=/usr/lib/live' '--program-prefix=' '--program-suffix=' '--build=i486-slackware-linux' 'build_alias=i486-slackware-linux' 'CFLAGS=-O2' 'CXXFLAGS=-O2' 'PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig'
[00000001] main libvlc debug: translation test: code is "C"

But codeine shows there's a definite problem somewhere:

Code:

(after successfully finding all plugins)
init class succeeded
video_out_dxr3: Failed to open control device /dev/em8300-0 (No such file or directory)
video_out_xv: using Xv port 325 from adaptor NV17 Video Texture for hardware colour space conversion and scaling.
video_out_xv: sync to vblank = 1
video_out_xv: this adaptor supports the yuy2 format.
video_out_xv: this adaptor supports the yv12 format.
x11osd: unscaled overlay created (XShape mode).
video_out: thread created
audio_alsa_out : supported modes are 16bit stereo (4-channel not enabled in xine config) (4.1-channel not enabled in xine config) (5-channel not enabled in xine config) (5.1-channel not enabled in xine config) (a/52 and DTS pass-through not enabled in xine config)
audio_out: thread created
xine_stream_new
params.c:OpenConfFile() - Unable to open configuration file "/home/greg/.smb/smb.conf":
        No such file or directory
params.c:OpenConfFile() - Unable to open configuration file "/etc/samba/smb.conf":
        No such file or directory
Using netbios name WOLVES.
Using workgroup WORKGROUP.
xine: found input plugin  : file input plugin
load_plugins: probing demux 'anx'
load_plugins: probing demux 'image'
load_plugins: probing demux 'real'
load_plugins: probing demux 'avi'
failed to read 8 bytes at pos 406002092
demux_avi: 24733 frames
xine: found demuxer plugin: AVI/RIFF demux plugin
demux_avi: audio format[0] = 0x55
demux_avi: audio type MPEG layer 2/3 (wFormatTag 0x55)
video discontinuity #1, type is 0, disc_off 0
waiting for audio discontinuity #1
audio discontinuity #1, type is 0, disc_off 0
waiting for in_discontinuity update #1
vpts adjusted with prebuffer to 119205
demux_avi: video codec is 'DivX 5'
load_plugins: plugin ffmpegvideo will be used for video streamtype 1c.
load_plugins: plugin mad will be used for audio streamtype 01.
ffmpeg_video_dec: direct rendering enabled
video_out_xv: VO_PROP_ASPECT_RATIO(0)
xine_play
ao_flush (loop running: 1)
start pos is 25926890, start time is 0
video_pts = 4200000
video discontinuity #2, type is 3, disc_off 4200000
waiting for audio discontinuity #2
audio discontinuity #2, type is 3, disc_off 4200000
waiting for in_discontinuity update #2
vpts adjusted with prebuffer to 124178
video discontinuity #3, type is 3, disc_off 4198922
waiting for audio discontinuity #3
audio discontinuity #3, type is 3, disc_off 4198922
waiting for in_discontinuity update #3
vpts adjusted with prebuffer to 124190
audio_alsa_out:open pause_resume=1
output sample rate 44100
audio jump, diff=-2356
fixing sound card drift by -3463 pts
video jump
play_internal ...done
set_speed 0
video_out: throwing away image with pts 121296 because it's too old (diff : 6326).
set_speed 1000000
audio_alsa_out:open pause_resume=1
output sample rate 44100
audio_out: inserting 19750 0-frames to fill a gap of 40369 pts
video_out: throwing away image with pts 124296 because it's too old (diff : 6604).
video_out: throwing away image with pts 127291 because it's too old (diff : 4559).
video_out: throwing away image with pts 133281 because it's too old (diff : 4433).
video_out: throwing away image with pts 139272 because it's too old (diff : 7254).
video_out: throwing away image with pts 142268 because it's too old (diff : 5061).
video_out: throwing away image with pts 145258 because it's too old (diff : 3150).
video_out: throwing away image with pts 154231 because it's too old (diff : 3009).
video_out: throwing away image with pts 160211 because it's too old (diff : 5739).
video_out: throwing away image with pts 166193 because it's too old (diff : 5061).
video_out: throwing away image with pts 172163 because it's too old (diff : 5807).
video_out: throwing away image with pts 181116 because it's too old (diff : 3887).
video_out: throwing away image with pts 187083 because it's too old (diff : 6196).
video_out: throwing away image with pts 190067 because it's too old (diff : 3212).
video_out: throwing away image with pts 202000 because it's too old (diff : 6773).
video_out: throwing away image with pts 204982 because it's too old (diff : 3791).
xine_play
ao_flush (loop running: 1)
start pos is 83449274, start time is 0
video_pts = 15000000
audio discontinuity #4, type is 3, disc_off 15000000
waiting for in_discontinuity update #4
video discontinuity #4, type is 3, disc_off 15000000
vpts adjusted with prebuffer to 229849
audio discontinuity #5, type is 3, disc_off 14999510
waiting for in_discontinuity update #5
video discontinuity #5, type is 3, disc_off 14999510
vpts adjusted with prebuffer to 229857
audio jump, diff=-2350
fixing sound card drift by -3487 pts
video jump
play_internal ...done
video_out: throwing away image with pts 229809 because it's too old (diff : 3422).
video_out: throwing away image with pts 235787 because it's too old (diff : 4036).
video_out: throwing away image with pts 247735 because it's too old (diff : 6375).
video_out: throwing away image with pts 250723 because it's too old (diff : 3387).
video_out: throwing away image with pts 265632 because it's too old (diff : 3921).
video_out: throwing away image with pts 280531 because it's too old (diff : 3409).
video_out: throwing away image with pts 292440 because it's too old (diff : 6675).
video_out: throwing away image with pts 295417 because it's too old (diff : 3698).
fixing sound card drift by -2607 pts
video_out: throwing away image with pts 310296 because it's too old (diff : 4327).
video_out: throwing away image with pts 331129 because it's too old (diff : 4399).
video_out: throwing away image with pts 346017 because it's too old (diff : 3013).
video_out: throwing away image with pts 369758 because it's too old (diff : 3321).
set_speed 0
video_out: throwing away image with pts 387459 because it's too old (diff : 3557).

During all of this X sits at around 30-50% CPU usage, while the players usually stay ~15%.

Recently I've configured my asound.conf file to set my default sound card, as it usually set the microphone on my webcam as default for one reason or another. However, I had the same video/audio problems before then. Flash plays perfectly, though! :P

On a side note, I went ahead with the mplayer install even though it didn't properly locate my cdparanoia, which is of a higher version than the dependency requires. Trying to run it (as su or otherwise) gets this error:

Code:

mplayer: error while loading shared libraries: libx264.so.59: cannot open shared object file: No such file or directory
Hope I've provided enough information! I'm not new to Linux at all, but still find myself grappling with a certain bug or puzzle every now and then. Off to try and answer some other users' questions; I feel like I hog you guys too much!

guanx 02-03-2009 04:49 PM

Try the autosync option:
Code:

mplayer -autosync 30 filename.avi
If it does not help, compile an mplayer from source and try again. The source can be found at http://www.mplayerhq.hu

camphor 02-03-2009 05:44 PM

Quote:

Originally Posted by guanx (Post 3430975)
Try the autosync option:
Code:

mplayer -autosync 30 filename.avi
If it does not help, compile an mplayer from source and try again. The source can be found at http://www.mplayerhq.hu

Compiling mplayer hangs on the make command with this error:

Code:

libmpdemux/demux_nut.c:17: error: expected specifier-qualifier-list before 'nut_context_tt'
libmpdemux/demux_nut.c: In function 'demux_open_nut':
libmpdemux/demux_nut.c:67: error: 'nut_demuxer_opts_tt' undeclared (first use in this function)
libmpdemux/demux_nut.c:67: error: (Each undeclared identifier is reported only once
libmpdemux/demux_nut.c:67: error: for each function it appears in.)
libmpdemux/demux_nut.c:67: error: expected ';' before 'dopts'
libmpdemux/demux_nut.c:79: warning: ISO C90 forbids mixed declarations and code
libmpdemux/demux_nut.c:80: error: 'nut_context_tt' undeclared (first use in this function)
libmpdemux/demux_nut.c:80: error: 'nut' undeclared (first use in this function)
libmpdemux/demux_nut.c:80: error: 'nut_priv_tt' has no member named 'nut'
libmpdemux/demux_nut.c:80: error: 'dopts' undeclared (first use in this function)
libmpdemux/demux_nut.c:81: error: 'nut_stream_header_tt' undeclared (first use in this function)
libmpdemux/demux_nut.c:81: error: 's' undeclared (first use in this function)
libmpdemux/demux_nut.c:82: warning: ISO C90 forbids mixed declarations and code
libmpdemux/demux_nut.c:91: error: 'nut_priv_tt' has no member named 's'
libmpdemux/demux_nut.c: In function 'demux_nut_fill_buffer':
libmpdemux/demux_nut.c:179: error: 'nut_context_tt' undeclared (first use in this function)
libmpdemux/demux_nut.c:179: error: 'nut' undeclared (first use in this function)
libmpdemux/demux_nut.c:179: error: 'nut_priv_tt' has no member named 'nut'
libmpdemux/demux_nut.c:180: warning: ISO C90 forbids mixed declarations and code
libmpdemux/demux_nut.c:182: error: 'nut_packet_tt' undeclared (first use in this function)
libmpdemux/demux_nut.c:182: error: expected ';' before 'pd'
libmpdemux/demux_nut.c:183: warning: ISO C90 forbids mixed declarations and code
libmpdemux/demux_nut.c:189: error: 'pd' undeclared (first use in this function)
libmpdemux/demux_nut.c:197: error: 'nut_priv_tt' has no member named 's'
libmpdemux/demux_nut.c:198: error: 'nut_priv_tt' has no member named 's'
libmpdemux/demux_nut.c:207: warning: unused variable 'buf'
libmpdemux/demux_nut.c: In function 'demux_seek_nut':
libmpdemux/demux_nut.c:240: error: 'nut_context_tt' undeclared (first use in this function)
libmpdemux/demux_nut.c:240: error: 'nut' undeclared (first use in this function)
libmpdemux/demux_nut.c:240: error: 'nut_priv_tt' has no member named 'nut'
libmpdemux/demux_nut.c:241: warning: ISO C90 forbids mixed declarations and code
libmpdemux/demux_nut.c:252: error: 'nut_priv_tt' has no member named 's'
libmpdemux/demux_nut.c:253: error: 'nut_priv_tt' has no member named 's'
libmpdemux/demux_nut.c:254: error: 'nut_priv_tt' has no member named 's'
libmpdemux/demux_nut.c: In function 'demux_control_nut':
libmpdemux/demux_nut.c:266: error: 'nut_priv_tt' has no member named 's'
libmpdemux/demux_nut.c:267: error: 'nut_priv_tt' has no member named 's'
libmpdemux/demux_nut.c:268: error: 'nut_priv_tt' has no member named 's'
libmpdemux/demux_nut.c:271: error: 'nut_priv_tt' has no member named 's'
libmpdemux/demux_nut.c:274: error: 'nut_priv_tt' has no member named 's'
libmpdemux/demux_nut.c: In function 'demux_close_nut':
libmpdemux/demux_nut.c:284: error: 'nut_priv_tt' has no member named 'nut'
make: *** [libmpdemux/demux_nut.o] Error 1

Binary codecs have already been installed. I've given demux_nut.c a quick read-through, and nothing really seemed out of the ordinary.

camphor 02-03-2009 10:55 PM

Trying to build mplayer from a SlackBuild script ends with the same problem. Is it really necessary to get videos playing properly? Xine has all of its codecs and links to where mplayer would put them, it's just that videos are unwatchable. Audio playback in all other applications is fine.

croxen 02-04-2009 12:26 PM

Quote:

Originally Posted by camphor (Post 3431331)
Trying to build mplayer from a SlackBuild script ends with the same problem. Is it really necessary to get videos playing properly? Xine has all of its codecs and links to where mplayer would put them, it's just that videos are unwatchable. Audio playback in all other applications is fine.

When a lib is reported as missing, you can usually install either a package for the lib or the applet package that includes the lib (in this case x264). x264 can be found, for example, at www.slacky.eu > Repository > 12.2 > multimedia. Some other libraries (since I'm sure x264 is just the tip of the dependency iceberg) can be found at ... > 12.2 > libraries. Some other app/library packages can also occasonally be found at www.linuxpackages.net Usually, solving the dependency puzzle involves installing a library, trying the app again, then installing another, etc. until you have finally bludgeoned the app into submission and it runs. Even mplayer will eventually run.

Sometimes after installing all the required libraries, a dependency is still missing: you may have version .so.64 installed, but the stupid app refuses to accept anything but, say, .so.59 Sometimes, in these cases, it will work to go into the directory where the library resides, and make a simlink named for the version of the lib the app expects, and link it to the version of the lib you actually have. If you're reasonably lucky, the app will accept it and will run.

camphor 02-04-2009 03:30 PM

mplayer has configured properly and is running with all of the libraries finally properly linked. However, audio and video are still not in sync. Here's the terminal output; the autosync command suggestion posted above shows no improvement.

Code:

MPlayer 1.0rc2-4.1.2 (C) 2000-2007 MPlayer Team
CPU: Intel(R) Pentium(R) 4 CPU 2.80GHz (Family: 15, Model: 4, Stepping: 1)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compilato per CPU x86 con estensioni: MMX MMX2 3DNow 3DNowEx SSE SSE2

Riproduco test.avi
Rilevato formato file AVI!
[aviheader] Trovato flusso video, -vid 0
[aviheader] Trovato flusso audio, -aid 1
VIDEO:  [DX50]  960x540  24bpp  30.000 fps  3800.7 kbps (464.0 kbyte/s)
Informazioni file multimediale:
 Software: transcode-1.0.2
==========================================================================
Apertura decoder video: [ffmpeg] FFmpeg's libavcodec codec family
Scelto codec video: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
==========================================================================
Apertura decoder audio: [mp3lib] MPEG layer-2, layer-3
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Scelto codec audio: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
Inizio la riproduzione...
VDec: configurazione chiesta dal vo - 960 x 540 (sp.col. preferito: Planar YV12)
VDec: uso Planar YV12 come sp.colore di uscita (non 0)
Movie-Aspect è 1.78:1 - riscalo per ottenere un rapporto corretto.
VO: [xv] 960x540 => 960x540 Planar YV12
A:  2.5 V:  2.3 A-V:  0.188 ct:  0.000  69/ 69 20%  0%  0.8% 1 0
In uscita... (Uscita)


mrclisdue 02-04-2009 03:55 PM

I'm intrigued by these lines from your first post:
Code:

params.c:OpenConfFile() - Unable to open configuration file "/home/greg/.smb/smb.conf":
        No such file or directory
params.c:OpenConfFile() - Unable to open configuration file "/etc/samba/smb.conf":
        No such file or directory
Using netbios name WOLVES.
Using workgroup WORKGROUP.

Specifically, why is xine even looking for smb.conf?

Are you, perchance, trying to play a file from a windows box on a lan?

Secondly, what are the specs of your Linux box?

cheers,

andrew.46 02-05-2009 01:21 AM

Hi camphor,

Quote:

Originally Posted by camphor (Post 3432324)
Code:

MPlayer 1.0rc2-4.1.2 (C) 2000-2007 MPlayer Team

You would be better using the svn MPlayer.

Andrew

camphor 02-07-2009 03:33 PM

Having switched to a clean Slackware 12.2 install, I've properly build Mplayer, Xine, and etc. and have the codecs properly registered for them. However, I still see the same problem with absolutely no counterpart when running applications through WINE or in playing music. I'm working on compiling the latest Slacky build of VLC now, so will post my findings when that's complete. Oddly enough, mplayer doesn't present any error messages or anything this time around, but all videos are still out of sync. Thanks for putting up with me so far. :confused:

EDIT: No go with VLC. Nothing unusual in its output other than a Freetype error and several SVG render problems.

JJefferies 02-17-2009 01:20 AM

I'm running Suse 11.1 with 4 processors and 4 gigs of ram. For some reason I've run into this same problem playing video and particularly AVI files. From another website I picked up the suggestion to try totem-xine (totem). I did so and that seems to produce a reasonable presentation. YMMV.


All times are GMT -5. The time now is 09:32 AM.