[MPlayer-users] -vo jpeg output

Corey Hickey bugfood-ml at fatooh.org
Tue Mar 2 02:14:52 CET 2004


Geoff wrote:
> I'd like to use mplayer to output jpegs from a video clip. I have used -vo 
> jpeg and it works.
> 
> Now I want to do something a little different.
> 
> I want to capture jpegs from a 30 sec clip and save them in grayscale.

If you use libavcodec for decoding, you can use `-lavdopts gray' to give
you grayscale. Otherwise, use -vf eq2 with saturation=0.


Use lavdopts for a movie which lavc normally handles:
$ mplayer movie.avi -lavdopts gray -vo jpeg

Force lavc for a movie that lavc can decode but which defaults to a
different codec:
$ mplayer dvd://1 -vfm ffmpeg -lavdopts gray -vo jpeg

Use eq2 for a movie that lavc cannot decode:
$ mplayer movie.rm -vf eq2=1:1:0:0:1:1:1:1 -vo jpeg

> I also 
> want them to be captured at a different rate than the original clip, say 
> 15fps instead of 30fps. So instead of 900 jpegs from a 30 sec clip I get 450 
> jpegs.

I don't think you can do that with mplayer. Because most video codecs
describe frames with reference to the previous frame, mplayer must
decode every frame. Afterward, it would have to drop half the frames
instead of saving them to png. ...which it just isn't designed to do.
You could theoretically use mencoder with -ofps, but that would involve
re-encoding the video stream, hence quality loss.

You could, however, use some shell scripting to get rid of every other
frame. Something like:

#begin
remove=0
for file in *.jpg ; do
    if [ "$remove" = 1 ] ; then
        rm "$file"
        remove=0
    else
        remove=1
    fi
done
#end


Just be sure not to run it in the directory where you keep the pr0n. ;)
I suppose you could change *.jpg to ????????.jpg if you want.

-Corey




More information about the MPlayer-users mailing list