Hi sorry if this has already been asked but ive got intro.mp4 and over 1000 mp4 in another folder what i need is intro.mp4 to be added to every mp4 in folder im using ubuntu whats the best way to do this.
all the mp4 have the same encoding
ffmpeg -i intro.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i 1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy output.mp4
this command words for one at a time this my attempt at batch but the var doesnt work
for f in *.mp4; do ffmpeg -i "$f" -c copy -bsf:v h264_mp4toannexb -f mpegts "$f.ts"; done
this code works fine
for i in *.mp4;
do
test="concat:intro.mp4.ts|"${i%.*}".mp4.ts";
ffmpeg -i "$test" -c copy anime2/"${i%.mp4}.mp4"; done
Got it working with these 2 commands did the whole batch in one script
for f in *.mp4; do ffmpeg -i "$f" -c copy -bsf:v h264_mp4toannexb -f mpegts "$f.ts"; done
for i in *.mp4;
do
test="concat:intro.mp4.ts|"${i%.*}".mp4.ts";
ffmpeg -i "$test" -c copy anime2/"${i%.mp4}.mp4"; done
thank you
ffprobe -v error -show_streams 1.mp4
. I should have asked for that previously instead of theffmpeg
output.