[Home]Mkindex.Sh

No diff available--this is the first major revision. (no other diffs)
Makes an Extended m3u playlist.
#!/bin/bash -x
# mkindex.sh
echo \#EXTM3U>index.m3u
shopt -s nullglob
for FileName in *.avi *.mpg *.MPG *.mov *.mkv *.mp3 *.ogg
        do

        MpOPTS="-vo null -ao null -frames 0 -nosound -quiet -identify "
        ID_LENGTH=`mplayer "$FileName" $MpOPTS |grep ^ID_LENGTH|awk -F'=' '{print $2}'`

        TITLE=`mplayer  "$FileName" $MpOPTS|grep "^ Title"|sed 's/ Title: //'`
        if [ -z "$TITLE" ];then # Quote strings within test brackets!
                TITLE=`echo $FileName|sed 's/\(.*\)\..*$/\1/'|sed 's/[_\.]/ /g'`
        fi
        echo \#EXTINF:$ID_LENGTH,$TITLE>>index.m3u
        echo "$FileName">>index.m3u
done
if [ -d video_ts ]; then mv video_ts VIDEO_TS; fi
if [ -d VIDEO_TS ]
        then

        SECONDS=`tcprobe -i $PWD/VIDEO_TS/ 2>/dev/null |grep sec|awk '{print $5}'`
        echo \#EXTINF:$SECONDS,`basename $PWD` >>index.m3u
        echo dvd://1>>index.m3u
fi

vi index.m3u

Transcode Wiki | Recent Changes | Preferences
Password required to edit | View other revisions
Last edited January 16, 2005 11:40 pm by CarlK (diff)
Search: