Skip to content

Instantly share code, notes, and snippets.

@walduino
Last active April 17, 2016 23:49
Show Gist options
  • Save walduino/699daa467d8924ed1eeecae9a457e043 to your computer and use it in GitHub Desktop.
Save walduino/699daa467d8924ed1eeecae9a457e043 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "Paste transport stream URL (ending in ts) followed by [ENTER]:"
echo "EXAMPLE: http://vod.streamcloud.be/vier_vod/mp4:_definst_/terugnaareigenland/s1/160224_onlineclip1.mp4/media_w378815682_0.ts"
read url
url_pt=$(echo $url | sed -e 's/[^_]*$//g')
for i in `seq 1 9999`; do
echo $url_pt$i".ts"
wget $url_pt$i".ts"
if [ $? -ne 0 ]; then
break
fi
done
for f in `ls -rt *.ts`; do
echo "file '"$f"'" >> ffmpeg_list.txt
done
ffmpeg -f concat -i ffmpeg_list.txt -c copy -bsf:a aac_adtstoasc out.mp4
rm *.ts
rm ffmpeg_list.txt
rm wget_list.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment