Hi,
I'd like to learn how to transform this (ffmpeg command) :
ffmpeg -c:v h264_cuvid -i 891.mkv -c:v hevc_nvenc -map 0 -rc vbr -cq 29 -qmin 29 -qmax 29 -tag:v hvc1 891-x265.mkv
AND this (cmd command) :
"C:\Program Files\MKVToolNix\mkvmerge.exe" --ui-language fr --priority lower --output ^"C:\Users\kngw\Desktop\test\891-x265-finished.mkv^" --language 0:ja --display-dimensions 0:1920x1080 --chroma-siting 0:1,2 --color-range 0:1 --language 1:fr --default-track-flag 1:no --language 2:ja --default-track-flag 2:yes --sub-charset 3:UTF-8 --language 3:fr --track-name 3:Forced --default-track-flag 3:no --sub-charset 4:UTF-8 --language 4:fr --track-name 4:Full --default-track-flag 4:yes ^"^(^" ^"C:\Users\kngw\Desktop\testo\891-x265.mkv^" ^"^)^" --title "" --track-order 0:0,0:2,0:1,0:4,0:3
into a batch file.
I can execute the two commands in a row for this file, it is working.
But I'd like to use these two commands to make a batch in order to take all the files in a folder called "Original" which is composed of 1033 videos named "1.mkv" up to "1033.mkv" and to execue both commands on these, then put them on a "Export" folder.
(Currently these commands put the new files in the same folder, so I need to make a batch file which export to another folder)
I'm a newbie so maybe it's easy, I don't really know how everything works.
+ Reply to Thread
Results 1 to 9 of 9
-
-
Check if this works:
Code:for /R D:\Original %%i in (*.mkv) do ffmpeg -c:v h264_cuvid -i %%i -c:v hevc_nvenc -map 0 -rc vbr -cq 29 -qmin 29 -qmax 29 -tag:v hvc1 "%%~pi%%~ni-x265.mkv"
-
-
Try this - create the .cmd file, place a shortcut for it on the desktop, and then just drag&drop input files on it (but set ffmpeg path properly)
Code:@echo off SETLOCAL ENABLEEXTENSIONS set t0=%TIME%, %DATE% for %%F in (%*) do call :main %%F goto finalmessage :main SetLocal echo ----------------------------------------------------------------------------------- echo. Processing file: %~f1 echo. set "newdir=Export" if not exist "%~dp1\%newdir%" mkdir "%~dp1\%newdir%" " ffmpeg path here" -c:v h264_cuvid -i "%~f1" -c:v hevc_nvenc -map 0 -rc vbr -cq 29 -qmin 29 -qmax 29 -tag:v hvc1 "%~dp1\%newdir%\%~n1-x265.mkv" "C:\Program Files\MKVToolNix\mkvmerge.exe" --ui-language fr --priority lower --output "%~dp1\%newdir%\%~n1-x265-finished.mkv" --language 0:ja --display-dimensions 0:1920x1080 --chroma-siting 0:1,2 --color-range 0:1 --language 1:fr --default-track-flag 1:no --language 2:ja --default-track-flag 2:yes --sub-charset 3:UTF-8 --language 3:fr --track-name 3:Forced --default-track-flag 3:no --sub-charset 4:UTF-8 --language 4:fr --track-name 4:Full --default-track-flag 4:yes "%~dp1\%newdir%\%~n1-x265.mkv" --title "" --track-order 0:0,0:2,0:1,0:4,0:3 EndLocal goto :eof :finalmessage powershell write-host -fore cyan ======================== Processing is FINISHED ========================= echo ---------------------------- echo Batch processing start time: %t0% echo Batch processing end time: %TIME%, %DATE% echo ---------------------------- pause
-
-
Last edited by kngw; 30th Sep 2022 at 02:35.
-
I don't want to keep the "-x265" files (not the one with -finished), how can I edit the code to delete them
Code:"mkvtoolnix string ...." del "%~dp1\%newdir%\%~n1-x265.mkv"
Similar Threads
-
Get the complete FFmpeg command line when using FFmpeg Batch Converter
By pascor in forum Newbie / General discussionsReplies: 8Last Post: 13th May 2021, 23:14 -
Simple FFmpeg Batch File Command
By Axel Slingerland in forum Video ConversionReplies: 6Last Post: 6th Jul 2020, 12:36 -
how to change language video and audio in batch with mkvtoolnix in cmd
By pawelaut in forum Newbie / General discussionsReplies: 2Last Post: 15th Feb 2020, 14:20 -
Create batch file for ffmpeg to increment the file output
By Bassquake in forum Video ConversionReplies: 2Last Post: 25th Nov 2019, 05:03 -
FFmpeg does not convert file through command line
By Vidikon in forum Newbie / General discussionsReplies: 2Last Post: 5th Jun 2019, 02:13