I have a script that will concat and rename the video files in a folder which I have pieced together using tips from StackExchange.
#!/bin/bash
ls -d $PWD/* >> file.txt
sed -i "s/^|$/'/g" file.txt
sed -i -e 's_.file &' file.txt
ffmpeg -f concat -safe 0 -i file.txt -c copy ${PWD##/}.mp4
I would like to run this recursively, which would seem to involve using the find
command, but I am a little wary of messing this up and losing a load of data.
Any help would be appreciated.
ffmpeg
call(s) shall look like). However, you need only onesed
call:sed "s/.*/file '&'/"
And you should use quotes:ls -d "$PWD"/*
,"${PWD##*/}".mp4
– Hauke Laging Nov 28 '21 at 12:36ls
withfind
, and do the twosed
as first step. Then manually inspectfile.txt
. Finally runffmpeg
onfile.txt
if the manual inspection is ok. – dirkt Nov 28 '21 at 14:00