#!/bin/bash # This script takes a (vdr recording) filename as input and creates an index file for it, # but only if necessary # 1. Check if an IDX file DOES NOT exist. # 2. Run ProjectX to split the mpeg transport stream into elementary components. # 3. Run mplex to multiplex the elementary stream to MPEG PS (DVD-style mpeg) # 4. Remove all elementary streams to save space # 5. Run avidemux to create index for each fixed file # 6. When sure... remove original recording... if ! [ -f "$1.idx" ]; then avidemux --nogui --load "$1" --autoindex --quit else echo "File "$1" has an index already, skipping it." fi