xiph / flac

Free Lossless Audio Codec
https://xiph.org/flac/
GNU Free Documentation License v1.3
1.58k stars 278 forks source link

Cannot empty or delete MD5 of the unencoded content MD5 signature metadata #670

Closed x0tester0x closed 5 months ago

x0tester0x commented 5 months ago

How can I empty or delete MD5 of the unencoded content MD5 signature metadata?

METADATA block #0
  type: 0 (STREAMINFO)
  is last: true
  length: 34
  minimum blocksize: 4608 samples
  maximum blocksize: 4608 samples
  minimum framesize: 6227 bytes
  maximum framesize: 48904 bytes
  sample_rate: 48000 Hz
  channels: 8
  bits-per-sample: 16
  total samples: 525665280
  MD5 signature: 832e17350599c3f04fc10cc0be5b271f
ktmf01 commented 5 months ago

There is an undocumented metaflac option for this.

metaflac --set-md5sum=00000000000000000000000000000000 yourfile.flac
x0tester0x commented 5 months ago

Ok, but how can I completeley delete this metadata, so it does not show?

ktmf01 commented 5 months ago

That is not possible, doing so would produce an invalid file. See https://www.ietf.org/archive/id/draft-ietf-cellar-flac-14.html#name-streaminfo

The streaminfo metadata block has information about the whole stream, like sample rate, number of channels, total number of samples, etc. It MUST be present as the first metadata block in the stream.

So, there must be a streaminfo block (else the file is invalid) and each streaminfo block has an MD5 value. You can only set it to 'zero', which is understood as 'no MD5 stored'.

x0tester0x commented 5 months ago

Ok I understand. Thanks