Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

SMplayer screenshot feature not working (mplayer bug?)

Graphical Environments, Managers, Multimedia & Desktop questions.
Message
Author
Monkey D Luffy
Posts: 79
Joined: 2007-08-25 12:13

SMplayer screenshot feature not working (mplayer bug?)

#1 Post by Monkey D Luffy »

I have posted this message in the smplayer forum and it seems this is a mplayer bug.

I have submited a bug in debian for mplayer as well... but no replies so far (almost 4 weeks have passed)

I would like to know if other people have this working ok or not...

Code: Select all

/usr/bin/mplayer -noquiet -nofs -sub-fuzziness 1 -identify -slave -vo xv -ao alsa -zoom -nokeepaspect -input conf=/usr/share/smplayer/input.conf -stop-xscreensaver -wid 83886090 -monitorpixelaspect 1 -subfont-autoscale 1 -subfont-text-scale 5 -subcp ISO-8859-1 -aid 1 -subpos 100 -contrast 0 -brightness 0 -hue 0 -saturation 0 -nocache -ss 1275 -osdlevel 0 -vf-add screenshot -vf-add eq2,hue -channels 2 -af scaletempo -softvol -softvol-max 110 /media/some_videos_dvd/funny_video.avi

MPlayer dev-SVN-r26940
CPU: Intel(R) Core(TM)2 CPU          6420  @ 2.13GHz (Family: 6, Model: 15, Stepping: 6)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
Can't open joystick device /dev/input/js0: No such file or directory
Can't init input joystick
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
Terminal type `unknown' is not defined.

Playing /media/some_videos_dvd/funny_video.avi.
AVI file format detected.
ID_VIDEO_ID=0
[aviheader] Video stream found, -vid 0
ID_AUDIO_ID=1
[aviheader] Audio stream found, -aid 1
VIDEO:  [XVID]  640x480  12bpp  23.976 fps  948.2 kbps (115.7 kbyte/s)
Clip info:
Software: VirtualDubMod 1.5.4.1 (build 2066/release)
ID_CLIP_INFO_NAME0=Software
ID_CLIP_INFO_VALUE0=VirtualDubMod 1.5.4.1 (build 2066/release)
ID_CLIP_INFO_N=1
ID_FILENAME=/media/some_videos_dvd/funny_video.avi
ID_DEMUXER=avi
ID_VIDEO_FORMAT=XVID
ID_VIDEO_BITRATE=948200
ID_VIDEO_WIDTH=640
ID_VIDEO_HEIGHT=480
ID_VIDEO_FPS=23.976
ID_VIDEO_ASPECT=0.0000
ID_AUDIO_FORMAT=85
ID_AUDIO_BITRATE=94608
ID_AUDIO_RATE=0
ID_AUDIO_NCH=0
ID_LENGTH=1384.68
ID_SEEKABLE=1
Opening video filter: [hue]
Opening video filter: [eq2]
Opening video filter: [screenshot]
Could not open libavcodec PNG encoder
Couldn't open video filter 'screenshot'.
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
ID_VIDEO_CODEC=ffodivx
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
ID_AUDIO_BITRATE=128000
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
ID_AUDIO_CODEC=mp3
Starting playback...
VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
ID_VIDEO_ASPECT=1.3333
VO: [xv] 640x480 => 640x480 Planar YV12  [zoom]
X11 error: BadAccess during XSelectInput Call
X11 error: The 'ButtonPressMask' mask of specified window has probably already used by another appication (see man XSelectInput)
X11 error: MPlayer discards mouse control (reconfiguring)
sending VFCTRL_SCREENSHOT!
failed (forgot -vf screenshot?)
Note the:
Opening video filter: [screenshot]
Could not open libavcodec PNG encoder
Couldn't open video filter 'screenshot'.
....
sending VFCTRL_SCREENSHOT!
failed (forgot -vf screenshot?)


Debian unstable-testing hybrid over here.
$cat /proc/version
Linux version 2.6.26-1-amd64 (Debian 2.6.26-1) (waldi@debian.org) (gcc version 4.1.3 20080623 (prerelease) (Debian 4.1.2-23)) #1 SMP Wed Jul 30 18:46:19 UTC 2008

mplayer 1:1.0.rc2svn20080706-0.1
smplayer 0.6.1-1


Thanks for any help!

Monkey D Luffy
Posts: 79
Joined: 2007-08-25 12:13

#2 Post by Monkey D Luffy »

Nobody else uses smplayer?

Can they make screenshots with just mplayer?

BowCatShot
Posts: 959
Joined: 2006-07-15 12:08

#3 Post by BowCatShot »

The mplayer website lists the parameter:

-vf screenshot

Then there's a keypress that supposedly gives you a screenshot. Haven't tried it since my version doesn't support the -vf parameter and I'm too lazy to compile the latest.

LaoLiulaoliu
Posts: 49
Joined: 2007-11-18 23:06
Contact:

#4 Post by LaoLiulaoliu »

I have the same problem in mplayer,but I don't know how to do.
I also want to know how to slove this problem.

Monkey D Luffy
Posts: 79
Joined: 2007-08-25 12:13

#5 Post by Monkey D Luffy »

LaoLiulaoliu wrote:I have the same problem in mplayer,but I don't know how to do.
I also want to know how to slove this problem.
Reply and confirm the bug on debian (URL on my first post).
Send an email to debian maintainers of the package.

This will probably only get fixed by re-compiling mplayer with that option enabled :-/
I don't know how long will it be...
And besides that, if the bug isn't acknowledged it may not be fixed :(

User avatar
garrincha
Posts: 2335
Joined: 2006-06-02 16:38

#6 Post by garrincha »

I use the -vf screenshot option, to capture a frame with mplayer, press 's':

Code: Select all

mplayer your_video -vf screenshot
No problem on my end and it works o.k.

You could try another method:
Play video in mplayer with x11 output driver, i.e. without hardware acceleration and pause the video (spacebar or p):

Code: Select all

mplayer -vo x11 your_video
Open a second terminal and type this:

Code: Select all

import screenshot.jpg && display screenshot.jpg
A cross-hair will appear, click on the video window and an image window will open up and it will be saved as screenshot.jpg in the directory where the screenshot was invoked. This require the package imagemagick for the import, display and other useful tools, so install it if you don't have one:

Code: Select all

apt-get install imagemagick
Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."

Monkey D Luffy
Posts: 79
Joined: 2007-08-25 12:13

#7 Post by Monkey D Luffy »

Code: Select all

mplayer your_video -vf screenshot
This doesn't work for me.
You probably have a different mplayer version. What's your version?

Maybe I'm missing some package, but I really don't think so.

Thanks for the suggestion on the import, but that is a huge hassle. For making a screenshot it's OK, but for making dozens has I had to... arrghghhg (talk like a pirate pun)... it's really bad.

User avatar
garrincha
Posts: 2335
Joined: 2006-06-02 16:38

#8 Post by garrincha »

Monkey D Luffy wrote:

Code: Select all

mplayer your_video -vf screenshot
This doesn't work for me.
You probably have a different mplayer version. What's your version?

Maybe I'm missing some package, but I really don't think so.

Thanks for the suggestion on the import, but that is a huge hassle. For making a screenshot it's OK, but for making dozens has I had to... arrghghhg (talk like a pirate pun)... it's really bad.
My mplayer is SVN version: dev-SVN-r27338-4.3.1
I compiled it myself so as to get supports like lirc etc. Your mplayer screenshot feature should work, so I'm not sure why it doesn't. Did you press the 's' key to capture frame?

If you want to convert a video to a sequence of images:

Code: Select all

mplayer -nosound -vo jpeg your_video
See my MPlayer HOWTO:
http://forums.debian.net/viewtopic.php?t=17783
Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."

Monkey D Luffy
Posts: 79
Joined: 2007-08-25 12:13

#9 Post by Monkey D Luffy »

I have the official deb package 1:1.0.rc2svn20080706-0.1, which is "MPlayer dev-SVN-r26940"
It should work, but it doesn't :p

Code: Select all

$ mplayer video.avi -vf screenshot
....
sending VFCTRL_SCREENSHOT!000 ct:  0.000 241/241  2%  1%  0.6% 0 0
failed (forgot -vf screenshot?)
I wonder if the debian package was compiled with screenshot capture support. Or if there is some broken dependency with the png library used to take screenshots.

One thing that I have just noticed is this error message on startup:

Code: Select all

$ mplayer -v
...
get_path('codecs.conf') -> '/home/kaizoku/.mplayer/codecs.conf'
Reading /home/kaizoku/.mplayer/codecs.conf: Can't open '/home/kaizoku/.mplayer/codecs.conf': No such file or directory
Reading /etc/mplayer/codecs.conf: Can't open '/etc/mplayer/codecs.conf': No such file or directory
Using built-in default codecs.conf.
There is a possibility this is a problem. On my first post there was this message:

Code: Select all

Could not open libavcodec PNG encoder
Looking at mplayer source code I see that this error message is related to not finding the screenshot codec.
But on the other hand I can see all types of videos, so that means all codecs are found... why is it screenshot the only one not working???


BTW, amazing guide! :)
Still, I advise everybody to try smplayer, it's an amazing frontend that makes easy lots of things :)

rvm
Posts: 2
Joined: 2008-10-04 00:36

#10 Post by rvm »

The problem is that probably mplayer has been compiled without png support.

Try this:

Code: Select all

mplayer video.avi -vo png -frames 3
That should save the first 3 frames of the video as png files. I bet it doesn't work for you either.

The warning about not finding /etc/mplayer/codecs.conf has nothing to do and it's not important, mplayer already has a built-in copy of it.
Developer of SMPlayer.

Monkey D Luffy
Posts: 79
Joined: 2007-08-25 12:13

#11 Post by Monkey D Luffy »

Weird... it worked :shock:

Code: Select all

mplayer video.avi -vo png -frames 3
....
....
Playing movie.avi.
AVI file format detected.
[aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1
VIDEO:  [XVID]  640x272  12bpp  23.976 fps  1088.5 kbps (132.9 kbyte/s)
Clip info:
 Software: VirtualDubMod 1.5.10.2 (build 2540/release)
SUB: Detected subtitle file format: subviewer
SUB: Read 577 subtitles.
SUB: Adjusted 1 subtitle(s).
SUB: Added subtitle file (1): ./movie.srt
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
==========================================================================
Opening audio decoder: [liba52] AC3 decoding with liba52
Using SSE optimized IMDCT transform
Using MMX optimized resampler
AUDIO: 48000 Hz, 2 ch, s16le, 448.0 kbit/29.17% (ratio: 56000->192000)
Selected audio codec: [a52] afm: liba52 (AC3-liba52)
==========================================================================
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...
VDec: vo config request - 640 x 272 (preferred colorspace: Planar YV12)
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 2.35:1 - prescaling to correct movie aspect.
[swscaler @ 0xb2aad0]using unscaled yuv420p -> bgr24 special converter
VO: [png] 640x272 => 640x272 BGR 24-bit
[VO_PNG] Warning: compression level set to 0, compression disabled!
[VO_PNG] Info: Use -vo png:z=<n> to set compression level from 0 to 9.
[VO_PNG] Info: (0 = no compression, 1 = fastest, lowest - 9 best, slowest compression)
A:   0.1 V:   0.1 A-V:  0.009 ct:  0.003   4/  4 ??% ??% ??,?% 0 0

Exiting... (End of file)
I just don't understand why "-vf screenshot" does not work :-/

rvm
Posts: 2
Joined: 2008-10-04 00:36

#12 Post by rvm »

Maybe it's ffmpeg (libavcodec) what has been compiled without png support?
Developer of SMPlayer.

Monkey D Luffy
Posts: 79
Joined: 2007-08-25 12:13

#13 Post by Monkey D Luffy »

rvm wrote:Maybe it's ffmpeg (libavcodec) what has been compiled without png support?
Is there any way of knowing that?
I have the latest debian packages of both mplayer and libavcodec.
I'm running a testing-unstable hybrid setup here.

User avatar
garrincha
Posts: 2335
Joined: 2006-06-02 16:38

#14 Post by garrincha »

I don't have mplayer binary from debian archive on this machine but will check later on in the other PC currently undergoing maintenance. Anyway, I complied mplayer with png support but if I'm not mistaken I recall that png support is auto-detect so I would assumed that the binary mplayer deb package should have png support by default?
Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."

User avatar
garrincha
Posts: 2335
Joined: 2006-06-02 16:38

#15 Post by garrincha »

Btw, there are two ffmpeg package: one is in the debian-multimedia repo and the other is in the main debian archive.
Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."

BowCatShot
Posts: 959
Joined: 2006-07-15 12:08

#16 Post by BowCatShot »

I just compiled the latest mplayer and I'm surprised that it even works at all. I tried to count all of the warning level diagnostics that came out of the compile and I lost count at around 50. That wasn't anywhere near the total.

When I was writing software for a living we weren't allowed to have any compile diagnostics, not even warnings. This points out a flaw in the free software concept. There is very little if any accountability. Those diagnostics, even though they're classified as warnings, can definitely produce bugs.

User avatar
garrincha
Posts: 2335
Joined: 2006-06-02 16:38

#17 Post by garrincha »

BowCatShot wrote:I just compiled the latest mplayer and I'm surprised that it even works at all. I tried to count all of the warning level diagnostics that came out of the compile and I lost count at around 50. That wasn't anywhere near the total.

When I was writing software for a living we weren't allowed to have any compile diagnostics, not even warnings. This points out a flaw in the free software concept. There is very little if any accountability. Those diagnostics, even though they're classified as warnings, can definitely produce bugs.
This is why if you need a piece of software to be almost (it can never be 100%) bug free, you're better off using the current Debian 'stable' and the mplayer package from the Debian maintainer. Most of the time I'm just messing around in Debian unstable and compile a few stuffs like mplayer and to be honest I never had any problem with mplayer.
Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."

BowCatShot
Posts: 959
Joined: 2006-07-15 12:08

#18 Post by BowCatShot »

Do you think that if I downloaded the source from Debian and compiled it then all of those warning diagnostics would be gone?

User avatar
garrincha
Posts: 2335
Joined: 2006-06-02 16:38

#19 Post by garrincha »

BowCatShot wrote:Do you think that if I downloaded the source from Debian and compiled it then all of those warning diagnostics would be gone?
I'm not sure. Fyi, mplayer (1.0~rc1-12etch3):
NOTE: the .tar.gz distributed with Debian does not contain all of the upstream code. Read README.Debian and copyright for details
mplayer (1.0~rc2-18 and others), i.e. debian unstable:
Not all of the upstream code is distributed in the source tarball. See the README.Debian and copyright files for details.
Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."

Monkey D Luffy
Posts: 79
Joined: 2007-08-25 12:13

#20 Post by Monkey D Luffy »

garrincha wrote:Btw, there are two ffmpeg package: one is in the debian-multimedia repo and the other is in the main debian archive.
mmmh... I believe I have the one from debian-multimedia installed.

Selecting the ffmpeg package that I have installed (version 3:20080706-0.2) from the list of available packages, I can see that its mantainer is Christian Marillat (with a debian.org email account).

Checking mplayer the same thing happens. The version I have installed is different than the one from debian: This can be seen also on http://bugs.debian.org/cgi-bin/pkgrepor ... t=unstable

I have reported the bug to the wrong person :-(
I will send an email to Marillat.

Good thinking outside the box garrincha :)

Post Reply