user6162407
user6162407

Reputation: 267

MP3 + JPG of same name

For every mp3 file in my folder I have a certain jpg file with the same name, what I'm trying to achieve with cmd is making that name into one variable name without the file extension

This is my code using only a mp3 name

for %%a in ("*.mp3") do ffmpeg -i "%%a.mp3" -loop 1 -i Cover.jpg -c:v libx264 -tune stillimage -c:a aac -strict experimental -b:a 320k -pix_fmt yuv420p -vf scale=3000:3000 -shortest "%%~na.mp4"

Upvotes: 1

Views: 78

Answers (1)

lit
lit

Reputation: 16266

I thought the .jpg name must match the .mp3 name. Why is Cover.jpg hardcoded?

for %%a in ("*.mp3") do ffmpeg -i "%%~na.mp3" -loop 1 ^
    -i "%%~na.jpg" ^
    -c:v libx264 -tune stillimage -c:a aac ^
    -strict experimental -b:a 320k -pix_fmt yuv420p ^
    -vf scale=3000:3000 ^
    -shortest "%%~na.mp4"

Upvotes: 1

Related Questions