VideoHelp Forum

+ Reply to Thread
Results 1 to 6 of 6
Thread
  1. Does anyone have a batch script for windows that will use ffmgeg to find the matching subtitles of multiple video files in one directory then remux the matching .srt files into the corresponding video files.

    As you can see in the image below I simply need a batch script that will remux all the matching .srt file into the same video into a separate sub-folder.

    Click image for larger version

Name:	MowJC7h.jpg
Views:	57
Size:	310.9 KB
ID:	57937

    Thanks for any help!!
    Quote Quote  
  2. Copy the text below and paste it into a batch job. Assume your ffmpeg is either in your path or the working directory,

    Code:
    if not exist muxed md muxed
    for %%g in (*.mkv) do (
    ffmpeg -i %%g -i %%~ng.srt -c copy muxed\%%g
    )
    Quote Quote  
  3. Originally Posted by videobruger View Post
    Copy the text below and paste it into a batch job. Assume your ffmpeg is either in your path or the working directory,

    Code:
    if not exist muxed md muxed
    for %%g in (*.mkv) do (
    ffmpeg -i %%g -i %%~ng.srt -c copy muxed\%%g
    )
    That is absolutely perfect. I worked like a charm, as do all your snippets.
    Quote Quote  
  4. Originally Posted by videobruger View Post
    Copy the text below and paste it into a batch job. Assume your ffmpeg is either in your path or the working directory,

    Code:
    if not exist muxed md muxed
    for %%g in (*.mkv) do (
    ffmpeg -i %%g -i %%~ng.srt -c copy muxed\%%g
    )
    I seem to be having a small issue with this script. When the video file has two audio tracks this script will strip the second audio track out.

    Not sure why...
    Quote Quote  
  5. Member
    Join Date
    Feb 2006
    Location
    United States
    Search Comp PM
    Originally Posted by agon024 View Post
    Originally Posted by videobruger View Post
    Copy the text below and paste it into a batch job. Assume your ffmpeg is either in your path or the working directory,

    Code:
    if not exist muxed md muxed
    for %%g in (*.mkv) do (
    ffmpeg -i %%g -i %%~ng.srt -c copy muxed\%%g
    )
    I seem to be having a small issue with this script. When the video file has two audio tracks this script will strip the second audio track out.

    Not sure why...
    try this here - https://video.stackexchange.com/questions/21734/ffmpeg-video-conversion-with-multiple-audio-tracks
    Quote Quote  
  6. Change the batch file to

    Code:
    if not exist muxed md muxed
    for %%g in (*.mkv) do (
    ffmpeg -i %%g -i %%~ng.srt -c copy -map 0 -map 1 muxed\%%g
    )
    Quote Quote  



Similar Threads