Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Using newly added WavPack functions with foobar2000 (Read 17468 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Using newly added WavPack functions with foobar2000

Do I possibly misunderstand the concept how foobar2000 works in connection with commandline encoders, in this case with WavPack, namely that the wavpack.exe does the conversion job while foobar is the graphical user interface for it?

So I wanted to benefit from the new functions coming with WavPack 4.60 and created in f2k a new custom converter preset with a correct path to the wavpack.exe and this parameters:

-m -i -q -t -w --write-binary-tag "Cover Art (Front)=@Front.png" - %d

The source file is a Microsoft 32 bit floating wav.

I got this error message: "An error occurred while writing to file ... (The encoder has terminated prematurely with code 1; please re-check parameters)... Conversion failed".

All conversions with foobar's "WavPack, normal" default setting work well, but my aim is to let the file's time stamp unchanged (-t) and to add the Cover picture which is in the same folder as the track I want to convert.

Now I cannot figure out what I am doing wrong and would be very glad for help.
This is HA. Not the Jerry Springer Show.


Using newly added WavPack functions with foobar2000

Reply #2
Thank you for the link, lvqcl, it helped me a lot.

So two facts caused the encoder's failure on my system (Windows XP, foobar2000 0.9.6.9, WavPack 4.60):
  • The cover art pictures which were to be embedded missed in the conversion's target folder.
  • The Cover art pictures I used in my testing environment later were to large, either in their file sizes (1,5 MB) or in their dimensions (1280 x 1024 pixels).
Additionally I think that the parameter "-w" as posted above is unnecessary because already included in the "--write-binary-tag"-command (or am I wrong?)

So this works now:
Code: [Select]
-m -i -q --write-binary-tag "Cover Art (Front)=@Front.png" - %d

Code: [Select]
-m -i -q --write-binary-tag "Cover Art (Front)=@Front.png" --write-binary-tag "Cover Art (Back)=@Back.png" - %d

Thank you, bryant, for your new version of WavPack, now I am able to embed pictures in WavPack files via foobar without the need for additional software.

Robertina.
This is HA. Not the Jerry Springer Show.

Using newly added WavPack functions with foobar2000

Reply #3
Yes, the extra -w was not needed for the reason you site. Also, the -t will not work because the input is a pipe (which has no date), but I see you took that out also.

However, I had forgotten about the 1 MB limit I put on tag items created from a file, and after a little more investigation I realized that I have a nasty situation here. The APEv2 tag loading code does not recognize APEv2 tags over 1 MB in size, but unfortunately the tag creation code will allow creating tags with over 1 MB. So, it’s possible to add, for example, two 700K images to a tag and get no error indication at that point, but then the tag is not recognized by the WavPack library.

I don’t believe that there is any spec on the maximum size of an APEv2 tag, nor on the maximum size of a single item. The original spec by Frank Klemm specified an 8K limit, but that is too small to handle reasonably sized cover art. I arbitrarily chose 1 MB, but I’m not really sure what the best number should be.

Thanks for bringing this to my attention! Unfortunately, I think this means I need to do a 4.60.1 release... 

Using newly added WavPack functions with foobar2000

Reply #4
Yes, the extra -w was not needed for the reason you site. Also, the -t will not work because the input is a pipe (which has no date), but I see you took that out also.

However, I had forgotten about the 1 MB limit I put on tag items created from a file, and after a little more investigation I realized that I have a nasty situation here. The APEv2 tag loading code does not recognize APEv2 tags over 1 MB in size, but unfortunately the tag creation code will allow creating tags with over 1 MB. So, it’s possible to add, for example, two 700K images to a tag and get no error indication at that point, but then the tag is not recognized by the WavPack library.

I don’t believe that there is any spec on the maximum size of an APEv2 tag, nor on the maximum size of a single item. The original spec by Frank Klemm specified an 8K limit, but that is too small to handle reasonably sized cover art. I arbitrarily chose 1 MB, but I’m not really sure what the best number should be.

Thanks for bringing this to my attention! Unfortunately, I think this means I need to do a 4.60.1 release... 


Hi,

I'm trying to embed some pictures as you described above (and as the manual says) but I can only embed .jpg pictures. It would be nice if I could embed png. The manual doesn't state that it is restricted to jpg only so I think it should be possible after all. All my pictures are under 1 MB.

Greetings

Using newly added WavPack functions with foobar2000

Reply #5
I'm trying to embed some pictures as you described above (and as the manual says) but I can only embed .jpg pictures. It would be nice if I could embed png. The manual doesn't state that it is restricted to jpg only so I think it should be possible after all. All my pictures are under 1 MB.

blofsy,

have you checked out my example patterns two posts above yours? They are working!
This is HA. Not the Jerry Springer Show.

Using newly added WavPack functions with foobar2000

Reply #6
I arbitrarily chose 1 MB, but I’m not really sure what the best number should be.

Thanks for bringing this to my attention! Unfortunately, I think this means I need to do a 4.60.1 release... 

Given the encoder doesn't pad to the full 1MB then wouldn't some extremely large limit make sense? The user could choose whether they wanted to (foolishly) include multi-megabytes of data in the tags or not. Or would the encoder try to allocate system RAM for the extreme case regardless of the actual size of the file/tag to be added? That would be bad.

At any rate I think 1MB might be a bit small today with the utterly massive amounts of both memory and storage available to us even on mobile devices. But even my largest artwork is under the 1MB limit, so I have never run into the current limit myself, though I could see where I might if I did my scans using PNG for the higher quality, instead of JPG (which really does mess with the colors even at a low compression ratio).

Wavpack is my codec of choice, so thank you again for this amazing software, bryant

Using newly added WavPack functions with foobar2000

Reply #7
I'm trying to embed some pictures as you described above (and as the manual says) but I can only embed .jpg pictures. It would be nice if I could embed png. The manual doesn't state that it is restricted to jpg only so I think it should be possible after all. All my pictures are under 1 MB.

blofsy,

have you checked out my example patterns two posts above yours? They are working!


Robertina,

Of course as I said I've checked both the manual and the commands used by you but no joy. ( I used the command exactly as you described in your post )

EDIT: Interesting. Yesterday i've tried three times and didn't work and now it worked flawlessly.

Using newly added WavPack functions with foobar2000

Reply #8
I wasn't aware of the fact that all of the images (disc, front, back) are embed into one APEv2 tag which is very limitied if you want to use "hq" .png pics.

Using newly added WavPack functions with foobar2000

Reply #9
This is a good question. The original spec for APEv2 tags from Frank Klemm specified an absolute maximum of 8 Kbytes (with a flashing NEVER to emphasize), but these were intended to be interspersed throughout the file so a decoder would have to be able to skip over them without a hiccup.

I don’t think APEv2 tags were ever used inside files, and eventually people were putting pictures inside APEv2 tags for cover art, and so now there’s no real spec on how big is too big.

I arbitrarily chose 1 Mbyte because WavPack blocks have a limit of 1 Mbyte, and WavPack will give up looking for a WavPack block after 1 Mbyte. Also, the WavPack library allocates enough memory for the whole tag when it retrieves it from a file being played. On a PC, 1 Mbyte for this would be nothing, but on a phone this would be big allocation, and on Rockbox it would be unthinkable. Also on a small device scanning though a 1 Mbyte tag would take a non-trivial amount of time and could make it difficult to remain gapless (WavPack will do this even if the entire length of the audio has been decoded).

The intent of embedded art in a APEv2 tag, at least from my perspective, is to store something suitable for display on a portable device or a popup display like winamp has, and certainly 1 Mbyte is enough for that. I would recommend some other method be employed for storing multiple high-resolution scans if those were desired, but I am open to other suggestions.

 

Using newly added WavPack functions with foobar2000

Reply #10
Sorry for bumping this up, but i have a problem using --write-binary-tag with foobar2000.

I tried to encode an image file with embedded cuesheet and embedded front cover using this string:
Code: [Select]
-hhilmqx --write-binary-tag "Cover Art (Front)=@C:\Users\Gerhard\Pictures\CD Cover\%artist% - %date% - %album%.*" - %d

but always get an error message:
Code: [Select]
Could not load info (Object not found) from:
"C:\Users\Gerhard\Music\Image\Erasure\1988 - The Innocents.wv"


and the console output says (snippet...):
Code: [Select]
  Conversion failed: The encoder has terminated prematurely with code 1 (0x00000001); please re-check parameters
Source: "C:\Users\Gerhard\Music\Unbearbeitet\Albums\Erasure\1988 - The Innocents\02. Ship Of Fools.wv"
  An error occurred while writing to file (The encoder has terminated prematurely with code 1 (0x00000001); please re-check parameters) : "C:\Users\Gerhard\Music\Image\Erasure\1988 - The Innocents.wv"
Additional information:
Encoder stream format: 44100Hz / 2ch / 16bps
Command line: "C:\Program Files (x86)\foobar2000\wavpack.exe" -hhilmqx --write-binary-tag "Cover Art (Front)=@C:\Users\Gerhard\Pictures\CD Cover\Lossless\Erasure - 1988 - .*" - "1988 - The Innocents.wv"
Working folder: C:\Users\Gerhard\Music\Image\Erasure\

  Conversion failed: The encoder has terminated prematurely with code 1 (0x00000001); please re-check parameters
  Could not write chapter information: Object not found


No problem when i encode to separate files instead of an image file with embedded cuesheet.
It looks like wavpack (or foobar2000?) refuses to recognize the %album% part of the string when encoding to an image file, but recognizes it for separate files.
Any workaround?

EDIT:
It works with this string:
Code: [Select]
-hhilmqx --write-binary-tag "Cover Art (Front)=@C:\Users\Gerhard\Pictures\CD Cover\%artist% - %date%*" - %d

But this is not very convenient because sometimes there are more than one picture from the same artist and the same year in the folder...
Any other ideas?

Using newly added WavPack functions with foobar2000

Reply #11
No problem when i encode to separate files instead of an image file with embedded cuesheet.
It looks like wavpack (or foobar2000?) refuses to recognize the %album% part of the string when encoding to an image file, but recognizes it for separate files.
Any workaround?

The expansion of the %album% is done in foobar. It's a little weird that it would handle it correctly for separate files but not whole images, but there might be some logic behind that.

Just on a hunch I would try %title% and see if that worked for images. If not, I would suggest that you post this on the foobar forum because those guys are very likely not reading this thread. Good luck!

David

Using newly added WavPack functions with foobar2000

Reply #12
Thanks for your reply

And yes, it works with the %title% tag.
(Haven't thought about that on an image file the %album% tag is handled as %title%...  )

EDIT: I'm using foobar2000 v1.0.3 (have seen this thread is about 0.9.6.9 in the threads subtitle. Sorry. Maybe i should have opened an own thread...).

EDIT2: Now i tried with a %catalog% tag (i always tag the catalog number to my files and thought now it could be more convinient for my string instead of using %artist% - %date% - %title%, especially when encoding albums with various artists...), and it is the same.
The tag isn't recognized by converter with "Generate multi-track files" but IS recognized with "Convert each track to an individual file".

Any ideas for a workaround?
What tags are present for cuesheets to use in converter?
I need something to asign an explicit cover to an album without the %artist% tag (for the use with Various artists).