-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker on Windows #204
Comments
Oh, this is a nice hint. Thank you very much for pointing this out. |
For reference, here at the bugs related to WSL2 and python (not limited to usage in docker). microsoft/WSL#5074 I didn't try building in WSL2, just using docker, but based on these bugs I think the tool would also struggle in WSL2. To give a sense, I was merging around 400 books, It worked for all of them, but 1/4 of them were missing portions in the audiobook. Debugging showed that they were only grabbing a portion of the files. Moving to Hyper-V-based docker solved it and everything went to working as expected. |
Or at the very least we could mention Windows AND wsl2 not working correctly rn. Currently the docker version runs flakey on my W11. |
@ruoti I created a separate issue to track, but it seems like you might have seen or confirm not seeing some of the issues I'm mentioned in #222. Would you be able to advice or suggest any other things to try. I have turned off my wsl2 integration (so I think I'm using hypervisor as I can only run it from the windows side now, powershell etc), and I still have the issue. |
As I already mentioned in #222, it may be possible, that using a docker run -it --rm -u $(id -u):$(id -g) \
--mount type=bind,source=$FOLDER,target=/mnt
sandreas/m4b-tool:latest merge "./$(echo $NAME)_splitted/" --output-file="./$NAME.m4b" --jobs=$(nproc --all) But it does not fix #222 ... so something is still fishy. |
@kanjieater It is not the wsl integration you need to change. It is the docker engine. It has to be set to use WSL1. |
I tried the bind mount just now. Sadly it did not help for me on WSL2 and Windows 11. |
Thanks for sharing this idea. Would you mind sharing what command you run to sub in the list from |
Sure! The conversion from |
You are right, forgot about that part. I did not risk it and made sure the order in the command is correct and not just the direct ls output. |
I've been trying to get this to work, but how are you passing the list from ls to the merge command. Please include code snippet🙏 EDIT: I ended up using this: #!/bin/bash
audiobooks_path="/mnt/a/audiobooksm4b/"
# Loop over each audiobook folder
for audiobook_folder in "${audiobooks_path}"/*/
do
# Print out the name of the audiobook folder
echo "Merging files in ${audiobook_folder}..."
# Get the audiobook name
audiobook_name="$(basename "${audiobook_folder}")"
# Get the list of mp4 files in the audiobook folder
mp4_files=$(ls -1v "${audiobook_folder}"*.mp4)
# Replace audiobooks_path with "./" in each mp4 file path
mp4_files=$(echo "$mp4_files" | sed "s|${audiobook_folder}|./|g")
# Wrap each mp4 file path in quotes
mp4_files=$(echo "$mp4_files" | awk '{printf "\"%s\" ", $0}')
# Run the m4b-tool Docker container to merge the MP4 files
docker_cmd="docker run -it --rm -u $(id -u):$(id -g) -v \"${audiobook_folder}\":/mnt sandreas/m4b-tool:latest merge ${mp4_files} --output-file \"./${audiobook_name}.m4b\" --jobs $(nproc --all)"
echo "$docker_cmd"
eval "$docker_cmd"
done |
There is no code snippet. I just copied the output of ls into VS Code and removed the newlines so that I have all files in a single line and pasted it into the merge command. |
In the documentation for using m4b-tool through Docker on Windows, you state "Note: If you are on windows, it might be difficult to make it work".
I was able to get m4b-tool to work on Windows through docker without too much challenge. There are two things that you must do:
$(pwd)
with${PWD}
in docker commands:Other than that, it works as you would expect. It might be worth adding a section on this to the docs for Windows users.
The text was updated successfully, but these errors were encountered: