Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- set -euxo pipefail
- cd "$(dirname -- "$(readlink -f -- "$0")")"
- find . -type f -name 'twitcast*.ts' -print0 |
- while IFS= read -r -d '' ts_file; do
- if [ -f "${ts_file%.*}.mp4" ]; then
- continue
- fi
- if MP4Box -add "$ts_file" "${ts_file%.*}.mp4"; then
- touch -r "$ts_file" "${ts_file%.*}.mp4"
- rm "$ts_file"
- else
- rm -f "${ts_file%.*}.mp4"
- echo "MP4Box errored!"
- exit 1
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement