VideoHelp Forum
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. I have can't seem to edit the command line in mkvmerge in "show command line" under the Multiplexer tab using the program MKVToolNix. My goal is to split an M4B audiobook file, but keep it lossless. I found the info how to do this, but need help on how to input a new command line.


    Quoted from kiumut:

    It turns out you can easily do this from the command line using MKVToolNix (specifically mkvmerge) and FFMPEG. This is in Windows; other OSes would just need to change the syntax of the "for" loop accordingly.

    This first step will split the m4b file into individual mka (Matroska audio) files at each chapter marker in the m4b. This is lossless as you are only changing from an MP4 container to a Mastroska container; the actual audio stream is not transcoded.
    Code:

    C:\> C:\path\to\mkvmerge -o output.mka --split chapters:all input.m4b

    Once you have individual mka files, you can use FFMPEG to put the audio streams back into MP4 containers, again without transcoding.
    Code:

    C:\> for %f in (*.mka) do C:\path\to\ffmpeg -i "%f" -c:a copy -vn -f mp4 "%~nf.m4b"

    This will loop through all the mka files you created and put each audio stream into an mp4 container with an m4b extension. (For those interested, "-c:a copy" copies the audio stream without transcoding, "-vn" tells FFMPEG that there will be no video stream in the output and "-f mp4" specifies an MP4 format container.)

    I know it's not sexy, but it's got teeth.

    Last I checked, MP4Box of the GPAC Framework will split at specific times and not chapter metadata just like FFMPEG. But this feature has been requested to be added to MP4Box, so maybe it will appear some time soon.
    Last edited by davidicharp; 27th Mar 2024 at 23:27.
    Quote Quote  
  2. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Run mkvmerge directly from the CMD prompt giving the command line you need
    Quote Quote  
  3. I tried what you suggested, but it only plays the .mb4 file in my music player without opening mkvmerge. I have the command written as follows:

    C:\Users\hallelujah\Music\bible\bible.m4b> C:\Program Files\MKVToolNix\mkvmerge.exe -o output.mka --split chapters:all input.m4b

    I have to run CMD as administrator for access not to be denied.
    Quote Quote  
  4. I got the M4B files to convert to mka files doing a simple step of going into output mode in multiplexer "before chapters" in split mode and "all" chapter numbers. Now I need to figure out how to convert back to mp4 using freempeg since command prompt isn't working for me.
    Quote Quote  
  5. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Originally Posted by davidicharp View Post
    I tried what you suggested, but it only plays the .mb4 file in my music player without opening mkvmerge. I have the command written as follows:

    C:\Users\hallelujah\Music\bible\bible.m4b> C:\Program Files\MKVToolNix\mkvmerge.exe -o output.mka --split chapters:all input.m4b

    I have to run CMD as administrator for access not to be denied.
    The typical reason it needs Admin is because you're trying to write into a folder that is protected.

    If you have extracted the mka files, create a folder on the desktop and move them in there.
    Download this bat file, edit it to set the path to your ffmpeg.exe

    Copy it into the folder with the mka's, double click it, and it will created the m4b's
    https://files.videohelp.com/u/152675/make_m4b.bat
    Last edited by davexnet; 28th Mar 2024 at 15:54. Reason: typo
    Quote Quote  



Similar Threads

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