is there a way to automate the output filename in a regular ".bat" ?
I sometimes do things like adding audio tracks from another video, keep the audio of the original and change the container such as:
which adds an audio track from a different video to the first video as the first audio track, keeps the original audio as a second track and changes the container to mkv.Code:"%FFMPEG%" -i "C:\Test\Video1.mp4" -i "C:\Test\Video2.mp4" -map 0:v:0 -map 1:a:1 -map 0:a:1 -c:v copy -c:a copy -f matroska "C:\Test\Video-NEW.mkv"
I would love to automate the output command so that I only have to use one command for the output which just uses the input filename as an output filename (for example Video1.mp4.mkv) instead of specifying the output path and filename every time.
Of course drag and drop cmd isn't an option for this because you can't drag 2 or even more files into a "cmd" at the same time and expect it to know which -i comes when.
Is there a clever command for this? I read through all kinds of threads such as
https://forum.videohelp.com/threads/398507-Top10-Commands-for-Lossless-Video-manipulat...e)#post2592949
https://github.com/butterw/bShaders/blob/master/test_LimitedRange/ffm4b.bat
https://manpages.ubuntu.com/manpages/xenial/en/man1/ffmpeg.1.html
https://forum.videohelp.com/threads/399797-FFMpeg-Auto-output-Name-on-bat-Script-file
but they are all only refering to the drag and drop / cmd way "%FFMPEG%" -i %INPUTFILE%
which suggests
%1%.mp4
"%~dpnx1.mp4"
"%%~nf_New.mp4"
I tried those in my bat but they usually just let it create a ".mkv" file with no output name at all.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 4 of 4
Thread
-
-
I have a template for ffmpeg batch files.
You can manipulate the output filename (in quotes). Play around with it.
Code:REM - mkdir Recode for %%a in ("*.mkv") do call :my_function "%%a" pause exit :my_function ffmpeg -i "%~1" -map 0 -vcodec copy -scodec copy -acodec ac3 -b:a 384k "Recode\%~n1.mp4" goto :eof
-
Code:
set f_name=bla_bla_bla "%FFMPEG%" -i "C:\Test\%f_name%.mp4" -i "C:\Test\Video2.mp4" -map 0:v:0 -map 1:a:1 -map 0:a:1 -c:v copy -c:a copy -f matroska "C:\Test\%f_name%.mkv"
Similar Threads
-
Drag a folder to bat to convert VOB to d2v and play in VLC?
By Desz5 in forum Newbie / General discussionsReplies: 5Last Post: 28th Aug 2022, 10:41 -
batch create concat list for ffmpeg by the drag and drop of any files?
By marcorocchini in forum Newbie / General discussionsReplies: 0Last Post: 11th Aug 2022, 09:05 -
youtube-dl FFmpeg script drag drop paste url download convert
By vaype_naysh in forum Newbie / General discussionsReplies: 0Last Post: 20th Sep 2021, 14:12 -
FFMpeg Auto output Name on .bat Script file
By Daringbaaz in forum Newbie / General discussionsReplies: 10Last Post: 6th Dec 2020, 08:44 -
web address drag and drop no longer works, why is it?
By sommers in forum Newbie / General discussionsReplies: 3Last Post: 14th May 2020, 12:13