Hi, noob here. Any help is appreciated!
I have a bunch of m4v and m4a files that I'd like batch mux together.
Currently I'm using the following logic in Window's command line:
ffmpeg -i "input-video.m4v" -i "input-audio.m4a" -c:v copy -c:a copy "output-video.mp4"
So for example, I slowly convert one video at a time, using the replace text feature in notepad++:
"C:\tools\ffmpeg-4.3.1-2020-11-19-full_build\bin\ffmpeg.exe" -i "replace-me!.m4v" -i "replace-me!.m4a" -c:v copy -c:a copy "replace-me!.mp4"
I was thinking this process could be much faster if I knew how to batch convert together everything at once, maybe like whatever the variable for any filename is (*.m4v, *.m4a?) or a batch script file, so that I don't have to specify and mux each video one by one.
LosslessCut (https://github.com/mifi/lossless-cut/) should be able to do that with a GUI ;)
I can easily handle multiple streams and remux them. Awesome program and free!
You mean a Windows batch? It should be fairly easy.
Just find an example for a FOR loop to loop through the m4v files in your directory.
And you need to know how to remove the extension, to replace m4v to m4a. The same goes for mp4 output.
Some useful examples: https://stackoverflow.com/questions/3215501/batch-remove-file-extension
So, something like this:
for %%f in (*.m4v) do (
echo "C:\tools\ffmpeg-4.3.1-2020-11-19-full_build\bin\ffmpeg.exe" -i "%%~nf.m4v" -i "%%~nf.m4a" -c:v copy -c:a copy "%%~nf.mp4"
I've added an echo so it will only show what it will do, without executing anything.
Remove the echo, if you believe it will work correctly.