IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
removing binary tags from wavpack files
BearcatSandor
post Dec 9 2012, 21:34
Post #1





Group: Members
Posts: 155
Joined: 18-May 10
From: Montana, USA
Member No.: 80732



Running Gentoo Linux

I have some wavpackfiles that contain the tag
Cover Art (front)=[603264 bytes]


This is causing issues (overruns) with my file converter. Looking around the wavpack documentation i don't see how to remove those tags. My tag editors (exfalso and picard) don't seem to recognize that the tags exist, but mutagen-inspect and mplayer see them.

How can i remove them?

Thanks


--------------------
Music lover and recovering high end audiophile
Go to the top of the page
+Quote Post
bryant
post Dec 11 2012, 15:36
Post #2


WavPack Developer


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



I'm not sure about any Linux tool to do that...obviously something like Mp3Tag for Windows would do it.

I created a quick patch for wvgain to add a -b option to remove all binary items that should do the trick (I know you've been building the cli programs). The only disadvantage of this method is that when the WavPack library is used to edit tags the files cannot become smaller (a gap is added before the tag) so in your case you would be wasting that 600k.

I spent about 15 minutes on this, so please make a backup of your files before trying it and maybe try a few files first and make sure it really fixes your problem (and doesn't break something else). I would still use a Windows tool instead... smile.gif

Sorry about the codebox...the system would not let me attach this type of file (whatever that means).

David

CODE

--- cli/wvgain.c (revision 247)
+++ cli/wvgain.c (working copy)
@@ -72,6 +72,7 @@
" Usage: WVGAIN [-options] [@]infile[.wv] [...]\n"
" (infiles may contain wildcards: ?,*)\n\n"
" Options: -a = album mode (all files scanned are considered an album)\n"
+" -b = remove binary tags from all files (no ReplayGain analysis)\n"
" -c = clean ReplayGain values from all files (no analysis)\n"
" -d = display calculated values only (no files are modified)\n"
" -i = ignore .wvc file (forces hybrid lossy)\n"
@@ -92,7 +93,7 @@
#define HISTOGRAM_SLOTS 12000
static uint32_t track_histogram [HISTOGRAM_SLOTS], album_histogram [HISTOGRAM_SLOTS];

-static char album_mode, clean_mode, display_mode, ignore_wvc, quiet_mode, show_mode, new_mode;
+static char album_mode, clean_mode, remove_binary_mode, display_mode, ignore_wvc, quiet_mode, show_mode, new_mode;
static int num_files, file_index;

/////////////////////////// local function declarations ///////////////////////
@@ -161,6 +162,10 @@
album_mode = 1;
break;

+ case 'B': case 'b':
+ remove_binary_mode = 1;
+ break;
+
case 'C': case 'c':
clean_mode = 1;
break;
@@ -213,7 +218,7 @@

// check for various command-line argument problems

- if (clean_mode && (album_mode || display_mode || show_mode)) {
+ if ((remove_binary_mode || clean_mode) && (album_mode || display_mode || show_mode)) {
error_line ("clean mode can't be used with album, show, or display mode!");
++error_count;
}
@@ -335,7 +340,7 @@
// track of everything and modify the tags in another pass. If we're not in
// album mode then we can update the files here.

- for (file_index = 0; !clean_mode && !show_mode && file_index < num_files; ++file_index) {
+ for (file_index = 0; !remove_binary_mode && !clean_mode && !show_mode && file_index < num_files; ++file_index) {
if (check_break ())
break;

@@ -419,7 +424,7 @@
// the tags (or just show existing stored values).

if (result != HARD_ERROR)
- for (file_index = 0; (clean_mode || album_mode || show_mode) && !display_mode && file_index < num_files; ++file_index) {
+ for (file_index = 0; (remove_binary_mode || clean_mode || album_mode || show_mode) && !display_mode && file_index < num_files; ++file_index) {
if (check_break ())
break;

@@ -624,9 +629,26 @@
return SOFT_ERROR;
}

- if (clean_mode) {
+ if (remove_binary_mode) {
int items_removed = 0;
+ char tag_item [256];

+ while (WavpackGetBinaryTagItemIndexed (wpc, 0, tag_item, sizeof (tag_item)))
+ if (WavpackDeleteTagItem (wpc, tag_item))
+ ++items_removed;
+ else
+ break;
+
+ if (!quiet_mode && items_removed) {
+ error_line ("%d binary items removed", items_removed);
+ write_tag = TRUE;
+ }
+ else
+ error_line ("no binary items found");
+ }
+ else if (clean_mode) {
+ int items_removed = 0;
+
if (WavpackDeleteTagItem (wpc, "replaygain_track_gain"))
++items_removed;

Go to the top of the page
+Quote Post
Mr_Rabid_Teddybe...
post Dec 11 2012, 17:17
Post #3





Group: Members
Posts: 1197
Joined: 3-September 03
From: Bergen, Norway
Member No.: 8667



QUOTE (bryant @ Dec 11 2012, 07:36) *
I'm not sure about any Linux tool to do that...obviously something like Mp3Tag for Windows would do it.


Mp3tag works fine under Wine, if one has Wine available....




--------------------
"ONLY THOSE WHO ATTEMPT THE IMPOSSIBLE WILL ACHIEVE THE ABSURD"
- Oceania Association of Autonomous Astronauts
Go to the top of the page
+Quote Post
bryant
post Dec 12 2012, 18:40
Post #4


WavPack Developer


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



QUOTE (Mr_Rabid_Teddybear @ Dec 11 2012, 08:17) *
Mp3tag works fine under Wine, if one has Wine available....

Thanks...that's probably a much better idea! smile.gif
Go to the top of the page
+Quote Post
BearcatSandor
post Dec 19 2012, 22:17
Post #5





Group: Members
Posts: 155
Joined: 18-May 10
From: Montana, USA
Member No.: 80732



Thanks folks. i finally got back to this and mp3tag worked fine under wine 1.4.1.

Bryant, do you want/need me to try to recreate these files and test your patch?


--------------------
Music lover and recovering high end audiophile
Go to the top of the page
+Quote Post
bryant
post Dec 20 2012, 19:59
Post #6


WavPack Developer


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



QUOTE (BearcatSandor @ Dec 19 2012, 13:17) *
Bryant, do you want/need me to try to recreate these files and test your patch?

No need to bother. Without recovering the space used by the deleted tags, it's not a recommended solution. Glad Mp3tag worked for you! smile.gif
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: 22nd December 2014 - 02:37