[MPlayer-dev-eng] patch to add feature: play only specified frames (usefull for grabbing)

Cristi Cristi cr1st1 at go.ro
Thu Feb 6 12:52:38 CET 2003


I wanted to grab some images from the movies played with
mplayer (since it knows so many formats :-) ) but
unfortunately I didn't had a way to tell which frames (using
-vo png/jpeg) - mplayer can only play a specified frame count
or all.

I tried also with transcode - but it's so... buggy! It
crashed very often, even if it didn't crashed (after patching
a bit) it left me with running(?) tcdecode and tcextract
programs. Besides that, I saw that the "stream.yuv" written by
mplayer had strange colors in it (mplayer bug? - used with -vo
yuv4mpeg). So I decided to write a change directly into
mplayer (is there though another way of doing it which I
missed?) The current patch adds a new option for mplayer:
"onlyframes" which is a string of the form "{frame_range,...}"
where
frame_range=frame|-last_frame|start_frame-|start_frame-end_frame

Examples of usage: "mplayer -benchmark -nosound -vo png
-onlyframes -10,50-70,80,83,90- FILENAME ..." which will grab
frames

"mplayer -benchmark -nosound -vo png -onlyframes 10,50,90
fILENAME ..." which will play frames 10, 50 and 90 (which will
be like grabbing from the movie at 10%, %50 and 90% of it's
length assuming it has 100 frames :-) )

Notes on the patch: - if a seek command happens while using
this parameter - it is disabled (the "play only not the seek
:-) - if for some reasons frames are dropped - you might get
the wrong frames grabbed - frame numbers should be ordered
(ascending) - it it finds that the last allowed frame was
grabbed it continues with the next file (if available) - funny
things might happen if using it with standard playback (you'll
get black screen until some frames are displayed). Remember
that it's usage is with things like -vo
jpg/png/mpegpes/yuv4mpeg. - even if transcode would have
worked without crashing, it still doesn't have this kind of
ease of specifying the frames to extract (it allows only one
frame range definition with "-c")

Off topic: mplayer.c - the main() function is a mess - aren't
there ways to write it cleaner?

Regards, Cristi P.


----

Home, no matter how far...
http://www.home.ro
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/octet-stream
Size: 839 bytes
Desc: cfg-mplayer.h.patch
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20030206/5eb3bbb5/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/octet-stream
Size: 7174 bytes
Desc: mplayer.c.patch
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20030206/5eb3bbb5/attachment-0001.obj>


More information about the MPlayer-dev-eng mailing list