0

I am working on a batch conversion process where I need to add a random picture (a .jpg) on a random .mp3 and make an .mp4 .

This is the code I am using in terminal Mac OS X putting all the .mp3 and the .jpg in the same folder:

for f in *.mp3; do /usr/local/Cellar/ffmpeg/4.1_1/bin/ffmpeg -r 1 -loop 1 -i abc5.jpg  -i "$f" -c:a copy -c:v libx264 -vf scale=1280:720 -shortest "${f%mp3}mp4"; done

It works great, but I don't know how to add another random feature for the .jpg files, so every time I have to put a different .jpg and change name (usually in the file not in the script). I also know this must be something with for ((..., but I don't know how to add it properly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.