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.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 5 of 5
Thread
-
Last edited by davidicharp; 27th Mar 2024 at 23:27.
-
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. -
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.
-
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.batLast edited by davexnet; 28th Mar 2024 at 15:54. Reason: typo
Similar Threads
-
Change aspect ratio with MKVMerge from command line?
By Rekrul in forum Newbie / General discussionsReplies: 4Last Post: 6th Feb 2021, 14:54 -
Imgburn Command Line
By sambat in forum Newbie / General discussionsReplies: 3Last Post: 6th Aug 2020, 15:04 -
Need a command line for ffmpeg
By NTradd in forum Video ConversionReplies: 11Last Post: 14th Oct 2019, 11:25 -
ffmpeg command line help
By njscorpion in forum Newbie / General discussionsReplies: 2Last Post: 12th Jul 2019, 12:42 -
How to extract dvb subtitles from ts files using Subtitle Edit Command Line
By MounaLafi in forum SubtitleReplies: 0Last Post: 21st Jun 2019, 16:52