Skip to main content

Topic: WavPack metadata (APEv2 tag) editor, with ID3 in DSF import (Read 3786 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • bryant
  • [*][*][*][*][*]
  • Developer (Donating)
WavPack metadata (APEv2 tag) editor, with ID3 in DSF import
After a while using the really nice Linux CD ripper abcde I realized that WavPack really needed a metadata utility (like metaflac). The command-line program is fine for adding tags during encoding, but sometimes you just need to add or edit them afterwards (in abcde's case that's cuesheets and album art). This has actually been possible for a while using the transcode function, and I've used that many times with small lossless files, but it becomes a little silly with large files (especially if encoded with x6) or in scripts!

There was also a discussion about Sony's DSF files because they have ID3 tags at the end. WavPack stores these as “wrapper” so that they can be restored verbatim, but there was no way to access the tags themselves stored that way. So I added an option to this new tagging utility to import these ID3 tags (including cover art) into APEv2 tags. If this turns out to be usable, I'll bring it into the command-line encoder too (although I'm not sure about it being the default behavior).

Here's the help display:
Code: [Select]
 Usage:
    WVTAG [-options] file[.wv]

    Wildcard characters (*,?) may be included in the filename. All options
    and operations specified are applied to each file in this order:
    clean, import, delete, write, extract, list.

 Options:
    --allow-huge-tags     allow tag data up to 16 MB (embedding > 1 MB is not
                           recommended for portable devices and may not work
                           with some programs including WavPack pre-4.70)
    -c                    extract cuesheet only to stdout
                           (note: equivalent to -x "cuesheet")
    -cc                   extract cuesheet file (.cue)
                           (note: equivalent to -xx "cuesheet=%a.cue")
    --clean or --clear    clean all items from tag (done first)
    -d "Field"            delete specified metadata item (text or binary)
    -h or --help          this help display
    --import-id3          import ID3v2 tags from the trailer of DSF files only
    -l or --list          list tags (done last)
    --no-utf8-convert     assume tag values read from files are already UTF-8,
                           don't attempt to convert from local encoding
    --pause               pause before exiting (if console window disappears)
    -q                    quiet (keep console output to a minimum)
    -v or --version       write the version to stdout
    -w "Field="           delete specified metadata item (text or binary)
    -w "Field=Value"      write specified text metadata to APEv2 tag
    -w "Field=@file.ext"  write specified text metadata from file to APEv2
                           tag, normally used for embedded cuesheets and logs
                           (field names "Cuesheet" and "Log")
    --write-binary-tag "Field=@file.ext"
                          write the specified binary metadata file to APEv2
                           tag, normally used for cover art with the specified
                           field name "Cover Art (Front)"
    -x "Field"            extract specified tag field only to stdout
    -xx "Field[=file]"    extract specified tag field to file, optional
                           filename spec can include these replacement codes:
                             %a = source filename
                             %t = tag field name
                                 (note: comes from data for binary tags)
                             %e = extension from binary tag source file
                                 (or 'txt' for text tag)
    -y                    yes to overwrite warning (use with caution!)

Any feedback is appreciated...enjoy!
edit: link deleted
  • Last Edit: 20 January, 2017, 07:59:02 PM by bryant

  • bryant
  • [*][*][*][*][*]
  • Developer (Donating)
Re: WavPack metadata (APEv2 tag) editor, with ID3 in DSF import
Reply #1
I have released WavPack 5.1.0 incorporating this command-line program, and have incorporated the ID3v2 import feature into the command-line encoder as well.

  • prezi
  • [*]
Re: WavPack metadata (APEv2 tag) editor, with ID3 in DSF import
Reply #2
I have problem.
This is my dsf file:
https://www.dropbox.com/s/p6gaxooxqqm8q84/test.dsf.xz?dl=0

I tried:
wavpack   -h --import-id3 -i test.dsf

but ID3 tags from dsd file have not been copied into wv file. What I did wrong?

  • lvqcl
  • [*][*][*][*][*]
  • Developer
Re: WavPack metadata (APEv2 tag) editor, with ID3 in DSF import
Reply #3
foobar2000 shows that your file has id3v2.4 tag. Probably wavpack works only with id3v2.3.

  • prezi
  • [*]
Re: WavPack metadata (APEv2 tag) editor, with ID3 in DSF import
Reply #4
So I tried kid3-qt. I set in properties id3 v2.3. Then I changed album title and saved. The same. DSD file I have is produced by sacd_extract. I'm from world of vorbistags (flac, ogg) and I'm not familiar with id3. Is there relevant difference between id3 v2.3 and v2.4?

  • kode54
  • [*][*][*][*][*]
  • Administrator
Re: WavPack metadata (APEv2 tag) editor, with ID3 in DSF import
Reply #5
There are many relevant differences between v2.3 and v2.4. Probably too many to quickly list here. UTF-8 support, new frame types...

  • prezi
  • [*]
Re: WavPack metadata (APEv2 tag) editor, with ID3 in DSF import
Reply #6
ok, so I tried id3v2 2.3.0 with the same effect:
https://www.dropbox.com/s/kjitnq37fpc2dv7/test3.dsf.xz?dl=0


  • bryant
  • [*][*][*][*][*]
  • Developer (Donating)
Re: WavPack metadata (APEv2 tag) editor, with ID3 in DSF import
Reply #7
Thanks for posting this issue!

The first file you uploaded does have ID3v2.4 tags, which WavPack does not support now. It should not be too hard, so I will look into getting that to work.

The second file you posted has ID3v2.3 tags (like you said) and that worked correctly in WavPack. What problem did you have? There was an issue that there were two “Artist” tags and the second one was “XXX' and overwrote the first one “Fritz Reiner...”. This is not supposed to be in ID3v2 tags and was not in the original file, so this is something maybe kid3-qt did wrong, but everything else was okay.

You say the original file came from sacd_extract. Do you know what version? I have tried version 0.3.6 and 0.3.7 and 0.3.8 and they all only put ID3v2.3 tags on DSF files, so I'm not sure why it's doing this. Maybe they changed it a long time ago?

  • prezi
  • [*]
Re: WavPack metadata (APEv2 tag) editor, with ID3 in DSF import
Reply #8
What option to in wavpack encoder do you use?

  • prezi
  • [*]
Re: WavPack metadata (APEv2 tag) editor, with ID3 in DSF import
Reply #9
Ok, please take a look at this:
https://www.dropbox.com/s/z8lpvn5g2s2bjje/test_pure_sacdextract.dsf.xz?dl=0

I tried sacd_exctract 0.38

$ wavpack --version
wavpack 5.1.0
libwavpack 5.1.0

$ ldd /usr/bin/wavpack
linux-vdso.so.1 (0x00007ffe799f1000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fc0ab512000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc0ab174000)
/lib64/ld-linux-x86-64.so.2 (0x00005629a666f000)

I encoded dsf with wavpack in such way:
$ wavpack --import-id3 -i test_pure_sacdextract.dsf

metadsf says:
$ metadsf -i test_pure_sacdextract.dsf
DSD version=1
Sample rate=2822400Hz
No. of channels=2
Channel type=Stereo
Length=102s
No. of samples=288148224
Bits per sample=1
Metadata offset=72040540
File size=72040720
ID3v2 version=2.3.0
Tag size=180 bytes

according to `metadsf -t` such tags are set in this dsf file:
TIT2, TPE1, TALB, TCON, TDRC and TRCK.

after encoding dsf to wv wvunpack says:
$ wvunpack -ss test_pure_sacdextract.wv

 WVUNPACK  Hybrid Lossless Audio Decompressor  Linux Version 5.1.0
 Copyright (c) 1998 - 2017 David Bryant.  All Rights Reserved.

file name:         test_pure_sacdextract.wv
file size:         46156788 bytes
source:            1-bit DSD at 2822400 Hz
channels:          2 (stereo)
duration:          0:01:42.09
modalities:        lossless
compression:       35.93%
ave bitrate:       3617 kbps
encoder version:   5
source format:     Sony DSF with 'dsf' extension
file wrapper:      92 byte DSD  header

mediainfo also shows no tags in this wv file.



  • bryant
  • [*][*][*][*][*]
  • Developer (Donating)
Re: WavPack metadata (APEv2 tag) editor, with ID3 in DSF import
Reply #10
Thanks for posting all this! I will try this file a little later, but I'm pretty sure I know what the problem is.

You should not be using the -i option with wavpack. This causes the program to ignore the length in the header and assume all the data is DSD audio to the end of the file. But in this case, that will be the ID3v2 tag, so it will get lost (and I can see by your wvunpack output that the trailer was lost). You might also hear a little "tick" at the end of the file when playing it because your tag will be audio data now.

Try taking out the -i and see if that works better, and sorry for the confusion.

BTW, I'm still not sure where the original ID3v2.4 tags came from on the other file. Were those from sacd_extract also?

  • prezi
  • [*]
Re: WavPack metadata (APEv2 tag) editor, with ID3 in DSF import
Reply #11
no, I think kid3-qt or picard.

  • prezi
  • [*]
Re: WavPack metadata (APEv2 tag) editor, with ID3 in DSF import
Reply #12
any way you are right, "-i" is a reason of my mess. without this --import-id3 works just fine. sorry for taking your time, I'm a wavpack rookie.

  • bryant
  • [*][*][*][*][*]
  • Developer (Donating)
Re: WavPack metadata (APEv2 tag) editor, with ID3 in DSF import
Reply #13
any way you are right, "-i" is a reason of my mess. without this --import-id3 works just fine. sorry for taking your time, I'm a wavpack rookie.
I'm glad the fix was so easy, and I hope WavPack works out for you!

Re: WavPack metadata (APEv2 tag) editor, with ID3 in DSF import
Reply #14
After a while using the really nice Linux CD ripper abcde I realized that WavPack really needed a metadata utility (like metaflac). The command-line program is fine for adding tags during encoding, but sometimes you just need to add or edit them afterwards (in abcde's case that's cuesheets and album art). This has actually been possible for a while using the transcode function, and I've used that many times with small lossless files, but it becomes a little silly with large files (especially if encoded with x6) or in scripts!

Thanks for this great utility! Initial support for using wvtag to embed album art post-encode has been added to the development version of abcde. Still needs a little fine-tuning which I will have to do from time to time at the moment but it certainly works well enough on my system.

Thanks for this  ;D

  • bryant
  • [*][*][*][*][*]
  • Developer (Donating)
Re: WavPack metadata (APEv2 tag) editor, with ID3 in DSF import
Reply #15
Thanks Andrew, that's great news! I'll be interested to try it out.

As far as I know, this is the first application to utilize wvtag, so I'm glad I decided to go forward with that.