Closed snowbie closed 2 years ago
Thanks for reporting. I will need more information to be able to fix this however.
You quote the error, but not the command that lead to the error. Could you please copy the complete output including the command you used. If possible, please supply some files to enable me to reproduce this problem.
flac -1 "test2MB.flac" -o "test2MBout.flac"
flac git-c2daa371 20220530
Copyright (C) 2000-2009 Josh Coalson, 2011-2016 Xiph.Org Foundation
flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
welcome to redistribute it under certain conditions. Type `flac' for details.
test2MB.flac: ERROR initializing encoder
init_status = FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR
state = FLAC__STREAM_ENCODER_FRAMING_ERROR
Attached is an archive with all of the necessary files for testing + the outputs of each encoding attempt. Upon encoding, the file with 1MB art behaves as intended while the files with 2MB, 3MB, and 4MB art all output the same error. And, unique to the file with 4MB, is the inability for explorer to show any tag metadata, but I'm unsure if that's related. flactest-20220608-110236UTC.zip
May thanks for providing the information and the files, I will investigate.
With which program was the album art embedded into the FLAC file? The most probable cause is that the files you try to re-encode are corrupt because the album art was not properly embeded. You say the metadata of the files cannot be read by Windows Explorer, does it display correctly in other programs?
I'd have to explore other programs, but I used foobar2000 to embed the art. The metadata displays correctly there. I checked the 4MB file in MPC-HC (which uses libmediainfo), and it had no problem displaying the metadata unlike Windows Explorer. I'll try out other programs like mp3tag and see if they introduce the same issues.
I've looked at the files and they indeed do not seem corrupt. I'll have to look into this in more depth, might take a few weeks.
Once more thanks for reporting, luckily this is something not yet in any release. It turns out commit https://github.com/xiph/flac/commit/21d0640ea9db6a96bc4329c8f1bf6659f0141a1e is the culprit here, I'll fix this soon.
From my own tests, I'm confident this has something to do with the file-size of embedded art. a file with 2KB 6000x6000 art rencoded fine, but when I attached a 3.51MB 4000x4000 jpg to the file, it would not encode. When the art is then removed from the file, it will still not encode, spitting out the same error.
This is a pattern I've noticed over the last year or so and was finally able to associate the art with the error. I'm not sure exactly at which size the error begins. I think Windows explorer fails to read all file metadata once embedded art hits 4MB. Similarly, removing the art does not fix that. I often embed decent quality art encoded in webp (soon jxl) into the file, obtaining a good look while saving significant amounts of space. Sometimes, for reasons still unknown, that embedded art will somehow be reencoded into jpg, exploding the file size and preventing me from reencoding the file.
What does work is reencoding through foobar2000, even when I call the exact same flac.exe.