]> code.delx.au - transcoding/blob - identify-disc
avconv -> ffmpeg
[transcoding] / identify-disc
1 #!/bin/bash
2
3 if [ -z "$1" -o -z "$2" ]; then
4 echo "Usage: $0 --bluray-device|--dvd-device SOMEDIRECTORY"
5 exit 1
6 fi
7
8 device_param="$1"
9 device_path="$2"
10 if [ "$device_param" = "--bluray-device" ]; then
11 device_param="-bluray-device"
12 device_scheme="bluray"
13 elif [ "$device_param" = "--dvd-device" ]; then
14 device_param="-dvd-device"
15 device_scheme="dvd"
16 else
17 echo "Unknown device type: $device_param"
18 exit 1
19 fi
20
21 mplayer 2> /dev/null \
22 -noconfig all \
23 -quiet \
24 -ao null \
25 -vo null \
26 -frames 0 \
27 -identify \
28 "$device_param" "$device_path" \
29 "${device_scheme}://" | \
30 sed -e 's/ID_\(DVD\|BLURAY\)_TITLE_\([0-9]*\)*_LENGTH=\(.*\)$/\2 \3/;tx;d;:x' | \
31 sort -n
32