| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# Copyright (c) 2009 Dominik Kopp |
| 4 |
# This program is free software; see COPYING for details. |
| 5 |
|
| 6 |
|
| 7 |
# call programm with movies as arguments |
| 8 |
# it will create the sub folder good169 and put the converted movie there. |
| 9 |
|
| 10 |
for X in "$@" |
| 11 |
do |
| 12 |
|
| 13 |
file=`basename "$X"` |
| 14 |
path=`dirname "$X"` |
| 15 |
|
| 16 |
mkdir "$path/good169" |
| 17 |
|
| 18 |
sed -r 's/(\x00\x00\x01\xB3...)\x23/\1\x33/g' "$X" > "$path/good169/$file" |
| 19 |
# example of a MPEG2 movie: |
| 20 |
# 00 00 01 B3 2D 02 40 23 |
| 21 |
# for more information about the structure |
| 22 |
# see http://dvd.sourceforge.net/dvdinfo/mpeghdrs.html |
| 23 |
# |
| 24 |
# how the sed command works: |
| 25 |
# 's/search/replace/g' g = global and not only one |
| 26 |
# \x00 = hex code 00 |
| 27 |
# . = one character |
| 28 |
# () = group pattern and \1 for reference |
| 29 |
|
| 30 |
done |