So, I have a folder "C:\Original" with a few dozens mp4 files.
What I would like to do is :
1) batch demux only their audio streams to "C:\Original\downres\", without changing the original name.
So for example "C:\Original\somefile.mp4" yields "C:\Original\downres\somefile.aac"
2) batch mux every pair of *.aac and corresponding *.264 files found in the folder "C:\Original\downres\"
Example : "C:\Original\downres\randomxyz.aac" and "C:\Original\downres\randomxyz.264" are muxed to "C:\Original\downres\randomxyz.mp4"
I hope that makes sense, I would prefer two separate bat files if that's possible.
+ Reply to Thread
Results 1 to 4 of 4
-
-
Batch audio extraction is easy with ffmpeg. Create a folder called "downres" in the same directory as your mp4 files, then simply dag the first mp4 into this bat file:
Code:for %%a in ("*.mp4") do "path\to\ffmpeg" -i %%a -vn -c:a copy -y downres\%%~na.m4a pause # this script extracts audio track only
Got my retirement plans all set. Looks like I only have to work another 5 years after I die........ -
Try
1.
Code:for %%a in ("C:\Original\*.mp4") do ffmpeg -i "c:\Original\%%a" -vn -acodec copy "c:\Original\downres\%%~na.aac" pause
Code:for %%a in ("C:\Original\downres\*.aac") do ffmpeg -i "c:\Original\downres\%%~na.264" -i "c:\Original\downres\%%~na.aac" -vcodec copy -acodec copy "c:\Original\downres\%%~na.mp4" pause
See also https://forum.videohelp.com/threads/356314-How-to-batch-convert-multiplex-any-files-with-ffmpeg -
Thank you both very much, racer-x and Baldrick, the scripts worked like a charm. I'm very impresssed