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

    Joined:
    May 25, 2004
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    11
    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?

    Cheers
     
  2. attar

    attar Senior member

    Joined:
    Jun 17, 2005
    Messages:
    11,504
    Likes Received:
    29
    Trophy Points:
    128
    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.


    Code:
    @echo off
    for %%a in ("*.mkv") do call :go_now "%%a"
    if %%a not==("*.mkv") goto eof
    
    :go_now
    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