#!/bin/sh # Copyright (c) 2009 Dominik Kopp # This program is free software; see COPYING for details. # call programm with movies as arguments # it will create the sub folder good43 and put the converted movie there. for X in "$@" do file=`basename "$X"` path=`dirname "$X"` mkdir "$path/good43" sed -r 's/(\x00\x00\x01\xB3...)\x33/\1\x23/g' "$X" > "$path/good43/$file" # example of a MPEG2 movie: # 00 00 01 B3 2D 02 40 33 # for more information about the structure # see http://dvd.sourceforge.net/dvdinfo/mpeghdrs.html # # how the sed command works: # 's/search/replace/g' g = global and not only one # \x00 = hex code 00 # . = one character # () = group pattern and \1 for reference done