-
Notifications
You must be signed in to change notification settings - Fork 174
Unable to open file for write error #197
Comments
Try again with most recent push. |
I'm having the same problem and i'm using the recent push. |
Edit: FIX: Just run it a couple of times - the chapter files should be written eventually, the error is meaningless. It looks like it tries to access the "complete" file which was not written because auf the chapter flag. So even though it looks like it fails it should actually work. Update2: looks like the meta data is not written completely and the playlist is not complete either I get the same error - what's interesting is, that the file which causes the error is not even supposed to be created, at least I don't see that in the other folders -> './Audiobook/AUTHOR/ALBUM/ALBUM.m4a' - since it should be chaptered there should not be a file with just the album name, should there?
|
I got the same error, each time :
|
Also running into this issue. |
Adding some details, I'm on the
Just for grins, I decided to try running this as root, since the original error seemed like a permission related problem and the output was slightly different. The file which previously could not be opened for write, was written, but the next process (creating the playlist) threw an error referring to the fact that the
The error seems to come from this section of the main executable: # If mode=chaptered, split the big converted file by chapter and remove it afterwards.
# Not all audio encodings make sense with multiple chapter outputs (see options section)
if [ "${mode}" == "chaptered" ]; then
# Playlist m3u support
playlist_file="${output_directory}/${currentFileNameScheme}.m3u"
if [ "${continue}" == "0" ]; then
if [ "$((${loglevel} > 0))" == "1" ]; then
log "Creating PlayList ${currentFileNameScheme}.m3u"
fi
echo '#EXTM3U' > "${playlist_file}"
fi
...
@dkbast I think that explains why that file "just-album-name" file is there, looks like it's temporary and meant to be deleted after the processing is finished. |
@carwin Can you try to modify Line 831 in 1544a89
| after > ? Like this: echo '#EXTM3U' >| "${playlist_file}" Explanation: https://mywiki.wooledge.org/NoClobber |
No change. Just for fun I tried appending to the file instead ( I think the playlist file may be a red herring, the core issue seems like it's to do with attempting action on the m4b file. |
Hi, The problem occurs when the book is chaptered. It tries to add image cover to the main file, which did not exist anymore because it was splitted in chapter files and then deleted. As a very very quick fix, you can add this around the add cover if (line 970) : if [ "${mode}" != "chaptered" ]; then and fi after at line 997 then put this in on line 942, just after if [ -f "${cover_file}" ]; then
log "Adding cover art"
# FFMPEG does not support MPEG-4 containers fully #
if [ "${container}" == "mp4" ] ; then
mp4art --add "${cover_file}" "${chapter_file}"
# FFMPEG for everything else #
else
# Create temporary output file name - ensure extention matches previous appropriate output file to keep ffmpeg happy
cover_output_file="${output_file%.*}.cover.${output_file##*.}"
# Copy audio stream from current output, and video stream from cover file, setting appropriate metadata
</dev/null "$FFMPEG" -loglevel quiet \
-nostats \
-i v \
-i "${cover_file}" \
-map 0:a:0 \
-map 1:v:0 \
-acodec copy \
-vcodec copy \
-id3v2_version 3 \
-metadata:s:v title="Album cover" \
-metadata:s:v comment="Cover (front)" \
"${cover_output_file}"
# Replace original output file with version including cover
mv "${cover_output_file}" "${chapter_file}"
fi
fi So it will add the cover to every chapter file. |
Hi there,
Firstly, thanks for the great tool. I love using this to free my audiobooks but have recently run into an issue with the latest source from the master branch. Everything seems to work fine until the combined file is to be written as m4a. Here is my console dump.
Neofetch dump:
Please shout if you need any other details from me or if I can help in any other way.
The text was updated successfully, but these errors were encountered: