Code: Select all
file 'path/1.mp4'
file 'path/2.mp4'
file 'path/3.mp4'
file 'path/4.mp4'
file 'path/5.mp4'
Code: Select all
1.mp4
2.mp4
3.mp4
4.mp4
5.mp4
Here is a function that does the processing automatically:
Code: Select all
fflist() {
selected_file="$1"
# return with error code 1 if no file selected
if [ "$1" == "" ]; then echo "No file selected."; return 1;fi
echo "Creating concatinated video from: $selected_file"
# sort file names and filter out blank lines
sort "$selected_file" |grep -v "^$" >> $selected_file.sorted
mv "${selected_file}.sorted" "$selected_file"
if [[ $(head -n 1 $selected_file) == "file '"* ]]; then return 1; fi # return if file already modified
sed -i -r "s/([^#]+)/file '\1'/g" "$selected_file"; # make file list digestable for ffmpeg concat, exclude comments with "#"
}