ffmpeg guidance, please to convert m4b to mp3
Hi NMGLUG folks, I would like to convert an audiobook .m4b file (probably with chapters in metadata) to .mp3 files split into chapters. I'm trying to learn how to convert files. I looked at https://ffmpeg.org/ffmpeg.html but it gets overwhelming. I'm not sure what the best approach will be. I also found https://github.com/sandreas/m4b-tool where the author references https://github.com/sandreas/tone Additionally, I found this script from nitrag https://gist.github.com/nitrag/a188b8969a539ce0f7a64deb56c00277 Other options appear in https://www.videoproc.com/media-converter/m4b-to-mp3.htm Indeed, my first idea was to import the .m4b file into Audacity to do the conversion. Unfortunately, it doesn't import correctly into Audacity. I'm able to play .m4b file in VLC and SMplayer. It seems like it's possible to use VLC to do the conversion with some help from ffmpeg, though maybe not a great option. Any thoughts? Thanks, LeRoy -- There is something glorious birthing within all of us. I am the Love of God, no matter what.BSA LeRoy Diener 213-LEROYIZ 213-537-6949 https://leroydiener.com
If it can't be opened correctly by Audacity, is it possible the file is corrupted somehow? Do you really want the results in separate chapters, or is a single non-chaptered file okay? ffmpeg would be a very simple command-line if you wish to write to a single file. If you need to separate by chapters, did you try using the nitrag script? BTW, most video/audio editors use ffmpeg or one of it's components as it's engine. It is extremely powerful. Wayne On 11/26/22 1:16 PM, LeRoy Diener wrote:
Hi NMGLUG folks,
I would like to convert an audiobook .m4b file (probably with chapters in metadata) to .mp3 files split into chapters. I'm trying to learn how to convert files. I looked at https://ffmpeg.org/ffmpeg.html but it gets overwhelming.
I'm not sure what the best approach will be. I also found https://github.com/sandreas/m4b-tool where the author references https://github.com/sandreas/tone Additionally, I found this script from nitrag https://gist.github.com/nitrag/a188b8969a539ce0f7a64deb56c00277 Other options appear in https://www.videoproc.com/media-converter/m4b-to-mp3.htm Indeed, my first idea was to import the .m4b file into Audacity to do the conversion. Unfortunately, it doesn't import correctly into Audacity. I'm able to play .m4b file in VLC and SMplayer. It seems like it's possible to use VLC to do the conversion with some help from ffmpeg, though maybe not a great option.
Any thoughts?
Thanks, LeRoy
--
There is something glorious birthing within all of us. I am the Love of God, no matter what. BSA LeRoy Diener 213-LEROYIZ 213-537-6949 https://leroydiener.com <https://leroydiener.com/>
_______________________________________________ nmglug mailing list nmglug@lists.nmglug.org http://lists.nmglug.org/listinfo.cgi/nmglug-nmglug.org
To Wayne and all: The .m4b file is not corrupted. The 11hr file plays flawlessly in VLC and SMplayer. The first 1hr loads correctly in Audacity, but only as the truncated portion of the larger file. I found that others had a similar experience, as at https://forum.audacityteam.org/viewtopic.php?t=79754 I'm guessing that the issue for Audacity is that the .m4b file includes some encoding which points to a .cue file which has the timestamps for the chapters. Here are snippets of the .cue file: TRACK 1 AUDIO TITLE "Chapter 01" INDEX 01 0:0:00 TRACK 2 AUDIO TITLE "Chapter 02" INDEX 01 20:14:56 ... TRACK 19 AUDIO TITLE "Chapter 19" INDEX 01 661:19:09 My end objective is to break the 11hr file into smaller files, ideally the chapters of the audiobook. I'm not sure what is the best workflow for this. Here's one idea. If I can convert the .m4b file to a .mp3 file, then I can edit it in Audacity. It might be even easier if I can use ffmpeg to split the file into chapters. I would be happy to have the chapter files in .m4b format (unconverted). I just want to end up with files that are not so long. Wayne, thanks for your ideas. I have not yet tried using the nitrag script. I'm not sure how to do that, and I'm being cautious, asking for guidance. I'm still unsure about how to proceed. LeRoy -- There is something glorious birthing within all of us. I am the Love of God, no matter what.BSA LeRoy Diener 213-LEROYIZ 213-537-6949 https://leroydiener.com On Tue, 2022-11-29 at 15:32 -0800, Wayne wrote:
If it can't be opened correctly by Audacity, is it possible the file is corrupted somehow?
Do you really want the results in separate chapters, or is a single non-chaptered file okay? ffmpeg would be a very simple command-line if you wish to write to a single file. If you need to separate by chapters, did you try using the nitrag script?
BTW, most video/audio editors use ffmpeg or one of it's components as it's engine. It is extremely powerful.
Wayne
On 11/26/22 1:16 PM, LeRoy Diener wrote:
Hi NMGLUG folks,
I would like to convert an audiobook .m4b file (probably with chapters in metadata) to .mp3 files split into chapters. I'm trying to learn how to convert files. I looked at https://ffmpeg.org/ffmpeg.html but it gets overwhelming.
I'm not sure what the best approach will be. I also found https://github.com/sandreas/m4b-tool where the author references https://github.com/sandreas/tone Additionally, I found this script from nitrag https://gist.github.com/nitrag/a188b8969a539ce0f7a64deb56c00277 Other options appear in https://www.videoproc.com/media-converter/m4b-to-mp3.htm Indeed, my first idea was to import the .m4b file into Audacity to do the conversion. Unfortunately, it doesn't import correctly into Audacity. I'm able to play .m4b file in VLC and SMplayer. It seems like it's possible to use VLC to do the conversion with some help from ffmpeg, though maybe not a great option.
Any thoughts?
Thanks, LeRoy
--
There is something glorious birthing within all of us. I am the Love of God, no matter what. BSA LeRoy Diener 213-LEROYIZ 213-537-6949 https://leroydiener.com <https://leroydiener.com/>
_______________________________________________ nmglug mailing list nmglug@lists.nmglug.org http://lists.nmglug.org/listinfo.cgi/nmglug-nmglug.org
_______________________________________________ nmglug mailing list nmglug@lists.nmglug.org http://lists.nmglug.org/listinfo.cgi/nmglug-nmglug.org
LeRoy, If you have timestamps, I would try these commands and see if they work for you: Begin at 0, with a duration of 1214 seconds: ffmpeg -i audiobook.m4a -t 1214 -c copy chapter1.mp3 Begin at 20 minutes and 14 seconds, with a duration of 1214 seconds: ffmpeg -ss 00:20:14 -i audiobook.m4a -to 1214 -c copy chapter2.mp3 https://trac.ffmpeg.org/wiki/Seeking for more details Holly On Wed, Nov 30, 2022 at 10:06 AM LeRoy Diener <leroy@choosetherightside.com> wrote:
To Wayne and all:
The .m4b file is not corrupted. The 11hr file plays flawlessly in VLC and SMplayer. The first 1hr loads correctly in Audacity, but only as the truncated portion of the larger file. I found that others had a similar experience, as at https://forum.audacityteam.org/viewtopic.php?t=79754
I'm guessing that the issue for Audacity is that the .m4b file includes some encoding which points to a .cue file which has the timestamps for the chapters. Here are snippets of the .cue file: TRACK 1 AUDIO TITLE "Chapter 01" INDEX 01 0:0:00 TRACK 2 AUDIO TITLE "Chapter 02" INDEX 01 20:14:56 ... TRACK 19 AUDIO TITLE "Chapter 19" INDEX 01 661:19:09
My end objective is to break the 11hr file into smaller files, ideally the chapters of the audiobook. I'm not sure what is the best workflow for this. Here's one idea. If I can convert the .m4b file to a .mp3 file, then I can edit it in Audacity. It might be even easier if I can use ffmpeg to split the file into chapters. I would be happy to have the chapter files in .m4b format (unconverted). I just want to end up with files that are not so long.
Wayne, thanks for your ideas. I have not yet tried using the nitrag script. I'm not sure how to do that, and I'm being cautious, asking for guidance.
I'm still unsure about how to proceed. LeRoy
--
There is something glorious birthing within all of us. I am the Love of God, no matter what. BSA LeRoy Diener 213-LEROYIZ 213-537-6949 https://leroydiener.com
On Tue, 2022-11-29 at 15:32 -0800, Wayne wrote:
If it can't be opened correctly by Audacity, is it possible the file is corrupted somehow?
Do you really want the results in separate chapters, or is a single non-chaptered file okay? ffmpeg would be a very simple command-line if you wish to write to a single file. If you need to separate by chapters, did you try using the nitrag script?
BTW, most video/audio editors use ffmpeg or one of it's components as it's engine. It is extremely powerful.
Wayne
On 11/26/22 1:16 PM, LeRoy Diener wrote:
Hi NMGLUG folks,
I would like to convert an audiobook .m4b file (probably with chapters in metadata) to .mp3 files split into chapters. I'm trying to learn how to convert files. I looked at https://ffmpeg.org/ffmpeg.html but it gets overwhelming.
I'm not sure what the best approach will be. I also found https://github.com/sandreas/m4b-tool where the author references https://github.com/sandreas/tone Additionally, I found this script from nitrag https://gist.github.com/nitrag/a188b8969a539ce0f7a64deb56c00277 Other options appear in https://www.videoproc.com/media-converter/m4b-to-mp3.htm Indeed, my first idea was to import the .m4b file into Audacity to do the conversion. Unfortunately, it doesn't import correctly into Audacity. I'm able to play .m4b file in VLC and SMplayer. It seems like it's possible to use VLC to do the conversion with some help from ffmpeg, though maybe not a great option.
Any thoughts?
Thanks, LeRoy
--
There is something glorious birthing within all of us. I am the Love of God, no matter what. BSA LeRoy Diener 213-LEROYIZ 213-537-6949 https://leroydiener.com <https://leroydiener.com/>
_______________________________________________ nmglug mailing list nmglug@lists.nmglug.org http://lists.nmglug.org/listinfo.cgi/nmglug-nmglug.org
_______________________________________________ nmglug mailing list nmglug@lists.nmglug.org http://lists.nmglug.org/listinfo.cgi/nmglug-nmglug.org
_______________________________________________ nmglug mailing list nmglug@lists.nmglug.org http://lists.nmglug.org/listinfo.cgi/nmglug-nmglug.org
Thanks, Holly. I got it to work. The link about seeking was exactly what I needed, but couldn't find. There is a lingering issue, not a big deal. When I tried to put input and output as m4b and mp3, I got an error that the input must be mp3. I had success when I put the output also as m4b. So, I've learned how to split an m4b file into segments with several options. I have not yet learned how to convert an m4b tile into an mp3 file. In gratitude, LeRoy -- There is something glorious birthing within all of us. I am the Love of God, no matter what.BSA LeRoy Diener 213-LEROYIZ 213-537-6949 https://leroydiener.com On Wed, 2022-11-30 at 11:44 -0700, Holly Grimm wrote:
LeRoy, If you have timestamps, I would try these commands and see if they work for you:
Begin at 0, with a duration of 1214 seconds: ffmpeg -i audiobook.m4a -t 1214 -c copy chapter1.mp3
Begin at 20 minutes and 14 seconds, with a duration of 1214 seconds: ffmpeg -ss 00:20:14 -i audiobook.m4a -to 1214 -c copy chapter2.mp3
https://trac.ffmpeg.org/wiki/Seeking for more details
Holly
On Wed, Nov 30, 2022 at 10:06 AM LeRoy Diener <leroy@choosetherightside.com> wrote:
To Wayne and all:
The .m4b file is not corrupted. The 11hr file plays flawlessly in VLC and SMplayer. The first 1hr loads correctly in Audacity, but only as the truncated portion of the larger file. I found that others had a similar experience, as at https://forum.audacityteam.org/viewtopic.php?t=79754
I'm guessing that the issue for Audacity is that the .m4b file includes some encoding which points to a .cue file which has the timestamps for the chapters. Here are snippets of the .cue file: TRACK 1 AUDIO TITLE "Chapter 01" INDEX 01 0:0:00 TRACK 2 AUDIO TITLE "Chapter 02" INDEX 01 20:14:56 ... TRACK 19 AUDIO TITLE "Chapter 19" INDEX 01 661:19:09
My end objective is to break the 11hr file into smaller files, ideally the chapters of the audiobook. I'm not sure what is the best workflow for this. Here's one idea. If I can convert the .m4b file to a .mp3 file, then I can edit it in Audacity. It might be even easier if I can use ffmpeg to split the file into chapters. I would be happy to have the chapter files in .m4b format (unconverted). I just want to end up with files that are not so long.
Wayne, thanks for your ideas. I have not yet tried using the nitrag script. I'm not sure how to do that, and I'm being cautious, asking for guidance.
I'm still unsure about how to proceed. LeRoy -- There is something glorious birthing within all of us. I am the Love of God, no matter what.BSA LeRoy Diener 213-LEROYIZ 213-537-6949 https://leroydiener.com
On Tue, 2022-11-29 at 15:32 -0800, Wayne wrote:
If it can't be opened correctly by Audacity, is it possible the file is corrupted somehow?
Do you really want the results in separate chapters, or is a single non-chaptered file okay? ffmpeg would be a very simple command-line if you wish to write to a single file. If you need to separate by chapters, did you try using the nitrag script?
BTW, most video/audio editors use ffmpeg or one of it's components as it's engine. It is extremely powerful.
Wayne
On 11/26/22 1:16 PM, LeRoy Diener wrote:
Hi NMGLUG folks,
I would like to convert an audiobook .m4b file (probably with chapters in metadata) to .mp3 files split into chapters. I'm trying to learn how to convert files. I looked at https://ffmpeg.org/ffmpeg.html but it gets overwhelming.
I'm not sure what the best approach will be. I also found https://github.com/sandreas/m4b-tool where the author references https://github.com/sandreas/tone Additionally, I found this script from nitrag https://gist.github.com/nitrag/a188b8969a539ce0f7a64deb56c00277 Other options appear in https://www.videoproc.com/media-converter/m4b-to-mp3.htm Indeed, my first idea was to import the .m4b file into Audacity to do the conversion. Unfortunately, it doesn't import correctly into Audacity. I'm able to play .m4b file in VLC and SMplayer. It seems like it's possible to use VLC to do the conversion with some help from ffmpeg, though maybe not a great option.
Any thoughts?
Thanks, LeRoy
_______________________________________________ nmglug mailing list nmglug@lists.nmglug.org http://lists.nmglug.org/listinfo.cgi/nmglug-nmglug.org
participants (3)
-
Holly Grimm -
LeRoy Diener -
Wayne