[MPlayer-dev-eng] key frame extractor / vo_jpeg use YV12 instead of RGB patch

Andreas Krebs andreas.krebs at web.de
Thu Mar 15 22:14:26 CET 2007


hi all,

I was looking for a program to extract relevant key frames from a video for creating
a web page index. since I didn't find a program I liked, I decided to write a video 
output driver for mplayer to do this. 

as a starting point I decided to use vo_jpeg.c since it already takes care of saving
the frames as jpeg. so in a first step I added a new parameter 'framedist' to prevent
vo_jpeg from saving every frame. after that I changed vo_jpeg to use YV12 image
data rather than RGB (since I plan to do the image comparison there rather than
in RGB).

this is how far I got, however this already created some interesting results, so vo_jpeg
now runs almost twice as fast on my PC, simply to the fact the it now directly uses 
YV12 rather than converting to RGB and back, also  the image quality seems to have
improved a bit by this (at least the resulting jpegs look better to me - but maybe it's
only my imagination ;-) ).

therefore I decided to already post this patch. so maybe someone more familiar
with mplayer may can review it and decide whether it's working under all conditions.
e.g. my patch expects that a slice in YV12 is always 16 pixel high and padded to
match the jpeglib requirements (for all my test videos this seemed to be the case).

so feel free to include or drop this patch as you like. 

as for creating the video output driver - what do you suggest, should I continue 
modifying vo_jpeg or should I copy it and create my own new driver?


by the way writing the patch only took a few hours (and most time it took me to figure
out how jpeglib expects raw data). I was really surprised how easy it was, especially
since it was the first time I even looked into the mplayer source ;-).

--
Andreas


PS: if anybody has a good algorithm for calculating image similarities (for the
key frame selection) please let me know.



_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066

-------------- next part --------------
A non-text attachment was scrubbed...
Name: vo_jpeg.patch.bz2
Type: application/x-bzip2
Size: 2833 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070315/2ee48611/attachment.bin>


More information about the MPlayer-dev-eng mailing list