You are not logged in.

#1 2008-09-15 06:30:16

colbert
Member
Registered: 2007-12-16
Posts: 809

mplayer freezing at start of playback

I suddenly find mplayer freezing at the start of playback when using the -stop-xscreensaver option:

/media/stuff/tv > bluray sstv-wolverine.and.the.x.men.s1e1.dsr.xvid.avi 
MPlayer 1.0rc2-4.3.2 (C) 2000-2007 MPlayer Team
CPU: Intel(R) Core(TM)2 Quad CPU    Q6600  @ 2.40GHz (Family: 6, Model: 15, Stepping: 11)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2
115 audio & 237 video codecs

Playing sstv-wolverine.and.the.x.men.s1e1.dsr.xvid.avi.
AVI file format detected.
[aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1
VIDEO:  [XVID]  512x384  12bpp  23.976 fps  944.9 kbps (115.3 kbyte/s)
Clip info:
 Software: VirtualDubMod 1.5.10.2 (build 2540/release)
xscreensaver_disable: xscreensaver wid=27262977.

It pauses here for a good 10-12 seconds, then continues to play okay:

Opening video filter: [screenshot]
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...
VDec: vo config request - 512 x 384 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
[swscaler @ 0x8950f70]SwScaler: using unscaled yuv420p -> bgr24 special converter
VO: [xv] 512x384 => 512x384 Planar YV12  [fs]
A:   1.2 V:   1.2 A-V: -0.001 ct:  0.001  29/ 29  7%  0%  0.6% 2 0 
Exiting... (Quit)

What could be causing this? I recently removed mplayer and installed mplayer-dvdnav from AUR, but I removed it and reinstalled regular mplayer via pacman again, same problem.

TIA for any help smile

Offline

#2 2008-09-16 07:13:44

colbert
Member
Registered: 2007-12-16
Posts: 809

Re: mplayer freezing at start of playback

Well, it's being caused by xscreensaver. If I hit CTRL+C after the first part above, the video plays back right away. I also commented out -stop-xscreensaver from ~/.mplayer/config and all vids play back fine now. Still no clue why it's happening though sad

Offline

#3 2008-09-16 15:18:56

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: mplayer freezing at start of playback

It seems that the code was removed from Mplayer. Check this thread out. It may offer a solution:

http://groups.google.com/group/linux.de … 22f5c89b14

Offline

#4 2008-09-16 17:46:51

colbert
Member
Registered: 2007-12-16
Posts: 809

Re: mplayer freezing at start of playback

Thanks skottish. So I suppose I should make a script. How could I make one that: checks if xscreensaver is running and if so, it kills the process, plays the video and upon exit of the video restarts xscreensaver? I'm a scripting noob big_smile

Taking one of my zenity reboot scripts and trying to modify it I came up with this (just testing):

#!/bin/sh
kx="pidof xscreensaver"
if [ "${kx}" == "1" ]; then
    killall xscreensaver && mplayer -ao alsa -vf screenshot /media/trailers/new/nothingliketheholidays_h720p.mov && xscreensaver
fi

But it don't work (of course lol) wink big_smile Any help appreciated.

Last edited by colbert (2008-09-16 17:51:22)

Offline

#5 2008-09-16 18:00:50

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: mplayer freezing at start of playback

This is what I was getting at. I didn't explain it because I don't use screen savers. From man mplayer:

-heartbeat-cmd
              Command that is executed every 30 seconds  during  playback
              via system() - i.e. using the shell.

              NOTE: MPlayer uses this command without any checking, it is
              your responsibility to ensure it does  not  cause  security
              problems  (e.g.  make  sure  to use full paths if "." is in
              your path like on Windows).

              This can be "misused" to disable screensavers that  do  not
              support the proper X API (also see -stop-xscreensaver).  If
              you think this is too complicated, ask the  author  of  the
              screensaver program to support the proper X APIs.

              EXAMPLE  for xscreensaver: mplayer -heartbeat-cmd "xscreen‐
              saver-command -deactivate" file

              EXAMPLE  for  GNOME  screensaver:  mplayer   -heartbeat-cmd
              "gnome-screensaver-command -p" file

I am using Mplayer built from subversion yesterday (r27630), but I don't think that it will matter here.

Offline

#6 2008-09-16 18:23:43

colbert
Member
Registered: 2007-12-16
Posts: 809

Re: mplayer freezing at start of playback

Ah, I see, thanks. However the mplayer from pacman does not have this command? I am getting error that it's an unknown command. Just have to wait until newest mplayer is updated in pacman I suppose??

Last edited by colbert (2008-09-16 18:23:59)

Offline

#7 2008-09-16 18:55:07

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: mplayer freezing at start of playback

This is the mplayer-svn PKGBUILD that I use, but it's heavily modified to use as much of FFmpeg as possible (no external FAAD, anything Vorbis, anything MPEG 2, Xvid, so on). My version of FFmpeg is never more than a few days old, so some of the features that I rely on may not be in the repo build. It may work just fine though; Mplayer uses runtime detection. You can always pull the configure line out of the ABS tree; That should work. Also, the GUI is disabled. I use Gnome-Mplayer with the gecko-mediaplayer plug-in:

# $Id: PKGBUILD 356 2008-04-18 22:56:27Z aaron $
# Maintainer: Tom Killian <tom@archlinux.org>
# Contributor: lucke <lucke at o2 dot pl>

pkgname=mplayer-svn
pkgver=27630
pkgrel=1
pkgdesc="A movie player for linux"
depends=('libungif' 'cdparanoia' 'gtk2' 'codecs' 'sdl' \
         'libjpeg' 'esd' 'faac' 'ttf-bitstream-vera' \
         'libxxf86dga' 'fontconfig' 'libxinerama' 'libxv' 'libpng' \
     'libxxf86vm' 'libgl')
makedepends=('subversion' 'pkgconfig')
#source=(ftp://ftp.mplayerhq.hu/MPlayer/skins/Blue-1.7.tar.bz2)
#md5sums=('e4e2020d11b681aac898103b3ba723c4')
conflicts=('mplayer')
provides=('mplayer')
url="http://www.mplayerhq.hu/"
license=("GPL")
arch=('i686' 'x86_64')

_svntrunk=svn://svn.mplayerhq.hu/mplayer/trunk
_svnmod=mplayer

build() {
  cd $startdir/src

  svn co $_svntrunk $_svnmod --config-dir ./ -r $pkgver

  cp -r $_svnmod $_svnmod-build
  cd $_svnmod-build

  unset CFLAGS

  ./configure --prefix=/usr --confdir=/etc/mplayer --win32codecsdir=/usr/lib/win32 \
  --enable-runtime-cpudetection --enable-largefiles --enable-menu --disable-gui --disable-faad \
  --disable-libdv --disable-aa --disable-liblzo --disable-speex --disable-fribidi --disable-mp3lame \
  --disable-arts --disable-smb --disable-dvdnav --disable-openal --disable-faad-internal \
  --disable-x264 --disable-jack --disable-musepack --disable-libamr_nb --disable-libamr_wb \
  --disable-lirc --disable-lircc --disable-enca --disable-pulse --disable-directfb --disable-nas \
  --disable-xvid --disable-theora --disable-libvorbis --disable-libmpeg2 --disable-mad


  make || return 1
  make DESTDIR=$startdir/pkg install || return 1
  install -m644 etc/{codecs.conf,input.conf,example.conf} $startdir/pkg/etc/mplayer
  ln -s /usr/share/fonts/TTF/Vera.ttf $startdir/pkg/usr/share/mplayer/subfont.ttf
  rm -rf $startdir/pkg/usr/share/mplayer/font
#  mv $startdir/src/Blue $startdir/pkg/usr/share/mplayer/skins/default

  rm -rf ../$_svnmod-build
}

Last edited by skottish (2008-09-16 18:56:15)

Offline

#8 2008-09-16 19:29:10

zodmaner
Member
Registered: 2007-07-11
Posts: 653

Re: mplayer freezing at start of playback

skottish wrote:

This is the mplayer-svn PKGBUILD that I use, but it's heavily modified to use as much of FFmpeg as possible (no external FAAD, anything Vorbis, anything MPEG 2, Xvid, so on). My version of FFmpeg is never more than a few days old, so some of the features that I rely on may not be in the repo build. It may work just fine though; Mplayer uses runtime detection. You can always pull the configure line out of the ABS tree; That should work. Also, the GUI is disabled. I use Gnome-Mplayer with the gecko-mediaplayer plug-in:
...<sniped>...

Thanks for the PKGBUILD. Could you also share your ffmpeg's PKGBUILD?

Offline

#9 2008-09-16 20:07:49

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: mplayer freezing at start of playback

zodmaner wrote:

Thanks for the PKGBUILD. Could you also share your ffmpeg's PKGBUILD?

I'm glad you got me thinking about this. My build setup for FFmpeg and x264 were a mess. I've had them both since long before I could make sense of a good PKGBUILD. So I tried both from AUR today (ffmpeg-svn and x264-git), and both of them do what I need them to do (with some modifications):

http://aur.archlinux.org/packages.php?ID=5553

I changed the provides line to the following to remain consistent with Arch's naming convention:

provides=("ffmpeg=`date +%Y%m%d`")


If anyone is going to build x264 from git, do it first. It will break everything on your system that requires it. They are currently at so.64. The version in the repos is far behind.

Last edited by skottish (2008-09-16 20:16:07)

Offline

#10 2008-09-16 21:31:11

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: mplayer freezing at start of playback

Bump for some news.

I was just looking through the Mplayer-dev mailing list, and they just did (during this thread) or are about to commit code to allow Mplayer to use external FFmpeg libraries! This is indeed great news. As I pointed out above, there are a bunch of dependencies for Mplayer that are unnecessary now for most uses. My entire configure list for FFmpeg is this:

      --enable-libfaac \
          --enable-libx264 \
          --enable-shared \
          --disable-static \
          --enable-pthreads \
          --enable-network \
          --enable-x11grab \
          --enable-postproc \
          --enable-avfilter \
          --enable-avfilter-lavf \
          --enable-swscale \

and just about everything works. FAAC is in the process of becoming unnecessary. x264 isn't going to be replaceable for quite a while. Almost everything else FFmpeg can play natively, or is the RealPlayer code that's left in the codecs package.

Last edited by skottish (2008-09-16 21:32:03)

Offline

#11 2008-09-16 21:41:01

zodmaner
Member
Registered: 2007-07-11
Posts: 653

Re: mplayer freezing at start of playback

Thanks for the PKGBUILDs and suggestions, skottish. All of the packages built and works just fine. smile

Maybe you should consider uploading your mplayer-svn PKGBUILD to AUR, since the mplayer-svn package seems to have been removed from the official repos and the only mplayer-svn package in AUR (mplayer-nogui-svn is orphan.

Update
Ah... wait, Mplayer just complain to me that it lacks faad codec to play a vid, but the sounds is coming out alright. Is this because ffmpeg is providing the codec?

Last edited by zodmaner (2008-09-16 21:51:21)

Offline

#12 2008-09-16 21:51:52

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: mplayer freezing at start of playback

zodmaner wrote:

Thanks for the PKGBUILDs and suggestions, skottish. All of the packages built and works just fine. smile

Maybe you should consider uploading your mplayer-svn PKGBUILD to AUR, since the mplayer-svn package seems to have been removed from the official repos and the only mplayer-svn package in AUR (mplayer-nogui-svn is orphan.

This was the one from AUR! I just tweak it for my needs.

I don't want to try to maintain a package like this because of what I said before: I don't have: faad, libvorbis, xvid, any of the mpeg2 libraries, mp3lame, etc on this machine. They're all unnecessary for me. But, they may not be for other people. I'll drop a52dec as soon as Mplayer fixes their issues with the internal FFmpeg ac3 code, and I'll drop faac as soon as FFmpeg finishes their aac encoder. Hell, I'd drop Mplayer in favor for xine if there was a fully functional browser plug-in somewhere. xine is already mostly middleware between FFmpeg and whatever client is calling it.

--EDIT--

I do have faad2 for MPD. I lied.

--EDIT 2--

I un-lied. mpd-ffmpeg removes the need for all external audio libraries with the exception of wavpack. wavpack is needed by easytag anyway.

Last edited by skottish (2008-09-17 18:30:12)

Offline

Board footer

Powered by FluxBB