Closed jtbrough closed 4 months ago
Maybe try not using .
because this might cause issues regarding the path resolving.
I would create ./input/
and ./output/
directories and try this:
m4b-tool merge --jobs=10 input/ -o output/output.m4b
If this does not help, you can still try to run the batch variant, event if it is only one single audio book. Here is my personal config for paths like input/Fantasy/J.K.Rowling/Harry Potter and the Philosophers stone
:
m4b-tool merge --jobs=10 --batch-pattern="input/%g/%a/%n/" --batch-pattern-path="input/" "input/" --output-file="output/" --max-chapter-length=300,900 --adjust-for-ipod --audio-channels=1 --audio-bitrate=64k --audio-samplerate=22050 --audio-codec=libfdk_aac --audio-profile=aac_he --equate=name,album --ignore-source-tags --prepend-series-to-longdesc --silence-min-length=1000 --chapter-algo=grouping --skip-cover-if-exists
Thanks for that.
Interestingly...
m4b-tool merge input/ -o output/output.m4b --jobs=10
still results in:
PHP Warning: rename(output/output.m4b): Failed to open stream: Permission denied in phar:///usr/local/bin/m4b-tool-pre/src/library/Command/MergeCommand.php on line 983
PHP Warning: rename(/tmp/m4b-tool/tmp_output.m4b,output/output.m4b): Permission denied in phar:///usr/local/bin/m4b-tool-pre/src/library/Command/MergeCommand.php on line 983
Could not rename output file from /tmp/m4b-tool/tmp_output.m4b to output/output.m4b
an error occured, that has not been caught:
Array
(
[type] => 2
[message] => rename(/tmp/m4b-tool/tmp_output.m4b,output/output.m4b): Permission denied
[file] => phar:///usr/local/bin/m4b-tool-pre/src/library/Command/MergeCommand.php
[line] => 983
)
and just to share the working directories:
Permissions Size User Date Modified Name
drwxrwxr-x - jtbrough 7 Jul 18:39 input
drwxrwxr-x - jtbrough 7 Jul 18:39 output
still results in:
Strange... I'll try to EXACTLY reproduce that, but I don't think this is a problem of m4b-tool
, but more of a messed up permissions situation...
You could try to debug this using the m4b-tool
alias command and specifying an entry point of the shell, to "login" into the docker image and try to create files in the according directories
# "login" into the docker image shell
docker run --entrypoint /bin/ash -it ...<m4b-tool-alias-command>
# check permissions
cd /mnt/input
touch testfile
# run m4b-tool manually
m4b-tool merge --jobs=10 input/ -o output/output.m4b
The next thing you could try is to leave out the user mapping to run the docker image as root
:
# leave out the -u $(id -u):$(id -g)
alias m4b-tool='docker run -it --rm -v "$(pwd)":/mnt sandreas/m4b-tool:latest'
# run the merge
m4b-tool merge --jobs=10 input/ -o output/output.m4b
I report back if I can reproduce the problem on my system.
Well, removing the user mapping did the trick.
From
alias m4b-tool='docker run -it --rm -u $(id -u):$(id -g) -v "$(pwd)":/mnt sandreas/m4b-tool:latest'
To
alias m4b-tool='docker run -it --rm -v "$(pwd)":/mnt sandreas/m4b-tool:latest'
I'm not sure this is the ideal state, but it is working great now. I really appreciate your help, and the project.
Great, thanks for the feedback.
Hello,
Error:
v0.5-prerelease-28-g942e50
fv27.0.3
4.32.0 (157355)
KDE Neon 6.0 (Ubuntu 22.04 base)
1000
, gid:1000
Alias:
alias m4b-tool='docker run -it --rm -u $(id -u):$(id -g) -v "$(pwd)":/mnt sandreas/m4b-tool:latest'
Run Command:
m4b-tool merge . --output-file Output.m4b --jobs=10
I am aware of the note about relative paths with the alias, but no combination of path / output file references I've tried seems to address this error. Happy to provide further detail or testing as needed.
Thank you for the incredibly useful tool. I've been enjoying it for many years.