1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Script for converting the audio in MKV files

Discussion in 'Convert DVD to another format' started by Flussig, Jul 20, 2013.

  1. Flussig

    Flussig Member

    May 25, 2004
    Likes Received:
    Trophy Points:
    Hi there

    I have a popcorn hour a-300 and currently there is a bug in the firmware that crashes the unit if a MKV or MP4 file is played with the AAC sound encoding.
    There doesn't seem much hope of the clowns at support to fix it and it would appear they have dropped support for the unit in favour of the top line products.

    Currently i have been manually using DS Mux to change the audio to MP3 but this is can be cumbersome.

    Is there anyway to automate this process, maybe a batch file of something?

  2. attar

    attar Senior member

    Jun 17, 2005
    Likes Received:
    Trophy Points:
    I've used the following to convert mkv audio to mp3.
    Use at your own risk - use copies of the source videos else all will end in tears.
    I don't use mp4, but guess that subsituting mp4 for mkv in the bat file would work.
    Assumes that a folder 'c:\bin' exists that contains ffmpeg.exe and this bat file.
    Also assumes that copies of the mkv files to be processed are also in the 'c:\bin' folder
    Assumes that the folder c:\bin\out' exists for storing the processed files.
    The processed files in the 'out' folder have _ appended to the name eg 'file1.mkv' is saved as'file1_.mkv'.
    It is then renamed to the same name as the original in the bin folder 'file1.mkv'
    The source file in 'bin' is deleted.
    The command line retains the original video and subtitles,the audio is conveted to mp3.

    @echo off
    for %%a in ("*.mkv") do call :go_now "%%a"
    if %%a not==("*.mkv") goto eof
    echo processing %~n1.mkv
    ffmpeg -i "%~dpn1.mkv" -vcodec copy -scodec copy -acodec libmp3lame -ab 128k  "%~dpn1_.mkv"
    move "%~dpn1_.mkv" c:\bin\out\
    cd c:\bin\out
    ren  "%~dpn1_.mkv" "%~n1.mkv"
    cd c:\bin
    del /q "%~dpn1.mkv"

Share This Page