[mythtv-users] MythVideo thumbnails
Michael T. Dean
mtdean at thirdcontact.com
Wed Feb 15 22:46:22 UTC 2006
On 02/15/2006 05:29 PM, yan seiner wrote:
> Nick Rout wrote:
>> Thats a nice idea, most of my stuff in mythvideo is downloaded tv programmes, and having the same imdb cover art for 30 episodes of Lost is boring.
>>
>> In theory the script will:
>>
>> for each entry in the video table
>> if entry has no cover art
>> make a thumbnail (say 5 mins into the file)
>> store it in a known location
>> insert the path to the thumbnail in the database
>> endif
>> next
>>
>> thumbnail should not be the first frame of the file, as this is often blank, or an advert, or a studio logo or something.
>>
>> I am no programmer, but could probably hack up a half page script to do this (badly) in a week or two of frustration :-)
> ISTR that you can do this with mplayer or possibly mencoder. read the
> manpage; there is a way to generate jpegs but I'm not sure if you can
> specify a position....
>
Yeah, mplayer, not mencoder. Something like:
mplayer -ss 00:11:44 -vo jpeg:quality=95:outdir=/myth/posters -frames 1
-ao null <video_file>
to get the frame at 11min 44sec into the video. However, note that
MPlayer always outputs at least 2 frames (even with the -frames 1,
above) because it seems to want to ensure the video starts with one
blank frame. So, the output of the above would be (don't remember
exactly how many 0's, though):
/myth/posters/0000001.jpg (black frame)
/myth/posters/0000002.jpg (frame from specified position)
Then, the script would have to rename 0000002.jpg to something more
appropriate and set the value in the databsae. Note, also, that mplayer
is happy to continually overwrite the old ones (so you wouldn't
necessarily have to delete 0000001.jpg each time).
So, really, all you need to do is come up with something to manage the
file names (and handle the cases where they're not created) and to put
it in the database. Oh, and if you want it integrated into Myth, I
recommend you make the script so that it's able to work like
imdb.pl--i.e. for a particular video instead of always doing the entire
videos directory (i.e. use an option to do all videos).
Mike
More information about the mythtv-users
mailing list