Here's my idea. I have a video file that needs to be combined with all mp3 files in a specific folder, creating multiple instances of that same video, but with different audio tracks. The combining happens thanks to FFmpeg module that is able to take any video and glue it with any sound. The previous script that I used only combined video and audio files based on the same name. That means a video can only be combined with one audio that has exactly the same name as video, which isn't what I want this time. The previous code was this:
Code: Select all
set CONTENT=C:\MyProject set PROGRAM=%ProgramFiles%\ffmpeg\bin\ffmpeg.exe for %%a IN ("%CONTENT%\SOURCE\*.mp4") ^ do "%PROGRAM%" -i "%%a" -i "%PROGRAM%\SOURCE\%%~na.mp3" -map 0:v -map 1:a -c ^ copy "%CONTENT%\YOUTUBE\%%~na.mp4"
Actually, the perfect representation of this concept would be: if I have two video files called rabbit.mp4 and elephant.mp4, and a bunch of rabbits and elephants in mp3 (each followed by a consecutive number), then running this batch would create as many rabbits and elephants, as there are mp3 files (with a correct video track, of course). And the resulting filenames would be the same as the mp3 files used.
It would be super cool if this batch could consider just the letters (and ignore the numeric differences) to combine rabbit vids with rabbit audios, and elephant vids with elephant audios. If it's impossible to do, I could settle for splitting rabbits and elephants by folders. Basically, coding a batch that takes an mp4 file and with a help of FFmpeg combines it with each mp3 file in some folder, then outputs the resulting mp4 file under the name of mp3 file.
Is this something that .BAT file can handle? Again, thanks a ton for claryfying this to me!