SMplayer screenshot feature not working (mplayer bug?)

Everything about X, Gnome, KDE, ... and everything running on it

SMplayer screenshot feature not working (mplayer bug?)

Postby Monkey D Luffy » 2008-09-12 22:24

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

Postby Monkey D Luffy » 2008-09-13 23:31

Nobody else uses smplayer?

Can they make screenshots with just mplayer?
Monkey D Luffy
 
Posts: 79
Joined: 2007-08-25 12:13

Postby BowCatShot » 2008-09-14 13:43

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.
BowCatShot
 
Posts: 964
Joined: 2006-07-15 12:08

Postby LaoLiulaoliu » 2008-09-29 16:14

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.
LaoLiulaoliu
 
Posts: 49
Joined: 2007-11-18 23:06

Postby Monkey D Luffy » 2008-09-29 22:55

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 :(
Monkey D Luffy
 
Posts: 79
Joined: 2007-08-25 12:13

Postby garrincha » 2008-09-29 23:31

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."
User avatar
garrincha
 
Posts: 2340
Joined: 2006-06-02 16:38

Postby Monkey D Luffy » 2008-09-30 23:41

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.
Monkey D Luffy
 
Posts: 79
Joined: 2007-08-25 12:13

Postby garrincha » 2008-10-01 21:22

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:
viewtopic.php?t=17783
Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."
User avatar
garrincha
 
Posts: 2340
Joined: 2006-06-02 16:38

Postby Monkey D Luffy » 2008-10-03 07:53

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 :)
Monkey D Luffy
 
Posts: 79
Joined: 2007-08-25 12:13

Postby rvm » 2008-10-04 00:46

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.
rvm
 
Posts: 2
Joined: 2008-10-04 00:36

Postby Monkey D Luffy » 2008-10-04 07:19

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 :-/
Monkey D Luffy
 
Posts: 79
Joined: 2007-08-25 12:13

Postby rvm » 2008-10-04 10:28

Maybe it's ffmpeg (libavcodec) what has been compiled without png support?
Developer of SMPlayer.
rvm
 
Posts: 2
Joined: 2008-10-04 00:36

Postby Monkey D Luffy » 2008-10-04 13:54

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.
Monkey D Luffy
 
Posts: 79
Joined: 2007-08-25 12:13

Postby garrincha » 2008-10-04 13:59

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: 2340
Joined: 2006-06-02 16:38

Postby garrincha » 2008-10-04 14:04

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."
User avatar
garrincha
 
Posts: 2340
Joined: 2006-06-02 16:38

Next

Return to Desktop & Multimedia

Who is online

Users browsing this forum: No registered users and 2 guests

fashionable