Giter VIP home page Giter VIP logo

m4b-tool's Issues

Problem with large mp3 input files when using the fdkaac profile

I found I needed to split very large mp3 files e.g. if it was great than 4 hours the fdkaac would fail and leave a very very large PCM tmp file around. To solve this I have been looking at splitting the large mp3 into smaller ones which seems to solve the problem - the smaller ones later get merged back into a single large m4b fine - its just the initial transcoding that seems to fail with fdkaac.

Use file name as chapter metadata

M4B-tool should be able to use the file names as chapter titles. A lot of times I have a folder full of properly named files for each chapter, but without any metadata.

Add MP4 input support

I would really appreciate if you could add MP4 input support. I often convert video products into audio books, so I can listen to them on the go.

This should be really simple to add, as M4B-tool already works if you just rename the input .mp4 files to .aac .

Command "m4b-tool" is not defined.

I tried the docker way on macOS and it results in this error.
Any ideas?

❯ m4b-tool --version
m4b-tool v.0.4.0

❯ m4b-tool merge -v --output-file="output/" --batch-pattern="input/%g/%a/%s/%p - %n/"  --batch-pattern="input/%g/%a/%n/" "input/"

In Application.php line 639:

  [Symfony\Component\Console\Exception\CommandNotFoundException]
  Command "m4b-tool" is not defined.


Exception trace:
 () at phar:///usr/local/bin/m4b-tool/vendor/symfony/console/Application.php:639
 Symfony\Component\Console\Application->find() at phar:///usr/local/bin/m4b-tool/vendor/symfony/console/Application.php:233
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/m4b-tool/vendor/symfony/console/Application.php:145
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/m4b-tool/bin/m4b-tool.php:32
 require() at /usr/local/bin/m4b-tool:10

No audio/file does not play

Command:

php m4b-tool.phar merge "X:\ToSort\Anthology - Star Wars-- Canto Bight (Read by Multiple Narrators)" --output-file="X:\ToSort\Anthology - Star Wars-- Canto Bight (Read by Multiple Narrators)\Canto Bight.m4b" --ffmpeg-threads=8 --convert-charset --audio-format="m4b" --audio-bitrate="62k" --audio-codec="aac" --artist="Sean Kenin, Saskia Maarleveld, Marc Thompson, Jonathan Davis"  --albumartist="Saladin Ahmed, Rae Carson, Mira Grant, John Jackson Miller" -f -v --no-cache

first file mediainfo

General
Complete name                            : X:\ToSort\Anthology - Star Wars-- Canto Bight (Read by Multiple Narrators)\02 - Saladin Ahmed - Rules of the Game - Chapter 1 (Read by Sean Kenin).m4b
Format                                   : MPEG-4
Format profile                           : Base Media / Version 2
Codec ID                                 : mp42 (isom/mp42/3gp5)
File size                                : 7.09 MiB
Duration                                 : 15 min 27 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 64.1 kb/s
Album                                    : Star Wars: Canto Bight
Track name                               : Rules of the Game - Chapter 1
Track name/Position                      : 2
Performer                                : Saladin Ahmed
Genre                                    : Audiobook - Science Fantasy
Description                              : Soon to be seen in Star Wars: The Last Jedi, welcome to the casino city of Canto Bight. A place where exotic aliens, captivating creatures, and other would-be high rollers are willing to risk everything to make their fortunes. Set across one fateful even
Recorded date                            : 2017
Encoded date                             : UTC 2017-12-07 19:08:29
Tagged date                              : UTC 2017-12-07 19:08:29
Cover                                    : Yes
Comment                                  : Read by Sean Kenin

Audio
ID                                       : 101
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : mp4a-40-2
Duration                                 : 15 min 27 s
Bit rate mode                            : Variable
Bit rate                                 : 62.8 kb/s
Maximum bit rate                         : 70.4 kb/s
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 22.05 kHz
Frame rate                               : 21.533 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 6.95 MiB (98%)
Encoded date                             : UTC 2017-12-07 19:08:29
Tagged date                              : UTC 2017-12-07 19:08:30

Other #1
ID                                       : 2
Type                                     : Object description
Format                                   : System
Codec ID                                 : mp4s-01
Duration                                 : 1 s 0 ms
Encoded date                             : UTC 2017-12-07 19:08:30
Tagged date                              : UTC 2017-12-07 19:08:30

Other #2
ID                                       : 1
Type                                     : Scene description
Format                                   : System Core
Codec ID                                 : mp4s-02
Duration                                 : 1 s 0 ms
Encoded date                             : UTC 2017-12-07 19:08:30
Tagged date                              : UTC 2017-12-07 19:08:30

Merged file mediainfo

General
Complete name                            : X:\ToSort\Anthology - Star Wars-- Canto Bight (Read by Multiple Narrators)\Canto Bight.m4b
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 302 MiB
Duration                                 : 11 h 5 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 63.4 kb/s
Movie name                               : Star Wars: Canto Bight
Album/Performer                          : Saladin Ahmed, Rae Carson, Mira Grant, John Jackson Miller
Performer                                : Sean Kenin, Saskia Maarleveld, Marc Thompson, Jonathan Davis
Genre                                    : Audiobook - Science Fantasy
Recorded date                            : 2017
Tagged date                              : UTC 2018-04-15 06:46:04
Writing application                      : Lavf58.11.101

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : [email protected]
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, RefFrames               : 4 frames
Format settings, GOP                     : N=1
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 11 h 4 min
Bit rate mode                            : Constant
Bit rate                                 : 170 b/s
Width                                    : 500 pixels
Height                                   : 500 pixels
Display aspect ratio                     : 1.000
Frame rate mode                          : Variable
Frame rate                               : 0.001 FPS
Minimum frame rate                       : 0.000 FPS
Maximum frame rate                       : 1 000.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.680
Stream size                              : 1.06 MiB (0%)
Writing library                          : x264 core 155 r2901 7d0ff22
Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Color range                              : Full
Menus                                    : 3

Audio
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : mp4a-40-2
Duration                                 : 11 h 5 min
Source duration                          : 11 h 5 min
Bit rate mode                            : Variable
Bit rate                                 : 62.5 kb/s
Maximum bit rate                         : 119 kb/s
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 22.05 kHz
Frame rate                               : 21.533 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 297 MiB (99%)
Source stream size                       : 297 MiB (99%)
Default                                  : Yes
Alternate group                          : 1

Menu #1
00:00:00.000                             : Introduction
00:01:49.876                             : Rules of the Game - Chapter 1
00:17:17.791                             : Rules of the Game - Chapter 2
00:27:39.621                             : Rules of the Game - Chapter 3
00:38:31.172                             : Rules of the Game - Chapter 4
00:42:50.538                             : Rules of the Game - Chapter 5
00:57:33.314                             : Rules of the Game - Chapter 6
01:12:20.362                             : Rules of the Game - Chapter 7
01:29:38.897                             : Rules of the Game - Chapter 8
01:33:51.344                             : Rules of the Game - Chapter 9
01:40:58.916                             : Rules of the Game - Chapter 10
01:45:44.428                             : Rules of the Game - Chapter 11
02:01:56.508                             : The Wine in Dreams - Chapter 1
02:09:48.616                             : The Wine in Dreams - Chapter 2
02:22:55.075                             : The Wine in Dreams - Chapter 3
02:46:52.390                             : The Wine in Dreams - Chapter 4
02:54:19.699                             : The Wine in Dreams - Chapter 5
03:02:09.531                             : The Wine in Dreams - Chapter 6
03:18:00.806                             : The Wine in Dreams - Chapter 7
03:48:33.139                             : The Wine in Dreams - Chapter 8
03:57:07.135                             : The Wine in Dreams - Chapter 9
04:22:17.871                             : The Wine in Dreams - Chapter 10
04:47:29.397                             : The Wine in Dreams - Chapter 11
04:52:10.590                             : Hear Nothing, See Nothing, Say Nothing - Chapter 1
05:04:55.780                             : Hear Nothing, See Nothing, Say Nothing - Chapter 2
05:40:35.220                             : Hear Nothing, See Nothing, Say Nothing - Chapter 3
05:55:51.247                             : Hear Nothing, See Nothing, Say Nothing - Chapter 4
06:05:16.838                             : Hear Nothing, See Nothing, Say Nothing - Chapter 5
06:34:16.198                             : Hear Nothing, See Nothing, Say Nothing - Chapter 6
06:51:56.839                             : Hear Nothing, See Nothing, Say Nothing - Chapter 7
07:16:13.984                             : Hear Nothing, See Nothing, Say Nothing - Chapter 8
07:23:49.373                             : Hear Nothing, See Nothing, Say Nothing - Chapter 9
07:41:24.534                             : Hear Nothing, See Nothing, Say Nothing - Chapter 10
07:53:59.368                             : The Ride - The Grinder - 1
08:08:39.218                             : The Ride - The Trips - 2
08:18:21.342                             : The Ride - The Gutshot - 3
08:29:57.987                             : The Ride - The Bad Beat - 4
08:40:20.746                             : The Ride - The Sharp - 5
08:51:04.867                             : The Ride - The Bust Out - 6
08:59:07.656                             : The Ride - The Edge - 7
09:06:48.572                             : The Ride - The Buy-in - 8
09:18:32.461                             : The Ride - The Tell - 9
09:26:51.968                             : The Ride - The Stretch - 10
09:41:57.406                             : The Ride - The Turn - 11
09:50:23.368                             : The Ride - The Wire - 12
10:03:10.741                             : The Ride - The Breakdown - 13
10:15:24.398                             : The Ride - The Surrender - 14
10:25:03.085                             : The Ride - The Freeroll - 15
10:36:03.692                             : The Ride - The Showdown - 16
10:45:15.073                             : The Ride - The Kicker - 17
10:55:01.376                             : The Ride - The Rake - 18
11:04:44.754                             : Credits & Copyright

Menu #2
ID                                       : 3
Codec ID                                 : text
Duration                                 : 11 h 4 min
Encoded date                             : UTC 2018-04-15 06:45:54
Tagged date                              : UTC 2018-04-15 06:45:54
Menu For                                 : 1
00:00:00.000                             : Introduction
00:01:49.876                             : Rules of the Game - Chapter 1
00:17:17.791                             : Rules of the Game - Chapter 2
00:27:39.621                             : Rules of the Game - Chapter 3
00:38:31.172                             : Rules of the Game - Chapter 4
00:42:50.538                             : Rules of the Game - Chapter 5
00:57:33.314                             : Rules of the Game - Chapter 6
01:12:20.362                             : Rules of the Game - Chapter 7
01:29:38.897                             : Rules of the Game - Chapter 8
01:33:51.344                             : Rules of the Game - Chapter 9
01:40:58.916                             : Rules of the Game - Chapter 10
01:45:44.428                             : Rules of the Game - Chapter 11
02:01:56.508                             : The Wine in Dreams - Chapter 1
02:09:48.616                             : The Wine in Dreams - Chapter 2
02:22:55.075                             : The Wine in Dreams - Chapter 3
02:46:52.390                             : The Wine in Dreams - Chapter 4
02:54:19.699                             : The Wine in Dreams - Chapter 5
03:02:09.531                             : The Wine in Dreams - Chapter 6
03:18:00.806                             : The Wine in Dreams - Chapter 7
03:48:33.139                             : The Wine in Dreams - Chapter 8
03:57:07.135                             : The Wine in Dreams - Chapter 9
04:22:17.871                             : The Wine in Dreams - Chapter 10
04:47:29.397                             : The Wine in Dreams - Chapter 11
04:52:10.590                             : Hear Nothing, See Nothing, Say Nothing - Chapter 1
05:04:55.780                             : Hear Nothing, See Nothing, Say Nothing - Chapter 2
05:40:35.220                             : Hear Nothing, See Nothing, Say Nothing - Chapter 3
05:55:51.247                             : Hear Nothing, See Nothing, Say Nothing - Chapter 4
06:05:16.838                             : Hear Nothing, See Nothing, Say Nothing - Chapter 5
06:34:16.198                             : Hear Nothing, See Nothing, Say Nothing - Chapter 6
06:51:56.839                             : Hear Nothing, See Nothing, Say Nothing - Chapter 7
07:16:13.984                             : Hear Nothing, See Nothing, Say Nothing - Chapter 8
07:23:49.373                             : Hear Nothing, See Nothing, Say Nothing - Chapter 9
07:41:24.534                             : Hear Nothing, See Nothing, Say Nothing - Chapter 10
07:53:59.368                             : The Ride - The Grinder - 1
08:08:39.218                             : The Ride - The Trips - 2
08:18:21.342                             : The Ride - The Gutshot - 3
08:29:57.987                             : The Ride - The Bad Beat - 4
08:40:20.746                             : The Ride - The Sharp - 5
08:51:04.867                             : The Ride - The Bust Out - 6
08:59:07.656                             : The Ride - The Edge - 7
09:06:48.572                             : The Ride - The Buy-in - 8
09:18:32.461                             : The Ride - The Tell - 9
09:26:51.968                             : The Ride - The Stretch - 10
09:41:57.406                             : The Ride - The Turn - 11
09:50:23.368                             : The Ride - The Wire - 12
10:03:10.741                             : The Ride - The Breakdown - 13
10:15:24.398                             : The Ride - The Surrender - 14
10:25:03.085                             : The Ride - The Freeroll - 15
10:36:03.692                             : The Ride - The Showdown - 16
10:45:15.073                             : The Ride - The Kicker - 17
10:55:01.376                             : The Ride - The Rake - 18
11:04:44.754                             : Credits & Copyright
Bit rate mode                            : VBR

PHP Fatal error: Uncaught Error: Call to undefined function M4bTool\Parser\simplexml_load_string()

While trying to add chapters to an m4b audiobook with this command:

m4b-tool chapters --first-chapter-offset 4000 --last-chapter-offset 3500 -m 969d83a3-e80c-4b47-895a-5b8a410836bd "/mnt/d/Download/Star Wars Erben des Imperiums Hörbuch (Band 1).m4a"

I've got this error:

PHP Fatal error: Uncaught Error: Call to undefined function M4bTool\Parser\simplexml_load_string() in phar:///usr/local/bin/m4b-tool/src/library/M4bTool/Parser/MusicBrainzChapterParser.php:85
Stack trace:
#0 phar:///usr/local/bin/m4b-tool/src/library/M4bTool/Command/ChaptersCommand.php(125): M4bTool\Parser\MusicBrainzChapterParser->parseRecordings('<?xml version="...')
#1 phar:///usr/local/bin/m4b-tool/vendor/symfony/console/Command/Command.php(255): M4bTool\Command\ChaptersCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 phar:///usr/local/bin/m4b-tool/vendor/symfony/console/Application.php(908): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 phar:///usr/local/bin/m4b-tool/vendor/symfony/console/Application.php(269): Symfony\Component\Console\Application->doRunCommand(Object(M4bTool\Command\ChaptersCommand), Object(Symfony\Component\Console\ in phar:///usr/local/bin/m4b-to
ol/src/library/M4bTool/Parser/MusicBrainzChapterParser.php on line 85
an error occured, that has not been caught:
Array
(
[type] => 1
[message] => Uncaught Error: Call to undefined function M4bTool\Parser\simplexml_load_string() in phar:///usr/local/bin/m4b-tool/src/library/M4bTool/Parser/MusicBrainzChapterParser.php:85
Stack trace:
#0 phar:///usr/local/bin/m4b-tool/src/library/M4bTool/Command/ChaptersCommand.php(125): M4bTool\Parser\MusicBrainzChapterParser->parseRecordings('<?xml version="...')
#1 phar:///usr/local/bin/m4b-tool/vendor/symfony/console/Command/Command.php(255): M4bTool\Command\ChaptersCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 phar:///usr/local/bin/m4b-tool/vendor/symfony/console/Application.php(908): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 phar:///usr/local/bin/m4b-tool/vendor/symfony/console/Application.php(269): Symfony\Component\Console\Application->doRunCommand(Object(M4bTool\Command\ChaptersCommand), Object(Symfony\Component\Console
[file] => phar:///usr/local/bin/m4b-tool/src/library/M4bTool/Parser/MusicBrainzChapterParser.php
[line] => 85
)

But I solved it by installing the php7.2-xml extension. Maybe you should put this as a dependency in the Installation Description of Ubuntu. I am using the WSL based on ubuntu.

Error when merging files that have no cover

Hello,

I forgot exactly why I remove the covers before merging files. Perhaps it was some error using --no-conversion that I'm unsure if it remains valid and the step remains required. When first removing covers using AtomicParsley :

for i in *.m4b ; do ; AtomicParsley "$i" --artwork REMOVE_ALL --overWrite ; done

and then merging :

merge . --no-conversion --fix-mime-type --output-file="/Users/.../Desktop/temp/1.m4b"

I get the following error :

extracting cover to /Users/.../Desktop/temp2/....jpg failed

Perhaps m4b-tool assumes there is a cover and then shows as such. Maybe instead a warning or if there's no cover, just be silent ?

Conversion fails if output file is not specified

Hello,

I'm trying to use m4b-tool for the first time and I'm encountering a few problems. I'm on macOS High Sierra and I've installed m4b-tool 0.4.2 using a MacPorts Portfile I just wrote. (I'll submit that Portfile into the official MacPorts repository once I'm sure m4b-tool is working.)

I have a folder of AIFF files (/private/tmp/m4b-test). The files don't have any tag metadata. In that folder, I run:

$ m4b-tool merge --include-extensions=aiff .

The error is:

extracting cover to ./cover.jpg failed
could not convert /private/tmp/m4b-test/1.aiff to -tmpfiles/1-1-finished.m4b

If I specify --output-file test.m4b then I can get past that error (and on to another one, for which I'll file a separate issue).

m4b-tool php parse

Title: m4b-tool does not give a vaild install version - array syntax error

First of all I just want to say that this looks like a first class job, I'm so grateful that people like you take the time to write stuff like this.......he says bowing down in a Waynes World type "we're not worthy" salute........

If i run m4b-tool --version I receive a PHP Parse Error as follows.

OS: Ubuntu 16.04.6 LTS
Command: m4b-tool --version
Error:

PHP Parse error:  syntax error, unexpected '?', expecting variable (T_VARIABLE) in phar:///usr/local/bin/m4b-tool/vendor/symfony/console/Output/Output.php on line 40
an error occured, that has not been caught:
Array
(
    [type] => 4
    [message] => syntax error, unexpected '?', expecting variable (T_VARIABLE)
    [file] => phar:///usr/local/bin/m4b-tool/vendor/symfony/console/Output/Output.php
    [line] => 40
)

charset windows-1252 is not supported - use one of these instead: utf-8

Running latest beta on windows, I get the following:

mp4tools>php m4b-tool.phar merge "X:\ToSort\Jeff VanderMeer - Borne" --output-file "X:\ToSort\Borne.m4b" --ffmpeg-threads=4 --convert-charset
.
.
.
getting duration for X:\ToSort\Borne-tmpfiles\37-01 - Chapter 1-finished.m4b


  [Exception]
  charset windows-1252 is not supported - use one of these instead: utf-8

Symlinks are ignored

Using m4b-tool 0.4.2 installed using MacPorts on macOS High Sierra, I'm trying to create an m4b file from a folder of AIFF files. But these files don't have any silence at the beginning or end, so combining them as-is results in one chapter running immediately into the next, which isn't very pleasant. One wants a couple seconds of silence between chapters. To that end, I've used sox to create a 2-second-long silence file which I would like to place between each chapter. The way that occurred to me to do that was to create several symlinks to the silence file:

$ ls -l source/
total 288
lrwxr-xr-x  1 rschmidt  wheel     26 Sep 26 18:27 0s.aiff -> ../silence/silence0.5.aiff
-rw-r--r--  1 rschmidt  staff  84504 Sep 24 18:32 1.aiff
lrwxr-xr-x  1 rschmidt  wheel     26 Sep 26 18:27 1s.aiff -> ../silence/silence2.0.aiff
-rw-r--r--  1 rschmidt  staff  22760 Sep 24 18:32 2.aiff
lrwxr-xr-x  1 rschmidt  wheel     26 Sep 26 18:27 2s.aiff -> ../silence/silence2.0.aiff
-rw-r--r--  1 rschmidt  staff  21112 Sep 24 18:32 3.aiff
lrwxr-xr-x  1 rschmidt  wheel     26 Sep 26 18:27 3s.aiff -> ../silence/silence2.0.aiff
-rw-r--r--  1 rschmidt  staff  26152 Sep 24 18:32 4.aiff
lrwxr-xr-x  1 rschmidt  wheel     26 Sep 26 18:27 4s.aiff -> ../silence/silence2.0.aiff
-rw-r--r--  1 rschmidt  staff  32728 Sep 24 18:32 5.aiff
lrwxr-xr-x  1 rschmidt  wheel     26 Sep 26 18:27 5s.aiff -> ../silence/silence2.0.aiff
-rw-r--r--  1 rschmidt  staff  21408 Sep 24 18:32 6.aiff
lrwxr-xr-x  1 rschmidt  wheel     26 Sep 26 18:28 6s.aiff -> ../silence/silence2.0.aiff
-rw-r--r--  1 rschmidt  staff  33784 Sep 24 18:32 7.aiff
lrwxr-xr-x  1 rschmidt  wheel     26 Sep 26 18:28 7s.aiff -> ../silence/silence2.0.aiff
-rw-r--r--  1 rschmidt  staff  31804 Sep 24 18:32 8.aiff
-rw-r--r--  1 rschmidt  wheel     29 Sep 26 18:19 chapters.txt

But this doesn't work: m4b-tool ignores the symlinks.

If I copy the silence files instead of making symlinks, that works, but of course that takes up a little more disk space. I suppose I could use hardlinks. But the point is that it was unexpected that symlinks were silently ignored.

Memory leak during large Batch audiobook conversion

I have about 100 audiobooks organised in folders structures and am using the batch conversion to create .m4b files but it runs out of memory during this process.

[mp3float @ 0x5645ffd84100] overread, skip -6 enddists: -4 -4
[mp3float @ 0x5645ffd84100] overread, skip -7 enddists: -6 -6
frame= 1 fps=0.0 q=-0.0 Lsize=N/A time=00:41:14.05 bitrate=N/A speed=79.5x
video:1kB audio:213098kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 67108872 bytes) in phar:///usr/local/bin/m4b-tool/src/library/M4bTool/StringUtilities/Runes.php on line 26
an error occured, that has not been caught:
Array
(
[type] => 1
[message] => Allowed memory size of 134217728 bytes exhausted (tried to allocate 67108872 bytes)
[file] => phar:///usr/local/bin/m4b-tool/src/library/M4bTool/StringUtilities/Runes.php
[line] => 26
)

Fatal error: Uncaught Error: Call to a member function loadRecordings() on null

I installed dependencies with brew on macOS High Sierra 10.13.6, including php v7.1.16.

I tried using the tool to split chapters on silence, and after a while of "detecting silence", this exception was thrown:

$ php m4b-tool.phar chapters -- "My Book.m4b"
detecting silence of My Book.m4b
+++++++++++++++++++++++++++++++++++++++

Fatal error: Uncaught Error: Call to a member function loadRecordings() on null in phar:///Users/me/Downloads/m4b-tool.phar/src/library/M4bTool/Command/ChaptersCommand.php:156
Stack trace:
#0 phar:///Users/me/Downloads/m4b-tool.phar/src/library/M4bTool/Command/ChaptersCommand.php(98): M4bTool\Command\ChaptersCommand->buildChapters()
#1 phar:///Users/me/Downloads/m4b-tool.phar/vendor/symfony/console/Command/Command.php(251): M4bTool\Command\ChaptersCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 phar:///Users/me/Downloads/m4b-tool.phar/vendor/symfony/console/Application.php(946): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 phar:///Users/me/Downloads/m4b-tool.phar/vendor/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(M4bTool\Command\ChaptersCommand), Object(Symf in phar:///Users/me/Downloads/m4b-tool.phar/src/library/M4bTool/Command/ChaptersCommand.php on line 156

Thoughts?

Brew formula

It would be convenient to install utility system-wide with brew

Chapters are off

Just merged an audiobook with many files (>130). Unfortunately the chapter markers are a bit off.
At the beginning of the audiobook it's just a little bit, but the chapters towards the end are off by a few seconds.

Split mp3s into better chapters without re-encoding?

Not sure if this is possible yet, but currently I have mp3 audiobooks split into files with long chapters. I like the ability to split chapters smartly on audio silences, but unfortunately my garmin watch doesn't recognize chapters in m4b files. Is there a way to split my mp3 audiobook into more (separate file) chapters without re-encoding anything? It seems like I could probably run merge with the chapter splitting options, then run split again, but I don't see a no-conversion flag for the split tool.

(awesome tool btw, I wish garmin handled the m4b chapters properly, I'd just convert everything with a normal merge if that was the case)

Merging does not work on OSX

Running php m4b-tool.phar merge on 10.12 and PHP 7.2 results in:

  [Exception]
  DateTime::__construct(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.time
  zone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting
  this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set d
  ate.timezone to select your timezone.

Conversion fails if chapters.txt file does not exist

Hello,

On macOS High Sierra, using m4b-tool 0.4.2 installed using MacPorts, in a folder of AIFF files with no tag metadata, I run:

$ m4b-tool merge --include-extensions=aiff --output-file=test.m4b .

The error I get is:

extracting cover to ./cover.jpg failed
Argument 2 passed to M4bTool\Audio\Chapter::__construct() must be an instance of Sandreas\Time\TimeUnit, null given, called in phar:///opt/local/bin/m4b-tool/src/library/M4bTool/Chapter/ChapterHandler.php on line 95

If I create an empty file called chapters.txt in the same directory, then m4b-tool succeeds.

mp3 source files with title tag issue

I'm trying to use m4b-tool to merge mp3 files to an m4b. The mp3 files definitely have the title tag set but when I merge, in the m4b I just get sequential numbering (1,2,3 etc).

I'm using:

m4b-tool merge audiobook_path --output-file=test.m4b

Am I missing something super obvious or does m4b-tool not work with mp3 tag data? - Thanks

Could not convert…

With every folder I try, I get an error message similar to this one:

In MergeCommand.php line 323:

  could not convert E:\Users\Mark\Downloads\Audiobooks\Annihilation\001.mp3 to E:\Users\Mark\Downloads\Audiobooks\Annihilation-tmpfiles\1-001-converting.m4b

How can I diagnose the issue?

Merge fails with chapters shorter than 1 second

Summary

I'm running m4b-tool built from source in Ubuntu on Windows Subsystem for Linux. When trying to merge a book of mp3 files, the conversion of mp3 chapter files to m4b is successful, but the recombination step fails if an m4b file is less than 1 second long. I believe this is caused by the length metadata tag storing down to seconds rather than hundredths or thousandths of a second. I was able to work around this issue by manually adding a second of silence to the m4b file using audacity (ffmpeg could probably do this too), but I expect there's a more elegant way to do this.

Details

The < 1 sec. length causes $this->meta->inspectExactDuration($file) (src/library/M4bTool/Chapter/ChapterHandler.php, line 98) to return NULL to $duration, which causes $chapter = new Chapter($lastStart, $duration, $chapterName); (src/library/M4bTool/Chapter/ChapterHandler.php, line 99) to throw an error.

Solution

I'm unsure where the inspectExactDuration function comes from, but it could probably be modified such that it handles valid "zero-length" files or calculates length rather than pulling it from metadata.

Trace

Argument 2 passed to M4bTool\Audio\Chapter::__construct() must be an instance of Sandreas\Time\TimeUnit, null given, called in phar:///home/<user>/new/m4b-tool/dist/m4b-tool.phar/src/library/M4bTool/Chapter/ChapterHandler.php on line 99
trace: #0 phar:///home/<user>/new/m4b-tool/dist/m4b-tool.phar/src/library/M4bTool/Chapter/ChapterHandler.php(99): M4bTool\Audio\Chapter->__construct(Object(Sandreas\Time\TimeUnit), NULL, 'MAPS')
#1 phar:///home/<user>/new/m4b-tool/dist/m4b-tool.phar/src/library/M4bTool/Command/MergeCommand.php(445): M4bTool\Chapter\ChapterHandler->buildChaptersFromFiles(Array, Array)
#2 phar:///home/<user>/new/m4b-tool/dist/m4b-tool.phar/src/library/M4bTool/Command/MergeCommand.php(371): M4bTool\Command\MergeCommand->processInputFiles()
#3 phar:///home/<user>/new/m4b-tool/dist/m4b-tool.phar/src/library/M4bTool/Command/MergeCommand.php(165): M4bTool\Command\MergeCommand->processFiles(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 phar:///home/<user>/new/m4b-tool/dist/m4b-tool.phar/vendor/symfony/console/Command/Command.php(255): M4bTool\Command\MergeCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 phar:///home/<user>/new/m4b-tool/dist/m4b-tool.phar/vendor/symfony/console/Application.php(915): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 phar:///home/<user>/new/m4b-tool/dist/m4b-tool.phar/vendor/symfony/console/Application.php(272): Symfony\Component\Console\Application->doRunCommand(Object(M4bTool\Command\MergeCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 phar:///home/<user>/new/m4b-tool/dist/m4b-tool.phar/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 phar:///home/<user>/new/m4b-tool/dist/m4b-tool.phar/bin/m4b-tool.php(33): Symfony\Component\Console\Application->run()
#9 /home/<user>/new/m4b-tool/dist/m4b-tool.phar(10): require('phar:///home/<user>...')
#10 {main}

Help output in readme is out of date

The output of m4b-tool merge --help that is shown in the readme is outdated. For example, it does not mention the --use-filenames-as-chapters or --no-chapter-reindexing options.

How to add custom ffmpeg options

Great peace of software, that makes all those mostly unuseable gui apps out there obsolete. Thanks.

I would like to make use of High-Efficiency AAC, since output at 16K bitrate is much better. https://trac.ffmpeg.org/wiki/Encode/AAC#fdk_he

This has already been implemented, https://github.com/sandreas/m4b-tool/blob/master/src/library/M4bTool/Command/MergeCommand.php#L297

How can I add additional options, like -profile:a aac_he -cutoff 18000, that get forwarded to FFmpeg?

Unable to generate chapters when merging files

On my Win10 64bit Laptop with WSL,
I tried to use the following commad below to merge a set of m4a files in a folder to generate a large m4b file but it did not contain any chapters.
image

m4b-tool merge --no-conversion --use-filenames-as-chapters --no-chapter-reindexing --jobs=8 "./Harry Potter and the Goblet of Fire" --output-file="Harry Potter and the Goblet of Fire.m4b"

Fatal Error: Uncaught TypeError: Argument 3 passed to M4bTool\Chapter\ChapterMarker::guessChaptersBySilences() must be an instance of Sandreas\Time\TimeUnit

I am trying to put chapters from musicbrainz in a m4b.

This is the command:
m4b-tool chapters --merge-similar --first-chapter-offset 4000 --last-chapter-offset 3500 -m 969d83a3-e80c-4b47-895a-5b8a410836bd "/mnt/d/Download/Star Wars Erben des Imperiums Hörbuch (Band 1).m4b"

And I am constantly getting this fatal error:
PHP Fatal error: Uncaught TypeError: Argument 3 passed to M4bTool\Chapter\ChapterMarker::guessChaptersBySilences() must be an instance of Sandreas\Time\TimeUnit, null given, called in phar:///usr/local/bin/m4b-tool/src/library/M4bTool/Command/ChaptersCommand.php on line 177 and defined in phar:///usr/local/bin/m4b-tool/src/library/M4bTool/Chapter/ChapterMarker.php:33
Stack trace:
#0 phar:///usr/local/bin/m4b-tool/src/library/M4bTool/Command/ChaptersCommand.php(177): M4bTool\Chapter\ChapterMarker->guessChaptersBySilences(Array, Array, NULL)
#1 phar:///usr/local/bin/m4b-tool/src/library/M4bTool/Command/ChaptersCommand.php(128): M4bTool\Command\ChaptersCommand->buildChapters(Array)
#2 phar:///usr/local/bin/m4b-tool/vendor/symfony/console/Command/Command.php(255): M4bTool\Command\ChaptersCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 phar:///usr/local/bin/m4b-tool/vendor/symfony/console/Application.php(908): Symfony\Component\Console\Command\Command-> in phar:///usr/local/bin/m4b-tool/src/library/M4bTool/Chapter/ChapterMarker.php on line 33
an error occured, that has not been caught:
Array
(
[type] => 1
[message] => Uncaught TypeError: Argument 3 passed to M4bTool\Chapter\ChapterMarker::guessChaptersBySilences() must be an instance of Sandreas\Time\TimeUnit, null given, called in phar:///usr/local/bin/m4b-tool/src/library/M4bTool/Command/ChaptersCommand.php on line 177 and defined in phar:///usr/local/bin/m4b-tool/src/library/M4bTool/Chapter/ChapterMarker.php:33
Stack trace:
#0 phar:///usr/local/bin/m4b-tool/src/library/M4bTool/Command/ChaptersCommand.php(177): M4bTool\Chapter\ChapterMarker->guessChaptersBySilences(Array, Array, NULL)
#1 phar:///usr/local/bin/m4b-tool/src/library/M4bTool/Command/ChaptersCommand.php(128): M4bTool\Command\ChaptersCommand->buildChapters(Array)
#2 phar:///usr/local/bin/m4b-tool/vendor/symfony/console/Command/Command.php(255): M4bTool\Command\ChaptersCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 phar:///usr/local/bin/m4b-tool/vendor/symfony/console/Application.php(908): Symfony\Component\Console\Command\Command->
[file] => phar:///usr/local/bin/m4b-tool/src/library/M4bTool/Chapter/ChapterMarker.php
[line] => 33
)

I think it is very weird because this command is not using the guessChaptersBySilences() function.

I am using Ubuntu in WSL on Windows 10. I've installed all dependencies, but I am using a customized ffmpeg with all non free codecs installed. Although this should not have any impact on this issue

Thanks for creating this wonderful wrapper :)

Get error "Input is not a file" using docker image

What an amazing project you have put together.

Issue

After building the docker image without any issue, I am not able to split an m4b file

Following error is thrown:

[maarten@zbook m4b-tool]$ m4b-tool split --audio-format aac data/issue-120.m4b 

In AbstractCommand.php line 525:
                       
  Input is not a file

Issue

Background, I am adding MP4 chapter support in music-metadata. Which I believe is working. Problem is, it makes most of my MP4 sample useless. I stripped of the MDAT payload of most of the files, and maybe some more, to get to workable size. I was hoping my splitting, trimming and joining, I could shrink the originals, in such a way there are chapters, but the audio content is limited to something like a a second.

Feature Request: Import/export just opf and cover.jpg without merge

There may be a way to do this already that I am overlooking. With mp4chaps you can import and export the chapters.txt file without the long merge process (useful if you already have a merged m4b file and need to adjust chapter times/names). It would be cool if you could do the same with the cover and metadata.

build.phar incompatible with PHP 7.2

On PHP 7.2 (I tested with 7.2.3), build.phar gives the message:

[ErrorException] count(): Parameter must be an array or an object that implements Countable

Add support for chapter thumbnails

I think this is not possible now with m4b-tool, but would be a nice feature, if that can be integrated. Guess it can be done using FFmpeg or mp4v2. Tested on VLC (iOS, Android - VLC on Android only offers chapter navigation, if such a thumb track is available, I guess because then it thinks it is a video and handles the file differently) and iTunes/iOS books app - these apps can display these thumb images.

Proposal:

  1. If image is embedded into source audio file, it should be a thumbnail included into the chapter thumb track.
  2. If no image is embedded into source file, a search for filename.[jpg, png]* should be done, an if found, that image should be used as chapter thumbnail.
  3. If creation of chapter thumbnails is activated and no image for a track is found via 1. or 2., a default image or black image should be used. (not sure about this, perhaps creating this slideshow track via FFmpeg offers ability to specify a time range, when an image is to be shown)
  4. Since most players expect these thumb and cover images to be square, it should be possible to crop them or fit them into an empty image with given background color.

Perhaps it can be done like this: https://trac.ffmpeg.org/wiki/Slideshow (edit: this seems to create just a h264 video track, but not a JPEG track)
Somehow it seems to be necessary to tell the mp4 tracks/container that this is a menu track for the main track. Didn't find any info on that topic yet and was not able to produce something useful via FFmpeg by hand.

mediainfo output of the chapter thumbnail track (created via macOS app Audiobook Builder):

Video
ID                                       : 2
Format                                   : JPEG
Codec ID                                 : jpeg
Duration                                 : 7 h 15 min
Bit rate mode                            : Variable
Bit rate                                 : 204 b/s
Width                                    : 512 pixels
Height                                   : 512 pixels
Display aspect ratio                     : 1.000
Frame rate mode                          : Variable
Frame rate                               : 0.001 FPS
Minimum frame rate                       : 0.001 FPS
Maximum frame rate                       : 0.005 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.778
Stream size                              : 822 KiB (1%)
Title                                    : Apple Video Mediensteuerung / Apple Alias-Datensteuerung
Language                                 : English
Encoded date                             : UTC 2018-11-19 20:30:36
Tagged date                              : UTC 2018-11-19 20:30:36
Menu For                                 : 1

mp4info output:

2	video	jpeg, 26132.996 secs, 0 kbps, 512x512 @ 0.001263 fps

ffmpeg -i output (Stream #0:1 seems to be the chapter thumb track. The others seem to be metainfo text and the cover image):

    Metadata:
      creation_time   : 2018-11-19T20:30:03.000000Z
      handler_name    : Apple Ton Mediensteuerung
    Stream #0:1(eng): Video: mjpeg (jpeg / 0x6765706A), yuvj420p(pc, bt470bg/unknown/unknown), 512x512 [SAR 72:72 DAR 1:1], 0 kb/s, 0.0013 fps, 600 tbr, 600 tbn, 600 tbc (default)
    Metadata:
      creation_time   : 2018-11-19T20:30:36.000000Z
      handler_name    : Apple Video Mediensteuerung
      encoder         : Foto - JPEG
    Stream #0:2(eng): Data: bin_data (text / 0x74786574)
    Metadata:
      creation_time   : 2018-11-19T20:30:36.000000Z
      handler_name    : Apple Text-Mediensteuerung
    Stream #0:3: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1022x1022 [SAR 144:144 DAR 1:1], 90k tbr, 90k tbn, 90k tbc

Problem with german Umlauts

Hi,

if the Input or the putput file contains whitespaces the merge process Fails.
Environment: Windows10

with the parameter php m4b-tool.phar merge --output-file="D:\Drachenigel (Die bla Seiner igel 3).m4b" INPUTFOLDER

PHP Notice:  Undefined offset: 1 in phar://D:/Programme/m4b-tool-php/m4b-tool.phar/src/library/M4bTool/Command/AbstractCommand.php on line 202

Notice: Undefined offset: 1 in phar://D:/Programme/m4b-tool-php/m4b-tool.phar/src/library/M4bTool/Command/AbstractCommand.php on line 202

In MergeCommand.php line 324:

  could not get duration for file D:\Drachenigel (Die bla Seiner igel 3)-tmpfiles\1-1-finsihed.m4b

Metadata not written to mp3 files

I understand that the primary output for m4b-tool is m4b files, but the merge command does support mp3 output. When I try to merge a directory of already tagged mp3 files into a single mp3 file with chapters, I end up with an mp3 file with no tags (not even Artist, title, cover, etc.).

I have tried several variations, including defining output format, codec, --no-convert, --mark-chapters, etc. It appears that the tagging step is just skipped if the output format is mp3. I did a test build of a m4b file and it was properly tagged and chaptered.

If this tool doesn't support tagging output mp3s, I can completely understand, I just wanted to confirm I was not missing something.

Option '--use-existing-chapters-file' not recognized

$ m4b-tool.phar --version
m4b-tool v.0.3.1

I'm trying to use the option --use-existing-chapters-file to specify a chapters file I manually edited, and it gives the following error:

The "--use-existing-chapters-file" option does not exist.

In addition, the description for this feature in the doc/manual seems like it describes a different feature:

--use-existing-chapters-file           adjust chapter position by nearest found silence

Merge multiple m4b files without transcoding?

This seems to re-encode all the m4b files in the input folder, when I just want to merge them into a single m4b.

Does an option to skip the unnecessary re-encoding exist or is that feature not implemented yet?

Apple lossless codec 'alac' not working

It would be nice, to be able to encode audio books into a lossless codec, so that its possible to make final lossy encode of the audio stream at a later time.

ffmpeg supports Apple lossless codec 'alac'. Trying to produce a result with a command like this:

php ../m4b-tool.phar merge --audio-codec="alac" -d inputFolder --output-file="out.m4b"

results in that:

...
In MergeCommand.php line 328:

  could not convert /Users/test/inputFile.m4a to out-tmpfiles/inputFile.m4b

Its seems the problem is caused by the -f mp4 option, which is set on the final ffmpeg command, resulting in:

[mp4 @ 0x7ff18f00a400] Could not find tag for codec alac in stream #0, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 --

Omitting the -f mp4 option results in alac encoded m4a file to be correctly generated.

MIME type of merge files set as "video/mp4"

Merging .m4b files with original metadata reported by exiftool:

File Type : M4A
File Type Extension : m4a
MIME Type : audio/mp4

results in:

File Type : MP4
File Type Extension : mp4
MIME Type : video/mp4

I'm having trouble getting them to show up as audio in the default iOS Podcasts app. Seems Podcasts thinks they're video files and displays a video window. Is there anyway to fix already merged files rather than having to re-merge? Maybe some other tool?

Not detecting chapters?

Hi! Thanks for making this.

Sorry if I missed something, but is m4b-tool supposed to read chapters from the .m4b file when doing a split? I get an error when trying to split a file, that it's expecting a chapters.txt, but I expected it to extract that information from the file:

$ m4b-tool split book.m4b
Your ffmpeg version cannot produce top quality aac using encoder aac instead of libfdk_aac
export chapter list of book.m4b

In SplitCommand.php line 69:

  split command assumes that file .\book.chapters.txt exists and is readable

split [-d|--debug] [--debug-filename [DEBUG-FILENAME]] [-f|--force] [--no-cache] [--audio-format [AUDIO-FORMAT]] [--audio-channels [AUDIO-CHANNELS]] [--audio-bitrate [AUDIO-BITRATE]] [--audio-samplerate [AUDIO-SAMPLERATE]] [--audio-codec [AUDIO-CODEC]] [--adjust-for-ipod] [--name [NAME]] [--album [ALBUM]] [--artist [ARTIST]] [--genre [GENRE]] [--writer [WRITER]] [--albumartist [ALBUMARTIST]] [--year [YEAR]] [--cover [COVER]] [--skip-cover] [--use-existing-chapters-file] [--] <input>

The chapters in the file are already correct (ffprobe -i book.m4b -show_chapters shows them)

Feature Request: Force CBR

When I am using the merge tool with --audio-bitrate=64k, 99% of the time it spits out a file that is of a constant bitrate (CBR). However, occasionally it spits out a file that has a variable bitrate. This typically only happens with books that have longish gaps of silence. The reason this is a problem is that it makes it very difficult to place chapter marks after the fact. Files that are VBR have problems seeking and also have different (reported) duration by differing software. For instance Audacity will report one duration and timestamp and VLC a different duration and different timestamps. I would be awesome if all of this could be avoided by simply having m4b-tool enforce that the output file be CBR.

ChapterTitleBuilder.php crash

In ChapterTitleBuilder.php line 42:
                                                                           
  could not get duration for file data/merged-tmpfiles/01-01-finished.m4b  
                                                                           

I am running Arch Linux all i did was run the tool and it worked up until it threw this error unsure what I did wrong.

just ran
m4b-tool merge $(some input path) --output-file=$(some output path)

File order issues

As a general request, add input option for input file ordering.

More specifically, I am attempting to do something like the following:

m4b-tool merge --mark-tracks "file 1" "file 2" "another file" --output-file out.m4b

Now, the conversion and output are OK, and there are chapter marks in the output file, but...

  1. Chapter ORDER is incorrect - it appears the tool uses ALPHABETICAL ordering ("another file" placed before "file 1")
  2. Chapter NAME - Here the tool names the chapter using something like "01 - another file - finished", "02 - file 1 - finished", etc. Why is the "-finished" terminator being used?

For the input ORDER, as a minimum, it would be useful to have a flag to "preserve-order", meaning whatever the order of the input files on the command line, keep that order in the final file. I have tried to artificially put song/track numbers in the MP3s to force the order, but this seems to be ignored.

Output of batch-pattern is a just ".m4b"

The batch-pattern= with output-file= options end up causing a .m4b file with no filename and just the extension in the output. Which would be ok except because it just .m4b its invisible in Finder. In my option it would be great if it was the Book name.m4b in the Author folder or possible even better for the batch-pattern if it was something like -.m4b in the Output folder.

Multithreading

Just curious, is this tool multithreaded at all? Could it benefit from multithreading? I noticed that each m4b file when merging is created one at a time -- since I have 8 cores, could I potentially be creating 8 mb4 files at a time? Or is ffmpeg already multithreaded...

Curious to hear your thoughts.

Unable to build docker image

Hi,
On debian 9, I'm unable to build the docker image:

---- INSTALL BUILD DEPENDENCIES ----
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz: temporary error (try again later)
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz: temporary error (try again later)
ERROR: unsatisfiable constraints:

Merged files with incorrect chapter marks if extension m4a is used

I've yet to investigate what makes this happen but on one set of merged files, I have numerous instances of incorrect chapter marks.

In this case, the files are sourced from Audible. DRM removed losslessly. Their codec is AAC, around 62 kpbs bitrate, possibly constrained VBR but that's just a guess. I've heard VBR isn't recommended for podcasts since it can cause seeking problems. Unsure if that is a factor. Mp4chaps has an open pull request that might be related, unsure.

Opening up this issue before listing details and trying to find necessary info to document. Recommended steps? Without sharing files, maybe using some tool to list original file lengths and then chapters file from merge?

[feature request] performance improvements / multithreading / parallel execution

Just an idea. ffmpeg seems to have a very single threaded encoder for our workloads. Admittedly the speed isn't a huge deal but here is the thought anyways. Why not spawn multiple "worker threads". ffmpeg is the bottleneck so load say 8 or all of the jobs at once and let the commands go.

parameter like --encode-jobs=(number)

Unsure how feasible this is. Just a thought. Other than that I love this tool it saved me alot of time having to potentially write my own

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.