HOW-TO create a video thumbnail under Linux
#1
Since I find it useful, maybe others might as well, so I'm sharing Wink

The mplayer syntax for creating a thumbnail is:
mplayer -ss <seconds> -nosound -vo jpeg -frames 2 <video filename>


So, to grab a frame 60 seconds into the latest episode of The Simpsons:

mplayer -ss 60 -nosound -vo jpeg -frames 2 simpsons.s19e08.avi


This will create a thumbnail named 00000001.jpg.

I wrapped this into a script I've named makethumb:

Code:
#!/bin/sh

set -e # exit on any error

seconds=120
input=$1

if [ ! -z "$2" ]; then
  seconds=$2
fi

log="/dev/null"
thumb=`echo $input | sed 's/\....$/.jpg/'`
xbox_thumb=`echo $thumb|sed 's/.jpg/.tbn/'`

if [ -f "$thumb" ]; then
  echo "Recreating by increasing thumb value by 3 sec"
  seconds=$(($seconds + 3))
  rm -f "$thumb"
  rm -f "$xbox_thumb"
fi

echo "=== Processing $input ==="
echo -n "Step 1: extracting frame ... "
mplayer -ss $seconds -nosound -vo jpeg -frames 2 "$input" > $log 2>&1 \
   && echo "[ ok ]" || echo "[ FAIL ]";
echo -n "Step 2: renaming thumb ... "
output=`ls -t 00000*.jpg | tail -1`
mv "$output" "$thumb" && echo "[ ok ]" || echo "[FAIL]"
ln "$thumb" "$xbox_thumb"
rm -f 00000*.jpg

This script takes a filename as argument and produces a .tbn and a .jpg file with the same name as the video input.
Reply
#2
Thumbs Up 
Feel free to update this wiki article on how-to do it for Linux as well:
http://www.xboxmediacenter.com/wiki/inde...thumbnails

Just make sure to make seperate sections in it for Windows and Linux.

Wink
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#3
FYI; this was added to the Linux port branch of XBMC late yesterday:
Quote:extract frame from video files without thumb. experimental.
Let's hope this feature gets ported back to the Xbox trunk as well Wink
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#4
Works good on Mac OS X with mplayer installed through darwinports or fink.

-Owl
Reply
#5
Old thread bully for me for reviving a dinosaur.. yes Ive been gone awhile..

Anyway, does anybody have or know of a way of duplicating the effect of the old photoshop actionscript (3D tilt) for thumbs under linux (havent tried it with Wine so cant say if that would work) Im curious if there is a completely native linux way of doing it.
Image
Reply
#6
HarshReality Wrote:Old thread bully for me for reviving a dinosaur.. yes Ive been gone awhile..

Anyway, does anybody have or know of a way of duplicating the effect of the old photoshop actionscript (3D tilt) for thumbs under linux (havent tried it with Wine so cant say if that would work) Im curious if there is a completely native linux way of doing it.

yeah i've wrote a php script using the imagick library. you'll need the both-sides cover scan from cdcovers.cc or similar though. atm the latest covers are daily fetched from cdcovers.cc and uploaded tilted to mediaicons.org. if you want i can paste the script somewhere.
Running XBMC on my HTPC, tablet, phone and pinball machine.
Always read the XBMC online-manual, FAQ and search the forums before posting. Do NOT e-mail Team-XBMC members asking for support. For troubleshooting and bug reporting, make sure you read this first.
Reply

Logout Mark Read Team Forum Stats Members Help
HOW-TO create a video thumbnail under Linux0