New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TagLib does not read metadata from some FLAC files #636

Closed
zuf opened this Issue Jul 28, 2015 · 6 comments

Comments

Projects
None yet
3 participants
@zuf

zuf commented Jul 28, 2015

Here one of this files: https://imgrush.com/Ca42b61_QKBS.flac (sha1sum: c06036398e7b6089b13d76624ad7fe99c94d8ca5)

Clementine (which uses taglib) reports this error messages:

17:55:58.289 DEBUG TagReader:129                    Reading tags from "/tmp/foo/Ca42b61_QKBS.flac" 
TagLib: FLAC::File::scan() -- FLAC stream corrupted
17:55:58.290 INFO  TagReader:139                    TagLib hasn't been able to read  "/tmp/foo/Ca42b61_QKBS.flac"  file 

But other tag readers can read tags from this file. For example exiftool:

ExifTool Version Number         : 9.90
File Name                       : Ca42b61_QKBS.flac
Directory                       : /tmp/foo/2015-07-28_flac
File Size                       : 12 MB
File Modification Date/Time     : 2015:07:28 14:36:29+03:00
File Access Date/Time           : 2015:07:28 16:55:18+03:00
File Inode Change Date/Time     : 2015:07:28 16:55:18+03:00
File Permissions                : rw-r--r--
File Type                       : FLAC
MIME Type                       : audio/flac
Block Size Min                  : 4096
Block Size Max                  : 4096
Frame Size Min                  : 590
Frame Size Max                  : 7043
Sample Rate                     : 44100
Channels                        : 2
Bits Per Sample                 : 16
Total Samples                   : 10454052
Vendor                          : reference libFLAC 1.2.1 20070917
Title                           : Reflective
Artist                          : Solar Quest
Date                            : 2014
Album                           : Core
Track Number                    : 12
Genre                           : Ambient, Dub, Downtempo
Totaltracks                     : 25
Albumartist                     : Solar Quest
Organization                    : Electronic Soundscapes
Picture Type                    : Front Cover
Picture MIME Type               : image/jpeg
Picture Description             : 
Picture Width                   : 0
Picture Height                  : 0
Picture Bits Per Pixel          : 0
Picture Indexed Colors          : 0
Picture Length                  : 485359
Picture                         : (Binary data 485359 bytes, use -b option to extract)
Duration                        : 0:03:57

ffprobe from ffmpeg also show metadata without errors:

Input #0, flac, from 'Ca42b61_QKBS.flac':
  Metadata:
    TITLE           : Reflective
    ARTIST          : Solar Quest
    DATE            : 2014
    ALBUM           : Core
    track           : 12
    GENRE           : Ambient, Dub, Downtempo
    TOTALTRACKS     : 25
    album_artist    : Solar Quest
    ORGANIZATION    : Electronic Soundscapes
  Duration: 00:03:57.05, start: 0.000000, bitrate: 417 kb/s
    Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
    Stream #0:1: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 700x700 [SAR 72:72 DAR 1:1], 90k tbr, 90k tbn, 90k tbc
    Metadata:
      comment         : Cover (front)

Tested with latest TagLib from git (e90b5e5)

@TsudaKageyu

This comment has been minimized.

Contributor

TsudaKageyu commented Jul 28, 2015

Your file has a zero-sized padding block. I'm not sure if the FLAC specification allows zero-sized metadata blocks or not... anyway, TagLib treats them as an error. However, TagLib itself may write such padding blocks and I reported it as a bug at #622.

It looks like exiftool and ffmpeg can handle such file. So I suggest that we don't treat zero-sized padding blocks as an error. Any thoughts?

@TsudaKageyu

This comment has been minimized.

Contributor

TsudaKageyu commented Jul 28, 2015

I found a discussion related to this issue at #98.
I think that it's safe and reasonable to allow only padding blocks to be empty.

@zuf

This comment has been minimized.

zuf commented Jul 29, 2015

If you ask my opinion, as a user, I want to read tags from my files even if that files not 100% standard compliant.

@TsudaKageyu

This comment has been minimized.

Contributor

TsudaKageyu commented Jul 29, 2015

Yes, IMHO, it's totally reasonable to be tolerant to those files.
It will be easy to fix it. But we have some pending pull requests and I'd like to hear someone else's opinion. So I'm going to wait some time.

@TsudaKageyu

This comment has been minimized.

Contributor

TsudaKageyu commented Jul 30, 2015

Fixed it. Thanks!

@FestusHagen

This comment has been minimized.

Contributor

FestusHagen commented Dec 21, 2015

Whoops, wrong place ...

-Enjoy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment