Hi.
I'm currently using this script to convert the audio of my mkv video files. What would I need to change so that only the subtitles flagged as english remain after the conversion?
Thank you.Code:for %%a in (*.mkv) do ffmpeg -y -i "%%a" -map 0 -c:v copy -c:a ac3 -b:a 640k -c:s copy "output_%%~na.mkv"
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 17 of 17
Thread
-
-
I think this:
Code:for %%a in (*.mkv) do ffmpeg -y -i "%%a" -map 0:v -map 0:a -map 0:m:language:eng -c:v copy -c:a ac3 -b:a 640k -c:s copy "output_%%~na.mkv"
-
It worked for the subs, but for some reason it duplicated both the video track and the audio track. So the new file is twice the size of the original.
-
try edit this: '-map 0:m:language:eng' --> change the 'm' by 's'
Last edited by sekininsha; 7th Aug 2020 at 22:17.
責任者-MDX -
Both the audio and 2 subtitles tracks are flagged as 'English", I tried '0: s:language:english', it still says no match. It's odd because it works with "0:m:language:eng", only the english subtitles remained, but the audio and video duplicated.
The report says, path to input: No such file or directory. -
First maybe I can try to select the subtitle track number instead of the language? What would it be in the script if the only track I need is number 4?
-
@jagabo: Strange, but I figured it out! I removed the extra "-map 0:v" and "-map 0:a" and it worked perfectly, no duplicates!
So the script is:
Code:for %%a in (*.mkv) do ffmpeg -y -i "%%a" -map 0:m:language:eng -c:v copy -c:a ac3 -b:a 640k -c:s copy "output_%%~na.mkv"
-
Weird. When I run your batch file I get an output file with no video or audio. Only English subs and chapters.
I have ffmpeg version 4.2.2, about six months old. -
Hi! you can modify the script like this:
Code: for %%a in (*.mkv) do ffmpeg -y -i ""%%a"" -map 0 -c:v copy -c:a ac3 -b:a 640k -map 0:0 -map 0:1 -c copy -metadata:0 language=eng -metadata:1 language=eng ""output_%%~na.mkv""
By specifying ""-map 0:0"" and ""-map 0:1"", you're selecting the first and second subtitle streams, respectively. I also id that to watch my series with subtitles, as I'm currently learning English and preparing for IELTS. I also use https://practicalielts.com/ielts/ultimate-ielts-guide/ to prepare better. Series is just another fun way to learn a new language.Last edited by Samangel; 14th Jul 2023 at 04:56.
Similar Threads
-
Resize MP4 video with ffmpeg and keeping aspect ratio?
By pxstein in forum Video ConversionReplies: 1Last Post: 18th Apr 2020, 14:33 -
FFMPEG - Replacing a video stream, while keeping all other streams the same
By vandalay22 in forum Video Streaming DownloadingReplies: 4Last Post: 11th Nov 2019, 10:41 -
How to specify/map English only subs in ffmpeg
By wallywalters in forum Video ConversionReplies: 4Last Post: 9th Oct 2018, 12:04 -
Keeping subtitles in DVD conversion
By RBTO in forum SubtitleReplies: 1Last Post: 18th Jul 2016, 11:15 -
MPC always defaults to English subtitles
By Starbuck1991 in forum SubtitleReplies: 1Last Post: 10th Apr 2016, 13:08