Created
August 5, 2022 00:21
-
-
Save Roninkoi/0153cffc3d41d7ad80e9b02d76ddfa0b to your computer and use it in GitHub Desktop.
Revisions
-
Roninkoi created this gist
Aug 5, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ #!/bin/sh # Download series .ts files and concatenate into mp4 using ffmpeg # Usage: tsdl <url> <file prefix i.e. prefix_0.ts> if [ $# != 2 ]; then echo "Usage: tsdl <url> <file prefix i.e. prefix_0.ts>" exit fi echo "ffconcat version 1.0" > tsdl_list.txt i=0 n=1000 url=$1 files=$2 while [ $i -lt $n ]; do file=${files}_$i.ts wget ${url}${file} || break echo "file ${file}" >> tsdl_list.txt i=$((i+1)) done ffmpeg -f concat -i tsdl_list.txt -c copy tsdl_out.mp4 rm $(grep file tsdl_list.txt | awk '{print $2}') rm tsdl_list.txt