xiph/flac

Cannot empty or delete VORBIS_COMMENT vendor string

x0tester0x opened this issue · 13 comments

How can I empty or delete VORBIS_COMMENT vendor string while keeping the comments?

METADATA block #1
  type: 4 (VORBIS_COMMENT)
  is last: true
  length: 83
  vendor string: reference libFLAC 1.4.3 20230623
  comments: 1
    comment[0]:
ktmf01 commented

metaflac does not offer a way to do this currently.

Why do you want to remove it?

I want to remove it, because i do not want that, when I give files to other people, that they can see which tool I used to create the FLAC. So for example if I rip a bluray with MakeMKV, I want to remove, that in the vendor string they can see MakeMKV.

Can you please implement the feature to delete or empty the vendor string?

This feature is really important for me and I think that this is not a big change and so not much work to implement.
When will this feature be implemented?

ktmf01 commented

If you contribute a PR, it could be implemented next week. If not, I won't make any promises. As you can see from the issues list, there are open issues already 5 years old.

How can I empty or delete VORBIS_COMMENT vendor string while keeping the comments?

From your question I take it that you know how to remove the VORBIS_COMMENT block entire, so here is a work-around. It will leave a vendor string, but not the right one:

Dump the file(s) into Mp3tag
Ctrl-x the tags away
metaflac --remove --block-type VORBIS_COMMENT
In Mp3tag, hit Ctrl-z to undo.

Mp3tag will write back the tags, but not the correct vendor string - it will it will fill in a vendor string of some reference libflac version.

If you contribute a PR, it could be implemented next week. If not, I won't make any promises. As you can see from the issues list, there are open issues already 5 years old.

I am not very good at C programming... so I think I can only wait until this feature will be implemented

How can I empty or delete VORBIS_COMMENT vendor string while keeping the comments?

From your question I take it that you know how to remove the VORBIS_COMMENT block entire, so here is a work-around. It will leave a vendor string, but not the right one:

Dump the file(s) into Mp3tag Ctrl-x the tags away metaflac --remove --block-type VORBIS_COMMENT In Mp3tag, hit Ctrl-z to undo.

Mp3tag will write back the tags, but not the correct vendor string - it will it will fill in a vendor string of some reference libflac version.

That is not what I want... I want a empty string or delete the vendor string completely

Sure I read that. But it will serve this purpose:

that they can see which tool I used to create the FLAC.

If anonymity is what you seek, then replacing it by something common is more efficient than the empty string.

I cannot find in the code where it will write "vendor string: reference libFLAC 1.4.3 20230623".
Can someone show me?

ktmf01 commented

Sure. It is right here

#if (defined GIT_COMMIT_HASH && defined GIT_COMMIT_DATE)
# ifdef GIT_COMMIT_TAG
FLAC_API const char *FLAC__VERSION_STRING = GIT_COMMIT_TAG;
FLAC_API const char *FLAC__VENDOR_STRING = "reference libFLAC " GIT_COMMIT_TAG " " GIT_COMMIT_DATE;
# else
FLAC_API const char *FLAC__VERSION_STRING = "git-" GIT_COMMIT_HASH " " GIT_COMMIT_DATE;
FLAC_API const char *FLAC__VENDOR_STRING = "reference libFLAC git-" GIT_COMMIT_HASH " " GIT_COMMIT_DATE;
# endif
#else
/* PACKAGE_VERSION should come from configure */
FLAC_API const char *FLAC__VERSION_STRING = PACKAGE_VERSION;
FLAC_API const char *FLAC__VENDOR_STRING = "reference libFLAC " PACKAGE_VERSION " 20230623";
#endif

Ok and where in the metaflac code gets this called?

ktmf01 commented

That depends on what action metaflac does, specifically. Taking adding a vorbis comment block when there is none as an example, that would be.

Here:

block = FLAC__metadata_object_new(FLAC__METADATA_TYPE_VORBIS_COMMENT);

Then here:

if (!copy_bytes_(&object->data.vorbis_comment.vendor_string.entry, (const FLAC__byte*)FLAC__VENDOR_STRING, object->data.vorbis_comment.vendor_string.length+1)) {

I changed, as workaround for myself, the variable FLAC__VENDOR_STRING in the code to an empty string and rebuild the metaflac.exe.