IPB

Welcome Guest ( Log In | Register )

> foobar2000 General Forum Rules

This is NOT a tech support forum.
Tech support questions go to foobar2000 Tech Support forum instead.

See also: Hydrogenaudio Terms of Service.

 
Reply to this topicStart new topic
Using newly added WavPack functions with foobar2000, foobar 0.9.6.9, WavPack 4.60
Robertina
post Oct 3 2009, 17:13
Post #1





Group: Members
Posts: 1212
Joined: 4-January 09
Member No.: 65169



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.
Go to the top of the page
+Quote Post
lvqcl
post Oct 3 2009, 17:54
Post #2





Group: Developer
Posts: 3206
Joined: 2-December 07
Member No.: 49183



What about this - http://www.hydrogenaudio.org/forums/index....st&p=659455
Go to the top of the page
+Quote Post
Robertina
post Oct 4 2009, 13:11
Post #3





Group: Members
Posts: 1212
Joined: 4-January 09
Member No.: 65169



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):
  1. The cover art pictures which were to be embedded missed in the conversion's target folder.
  2. 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
-m -i -q --write-binary-tag "Cover Art (Front)=@Front.png" - %d

CODE
-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.
Go to the top of the page
+Quote Post
bryant
post Oct 4 2009, 21:33
Post #4


WavPack Developer


Group: Developer (Donating)
Posts: 1287
Joined: 3-January 02
From: San Francisco CA
Member No.: 900



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... sad.gif
Go to the top of the page
+Quote Post
blofsy
post Mar 24 2010, 00:28
Post #5





Group: Members
Posts: 3
Joined: 24-March 10
Member No.: 79260



QUOTE (bryant @ Oct 4 2009, 21:33) *
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... sad.gif


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
Go to the top of the page
+Quote Post
Robertina
post Mar 24 2010, 03:34
Post #6





Group: Members
Posts: 1212
Joined: 4-January 09
Member No.: 65169



QUOTE (blofsy @ Mar 23 2010, 12:28) *
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!
Go to the top of the page
+Quote Post
kiit
post Mar 24 2010, 08:05
Post #7





Group: Members
Posts: 125
Joined: 9-October 03
From: Washington D.C.
Member No.: 9229



QUOTE (bryant @ Oct 4 2009, 12:33) *
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... sad.gif

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 smile.gif
Go to the top of the page
+Quote Post
blofsy
post Mar 24 2010, 10:51
Post #8





Group: Members
Posts: 3
Joined: 24-March 10
Member No.: 79260



QUOTE (Robertina @ Mar 24 2010, 03:34) *
QUOTE (blofsy @ Mar 23 2010, 12:28) *
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.

This post has been edited by blofsy: Mar 24 2010, 11:21
Go to the top of the page
+Quote Post
blofsy
post Mar 26 2010, 14:19
Post #9





Group: Members
Posts: 3
Joined: 24-March 10
Member No.: 79260



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.

This post has been edited by blofsy: Mar 26 2010, 14:34
Go to the top of the page
+Quote Post
bryant
post Mar 31 2010, 05:54
Post #10


WavPack Developer


Group: Developer (Donating)
Posts: 1287
Joined: 3-January 02
From: San Francisco CA
Member No.: 900



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.
Go to the top of the page
+Quote Post
tedgo
post Jul 1 2010, 12:49
Post #11





Group: Members
Posts: 1089
Joined: 16-April 04
From: Bavaria, Germany
Member No.: 13548



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
-hhilmqx --write-binary-tag "Cover Art (Front)=@C:\Users\Gerhard\Pictures\CD Cover\%artist% - %date% - %album%.*" - %d

but always get an error message:
CODE
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
  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
-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?

This post has been edited by tedgo: Jul 1 2010, 13:06
Go to the top of the page
+Quote Post
bryant
post Jul 2 2010, 04:55
Post #12


WavPack Developer


Group: Developer (Donating)
Posts: 1287
Joined: 3-January 02
From: San Francisco CA
Member No.: 900



QUOTE (tedgo @ Jul 1 2010, 04:49) *
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
Go to the top of the page
+Quote Post
tedgo
post Jul 2 2010, 09:10
Post #13





Group: Members
Posts: 1089
Joined: 16-April 04
From: Bavaria, Germany
Member No.: 13548



Thanks for your reply smile.gif

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

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).

This post has been edited by tedgo: Jul 2 2010, 10:03
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 16th April 2014 - 18:34