[MPlayer-users] How to determin the Main-Movie
HR
haavroed at online.no
Tue Dec 9 22:09:54 CET 2003
> [mailto:mplayer-users-bounces at mplayerhq.hu] On Behalf Of Tilo Renkl
[...]
> does anybody know how I can find out what Titelnumber (for dvd://X)
> I need for the main movie of a DVD ??
> Most times its 1, but sometimes its 2,3,4,5 ... and it sucks
> to test every title to find out whitch one is the right one.
A crude approach: For "normal" movies, it is almost always the title
with the most chapters in it. So a script that loops through the titles,
checking mencoder/mplayer output, remembering which title had the most
chapters will normally suffice (see below for an example). This is often
not the case with cartoons and children movies or any other DVD that is
crowded with "features", where I've seen insanely high chapter numbers.
Finally, you can use the mencoder/mplayer output and the fact that
movies usually have a few audio tracks and subtitles in them. This,
ofcourse, is not a very scientific method, but it usually works just
fine. Someone else must have a better idea though, and I'd like to hear
it too so I can change my script :)
You can probably grab the info directly from the ifo/vob somehow.
HR
#!/bin/bash
movie_title=0
max_ch=0
titles=`mencoder -v dvd://1 2>/dev/null | grep " titles " | cut -f3 -d'
'`
for (( title=1; title<=titles; title++ )); do
ch=`mencoder -v dvd://${title} 2>/dev/null | grep chapters | cut -f3
-d' '`
[ $ch -gt $max_ch ] && { max_ch=$ch; movie_title=$title; }
done
echo "Movie title is $movie_title"
More information about the MPlayer-users
mailing list