태터데스크 관리자

도움말
닫기
적용하기   첫페이지 만들기

태터데스크 메시지

저장하였습니다.
BLOG main image
B형 왼손잡이 곱슬머리 B형 왼손잡이 곱슬머리 B형 왼손잡이 곱슬머리

19/08/2007: Sequential Video Thumbnails on Linux

So, I was looking for a way to create sequential video thumbnails (like this one) from a video file on Linux. I found that my options were severely limited. On Windows there are a plethora of tools capable of this fairly simple task, including Media Player Classic, but on Linux all I could find was QFrameCatcher. The QFrameCatcher website was inaccessible yesterday; today I managed to download the source code, but couldn’t get it to build.

Anyway, I decided it probably wouldn’t be very difficult to build my own so…

dhyana.pl

dhyana.pl is a small Perl script that co-ordinates mplayer and ImageMagick to create a lovely montage of thumbnails. (Dyhana — roughly pronounced as “jahna” — is the Sanskrit word for a deep meditation.)

Usage

dhyana.pl MovieFile.avi 8 4 ‘240×180+10+10’

The first parameter is required and is the file name for the movie file. dhyana.pl has been tested with videos in AVI, WMV and MPEG formats. MPEG videos come out looking like crap, but AVI and WMV look much better.

The second and third parameters are the numbers of rows and columns in the output file. These parameters are optional and default to 6 rows and 4 columns = 24 thumbnails.

The fourth parameter is a geometry setting to be passed to ImageMagick. This is also optional. It takes the form of WxH+L+T where:

  • W is the thumbnail width
  • H is the thumbnail height
  • L is the left and right padding
  • T is the top and bottom padding

Thumbnails will be resized keeping their aspect ratio, so images don’t look squished. Normally with ImageMagick you can precede the width with an exclamation mark to force the image to be resized to exactly the sepcified dimensions. I’ve not tried this with dhyana.pl, but it should work. The default geometry is ‘240×180+10+10’.

Requirements

  • ImageMagick
  • MPlayer
  • ffmpeg (optional)
  • Perl 5

FFMPEG is used for MPEG video captures and MPlayer is used for other video captures. As previously mentioned MPEG video captures look like crap — but they look even worse when you use MPlayer. AVI and WMV captures look great. (This has to do with key frames and stuff… I won’t go into the boring details. Also, it’s worth noting that ffmpeg is very slow for video captures. MPlayer is significantly faster.)

If you have those programs, but they’re not installed in the normal place (/usr/bin/), then you’ll need to open up dhyana.pl in your favourite text editor and manually set the correct paths.

Actually, you’ll probably need to open it up anyway and enter in the path to your favourite TrueType font, as it’s probably different to how it is on my system.

Download

If, after all that, I’ve not scared you away, here it is…

신고
Posted by 하늘도깨비

댓글을 달아주세요:: 네티켓은 기본, 스팸은 사절


티스토리 툴바