This is a script I have for demuxing an H264 AAC MKV and normalizing the audio then remuxing it:
Does anyone have a script to do the same as the above but for a x265 video?for %%a in ("*.mkv") do (
"X:\Portable Installations\MKV Toolnix\mkvextract.exe" --ui-language en tracks "%%a" 0:"%%~na.h264" 1:"%%~na.gain0"
for %%b in ("*.gain0") do "X:\Portable Installations\ffmpeg\bin\ffmpeg.exe" -i "%%b" -vn -c:a copy -absf aac_adtstoasc "J:\Temp\gain.m4a"
"X:\Portable Installations\AAC Gain 1.9\aacgain.exe" -r -k -m 0 "J:\Temp\gain.m4a"
"X:\Portable Installations\ffmpeg\bin\ffmpeg.exe" -i "J:\Temp\gain.m4a" -map 0:0 -vn -c:a copy "%%~da%%~pa%%~na.aac"
"X:\Portable Installations\MKV Toolnix\mkvmerge.exe" -o "%%~da%%~pa%%~na.AAC.mkv" "--forced-track" "0:no" "-d" "0" "-A" "-S" "-T" "--no-global-tags" "--no-chapters" "(" "%%~na.h264" ")" "--language" "0:eng" "--forced-track" "0:no" "-a" "0" "-D" "-S" "-T" "--no-global-tags" "--no-chapters" "(" "%%~da%%~pa%%~na.aac" ")" "--track-order" "0:0,1:0"
del "*.gain0"
del "*.h264"
del "*.aac"
del "J:\Temp\gain.m4a"
)
"X:\Daves Folder\Sounds\VideoRedo Completed Sound Short.WAV"
pause
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 6 of 6
Thread
-
-
The same script should work for HEVC AAC MKV if it works for H.264 AAC MKV. (mkvmerge and mkvextract will ignore the .h264 file extension and detect it's actually HEVC)
-
I haven't actually tested the script. But I see things that could pose problems. For example the outer for loop uses parentheses. Then there are parentheses within the loop but they aren't escaped.
In the other thread you mentioned you want FLAC output. Is this also the case for these files? If you want FLAC output anyways I could give you a much simpler script. -
if it once worked, dont know. I would change h264 to h265, even it seems like nonsense. But if it worked before (already said) why it shouldn't work now?
Sorry to said it, sneaker is expert on scripts, i don't like them much, but as said, parenthesis worked before so should now. Why not?
Bernix -
The script is obviously copied-and-pasted from somewhere, without comprehension.
The mkvmerge line seems completely corrupted, with all arguments wrapped in quotes.
Parentheses are matched, but some have been inserted in the mkvmerge line that aren't needed.
Reformatting for readability (but not attempting to run),Code:set mkvextract="X:\Portable Installations\MKV Toolnix\mkvextract.exe" set mkvmerge="X:\Portable Installations\MKV Toolnix\mkvmerge.exe" set ffmpeg="X:\Portable Installations\ffmpeg\bin\ffmpeg.exe" set aacgain="X:\Portable Installations\AAC Gain 1.9\aacgain.exe" set tempx=J:\Temp for %%a in ("*.mkv") do ( %mkvextract% --ui-language en ^ tracks "%%a" 0:"%%~na.h264" 1:"%%~na.gain0" for %%b in ("*.gain0") do ^ %ffmpeg% -i "%%b" -vn -c:a copy ^ -absf aac_adtstoasc "%tempx%\gain.m4a" %aacgain% -r -k -m 0 "%tempx%\gain.m4a" %ffmpeg% -i "%tempx%\gain.m4a" ^ -map 0:0 -vn -c:a copy "%%~da%%~pa%%~na.aac" :: %mkvmerge% & :: -o "%%~da%%~pa%%~na.AAC.mkv" "--forced-track" "0:no" ^ :: "-d" "0" "-A" "-S" "-T" "--no-global-tags" ^ :: "--no-chapters" "(" "%%~na.h264" ")" ^ :: "--language" "0:eng" "--forced-track" "0:no" "-a" "0" "-D" "-S" "-T" ^ :: "--no-global-tags" "--no-chapters" "(" "%%~da%%~pa%%~na.aac" ")" ^ :: "--track-order" "0:0,1:0" mkvmerge -o "%%~da%%~pa%%~na.AAC.mkv" --forced-track 0:no ^ -d 0 -A -S -T --no-global-tags ^ --no-chapters "%%~na.h264" ^ --language 0:eng --forced-track 0:no -a 0 -D -S -T ^ --no-global-tags --no-chapters "%%~da%%~pa%%~na.aac" ^ --track-order 0:0,1:0 del "*.gain0" del "*.h264" del "*.aac" del "%tempx%\gain.m4a" )
Last edited by raffriff42; 21st Jan 2018 at 10:42. Reason: typo
Similar Threads
-
FFMPEG - Looking for simple batch script to convert entire folder
By steptoe in forum Video ConversionReplies: 6Last Post: 20th Mar 2017, 22:49 -
Need help with ffmpeg script to batch convert audio in MKV files
By mikeveli20 in forum AudioReplies: 5Last Post: 18th Nov 2016, 13:21 -
Batch stabilize script for ffmpeg
By racer-x in forum Video ConversionReplies: 20Last Post: 2nd Jun 2016, 17:10 -
Can I get a little help with an ffmpeg script/batch file?
By Iced Coffee in forum Newbie / General discussionsReplies: 14Last Post: 26th Aug 2015, 01:56 -
batch script that remux multiple movies and subtitles together to mkv file
By galiber12 in forum SubtitleReplies: 2Last Post: 16th Jan 2015, 16:38