Been using ffmpeg and a bat file I came across to convert DTS to AAC audio - which works.
Now I want to merge the subs from the source into the new file without encoding and I can't quite figure how to modify the bat.
Here's the ffprobe data (edited) .
-and the bat file.Input #0, matroska,webm, from 'who.mkv':
Stream #0:0(eng): Video: h264 (High), yuv420p(progressive), 1280x720, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 1k tbn, 50 t
bc (default)
Stream #0:1(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s (default)
Stream #0:2(eng): Subtitle: dvd_subtitle, 1280x720 (default)
Code:REM convert DTS audio to aac @echo off for %%F IN (*.mkv) do ( echo * %%~nF.mkv echo. ffmpeg -i %%~nF.mkv -c:a pcm_s16le -f wav - | neroAacEnc -if - -ignorelength -of %%~nF.aac echo. echo * Merging new AAC audio into MKV ffmpeg -i %%~nF.mkv -i %%~nF.aac -c:v copy -c:a copy -map 0:v:0 -map 1:a:0 %%~nF.AAC.mkv echo. rem pause echo * Removing temporary file del %%~nF.aac ) echo. echo * All Finished :exit pause
+ Reply to Thread
Results 1 to 5 of 5
-
-
Code:
-c:v copy -c:a copy
Code:-c:s copy
https://www.ffmpeg.org/ffmpeg-all.html
Cu Selurusers currently on my ignore list: deadrats, Stears555, marcorocchini -
Thank you for the suggestions.
If I used the 'copy' commands without 'map', the new audio wasn't muxed into the output.
After stumbling around I changed the command thus:
Code:ffmpeg -i %%~nF.mkv -i %%~nF.aac -c:v copy -c:s copy -c:a copy -map 0:v:0 -map 0:s:0 -map 1:a:0 %%~nF.AAC.mkv
ffmpeg listed the following after muxing - which has me baffled:
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:2 -> #0:1 (copy)
Stream #1:0 -> #0:2 (copy)
Input #0, matroska,webm, from 'who.mkv':
Stream #0:0(eng): Video: h264 (High), yuv420p(progressive), 1280x720, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 1k tbn, 50 t
bc (default)
Stream #0:1(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s (default)
Stream #0:2(eng): Subtitle: dvd_subtitle, 1280x720 (default) -
try:
Code:ffmpeg -i %%~nF.mkv -i %%~nF.aac -c:v copy -c:s copy -c:a copy -map 0:v -map 1:a -map 0:s %%~nF.AAC.mkv
Code:ffmpeg -i %%~nF.mkv -i %%~nF.aac -c:v copy -c:s copy -c:a copy -map 0 -map -0:a -map 1:a %%~nF.AAC.mkv
Cu Selurusers currently on my ignore list: deadrats, Stears555, marcorocchini
Similar Threads
-
[ffmpeg] merge two audio track with delay
By FXMkD in forum ProgrammingReplies: 6Last Post: 1st Nov 2021, 08:35 -
Does YT-DLP or FFMPEG Merge The Raw Encrypted Fragments
By SoConfused in forum Video Streaming DownloadingReplies: 1Last Post: 14th Jun 2021, 16:21 -
batch merge videos and audios with ffmpeg
By m0ck in forum Video ConversionReplies: 6Last Post: 27th May 2021, 08:12 -
merge video ffmpeg problem
By lomero in forum Video ConversionReplies: 11Last Post: 16th Apr 2021, 07:17 -
[solved] Merge two videoes with different resolution and bitrates - ffmpeg
By parvares in forum Newbie / General discussionsReplies: 3Last Post: 11th Apr 2021, 08:55