VideoHelp Forum
+ Reply to Thread
Results 1 to 8 of 8
Thread
  1. Hi,

    I'm looking for a way to run a script file in folder that contains mkv files and copy the video and subtitles and everything else as is except the audio, convert it to AC3, and saving the new files in the same name using ffmpeg.

    FOR %%f IN (*.mkv) DO C:\Users\ConvertDTStoAC3\ffmpeg\bin\ffmpeg.exe -i %%f -map 0 -vcodec copy -scodec copy -acodec ac3 -b:a 640k “%%~dpnf-AC3.mkv"
    the issue I'm facing is when I open the bat file is just open and closes immediately.
    Quote Quote  
  2. Try without quotes ( " )

    Code:
    FOR %%f IN (*.mkv) DO C:\Users\ConvertDTStoAC3\ffmpeg\bin\ffmpeg.exe -i %%f -map 0 -vcodec copy -scodec copy -acodec ac3 -b:a 640k %%~dpnf-AC3.mkv
    責任者-MDX
    Quote Quote  
  3. Originally Posted by sekininsha View Post
    Try without quotes ( " )

    Code:
    FOR %%f IN (*.mkv) DO C:\Users\ConvertDTStoAC3\ffmpeg\bin\ffmpeg.exe -i %%f -map 0 -vcodec copy -scodec copy -acodec ac3 -b:a 640k %%~dpnf-AC3.mkv
    The same issue
    Quote Quote  
  4. FOR %%f IN (*.mkv) DO C:\Users\ConvertDTStoAC3\ffmpeg\bin\ffmpeg.exe -i "%%f" -map 0 -vcodec copy -scodec copy -acodec ac3 -b:a 640k “%%~dpnf-AC3.mkv"

    The mkv filenames maybe contains spaces.
    Quote Quote  
  5. you used a different type of opening and closing quotation mark (“ %%~dpnf-AC3.mkv ") (“” / "" (valid))

    also check the filenames as it suggests ProWo ..

    I recommend applying 'pause' to the end of the script ... so the cmd window stays open and shows you where the error ..

    Code:
    FOR %%f IN (*.mkv) DO C:\Users\ConvertDTStoAC3\ffmpeg\bin\ffmpeg.exe -i %%f -map 0 -vcodec copy -scodec copy -acodec ac3 -b:a 640k %%~dpnf-AC3.mkv
    pause
    責任者-MDX
    Quote Quote  
  6. Originally Posted by sekininsha View Post
    you used a different type of opening and closing quotation mark (“ %%~dpnf-AC3.mkv ") (“” / "" (valid))

    also check the filenames as it suggests ProWo ..

    I recommend applying 'pause' to the end of the script ... so the cmd window stays open and shows you where the error ..

    Code:
    FOR %%f IN (*.mkv) DO C:\Users\ConvertDTStoAC3\ffmpeg\bin\ffmpeg.exe -i %%f -map 0 -vcodec copy -scodec copy -acodec ac3 -b:a 640k %%~dpnf-AC3.mkv
    pause

    Oh god what a silly mistake
    Thank you so much, it was diving me crazy.
    Quote Quote  
  7. Originally Posted by ProWo View Post
    FOR %%f IN (*.mkv) DO C:\Users\ConvertDTStoAC3\ffmpeg\bin\ffmpeg.exe -i "%%f" -map 0 -vcodec copy -scodec copy -acodec ac3 -b:a 640k “%%~dpnf-AC3.mkv"

    The mkv filenames maybe contains spaces.
    Thank you so much man! I also needed the guy below you to notice the different quote mark, but even after that I couldn't get this to work until I removed spaces from source files. I appreciate the hell out of you taking the time to answer questions like these. Even years later could come in handy. Thanks again!
    Quote Quote  
  8. Originally Posted by sekininsha View Post
    you used a different type of opening and closing quotation mark (“ %%~dpnf-AC3.mkv ") (“” / "" (valid))

    also check the filenames as it suggests ProWo ..

    I recommend applying 'pause' to the end of the script ... so the cmd window stays open and shows you where the error ..

    Code:
    FOR %%f IN (*.mkv) DO C:\Users\ConvertDTStoAC3\ffmpeg\bin\ffmpeg.exe -i %%f -map 0 -vcodec copy -scodec copy -acodec ac3 -b:a 640k %%~dpnf-AC3.mkv
    pause
    Thank you so much man! I also needed the guy above you to know to remove spaces in source file, but even with that I needed to correct that Quotation mark from OP's script.

    I appreciate the hell out of you taking the time to answer questions like these. Even years later could come in handy. Thanks again!
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!