Page 1 of 1

[SOLVED] Metadata extraction from MP3s

PostPosted: Fri Sep 07, 2012 6:16 pm
by Strupniveral
Hello,

I set Serviio to stream my MP3 collection; it's working pretty fine, with very few exceptions (5 songs from the same album out of few hundred). Basically few metadata are not extracted properly, according to my understanding

The following MP3 has the following metadata set (I can see the same values in iTunes, where I set them):
  Code:
log # ffmpeg -i /mnt/data/share/Downloads/Music/iTunes/iTunes\ Media/Music/Elio\ e\ le\ storie\ tese/Cicciput/09\ Pagano.mp3
ffmpeg version 0.7.8, Copyright (c) 2000-2011 the FFmpeg developers
  built on Mar  4 2012 12:10:47 with gcc 4.5.3
  configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --enable-shared --cc=i686-pc-linux-gnu-gcc --disable-static --enable-gpl --enable-postproc --enable-avfilter --disable-stripping --disable-debug --disable-doc --disable-vaapi --disable-ffplay --disable-vdpau --enable-libmp3lame --enable-libx264 --enable-libxvid --disable-indev=v4l --disable-indev=v4l2 --disable-indev=alsa --disable-indev=oss --disable-indev=jack --disable-outdev=alsa --disable-outdev=oss --enable-libfreetype --enable-pthreads --enable-librtmp --enable-libopenjpeg --disable-altivec --disable-avx --cpu=atom --enable-hardcoded-tables
  libavutil    50. 43. 0 / 50. 43. 0
  libavcodec   52.123. 0 / 52.123. 0
  libavformat  52.111. 0 / 52.111. 0
  libavdevice  52.  5. 0 / 52.  5. 0
  libavfilter   1. 80. 0 /  1. 80. 0
  libswscale    0. 14. 1 /  0. 14. 1
  libpostproc  51.  2. 0 / 51.  2. 0
[mp3 @ 0x8a91e00] max_analyze_duration 5000000 reached at 5015510
[mp3 @ 0x8a91e00] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '/mnt/data/share/Downloads/Music/iTunes/iTunes Media/Music/Elio e le storie tese/Cicciput/09 Pagano.mp3':
  Metadata:
    title           : Pagano
    artist          : Elio e le storie tese
    album           : Cicciput
    date            : 2003
    track           : 9/13
    album_artist    : Elio e le storie tese
    genre           : Rock
  Duration: 00:05:32.06, start: 0.000000, bitrate: 191 kb/s
    Stream #0.0: Audio: mp3, 44100 Hz, stereo, s16, 192 kb/s
At least one output file must be specified
 log #


But checking at the logs, I can see the following:
  Code:
2012-09-07 20:11:06,448 DEBUG [LibraryManager] Metadata found via extractor EMBEDDED: AudioMetadata [album=Cicciput, albumArtist=null, bitrate=192, channels=2, coverImage=null, duration=330, genre=, releaseYear=2003, trackNumber=null, author=null, date=Fri Sep 07 08:10:32 CEST 2012, filePath=/mnt/data/share/Downloads/Music/iTunes/iTunes Media/Music/Elio e le storie tese/Cicciput/09 Pagano.mp3, fileSize=7969573, container=MP3, title=Pagano]


What I don't clearly understanding is that the following song, taken from the very same album, looks the same according to ffmpeg output:
  Code:
 log # ffmpeg -i /mnt/data/share/Downloads/Music/iTunes/iTunes\ Media/Music/Elio\ e\ le\ storie\ tese/Cicciput/01\ Cicciput.mp3
ffmpeg version 0.7.8, Copyright (c) 2000-2011 the FFmpeg developers
  built on Mar  4 2012 12:10:47 with gcc 4.5.3
  configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --enable-shared --cc=i686-pc-linux-gnu-gcc --disable-static --enable-gpl --enable-postproc --enable-avfilter --disable-stripping --disable-debug --disable-doc --disable-vaapi --disable-ffplay --disable-vdpau --enable-libmp3lame --enable-libx264 --enable-libxvid --disable-indev=v4l --disable-indev=v4l2 --disable-indev=alsa --disable-indev=oss --disable-indev=jack --disable-outdev=alsa --disable-outdev=oss --enable-libfreetype --enable-pthreads --enable-librtmp --enable-libopenjpeg --disable-altivec --disable-avx --cpu=atom --enable-hardcoded-tables
  libavutil    50. 43. 0 / 50. 43. 0
  libavcodec   52.123. 0 / 52.123. 0
  libavformat  52.111. 0 / 52.111. 0
  libavdevice  52.  5. 0 / 52.  5. 0
  libavfilter   1. 80. 0 /  1. 80. 0
  libswscale    0. 14. 1 /  0. 14. 1
  libpostproc  51.  2. 0 / 51.  2. 0
[mp3 @ 0x8b48e00] max_analyze_duration 5000000 reached at 5015510
[mp3 @ 0x8b48e00] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '/mnt/data/share/Downloads/Music/iTunes/iTunes Media/Music/Elio e le storie tese/Cicciput/01 Cicciput.mp3':
  Metadata:
    artist          : Elio e le storie tese
    album           : Cicciput
    date            : 2003
    title           : Cicciput
    track           : 1/13
    album_artist    : Elio e le storie tese
    genre           : Rock
  Duration: 00:00:48.18, start: 0.000000, bitrate: 192 kb/s
    Stream #0.0: Audio: mp3, 44100 Hz, stereo, s16, 192 kb/s
At least one output file must be specified
log #


But it's parsed properly by Serviio:
  Code:
2012-09-07 20:11:06,497 DEBUG [LibraryManager] Metadata found via extractor EMBEDDED: AudioMetadata [album=Cicciput, albumArtist=Elio e le storie tese, bitrate=192, channels=2, coverImage=org.serviio.library.local.metadata.ImageDescriptor@ee5162, duration=47, genre=17, releaseYear=2003, trackNumber=1, author=null, date=Fri Sep 07 08:10:20 CEST 2012, filePath=/mnt/data/share/Downloads/Music/iTunes/iTunes Media/Music/Elio e le storie tese/Cicciput/01 Cicciput.mp3, fileSize=1156542, container=MP3, title=Cicciput]


Can you please help me to understand how to fix this thing?

Thanks and Regards,
Luca

EDIT: Check my last post for details

Re: Metadata extraction from MP3s

PostPosted: Sun Sep 09, 2012 10:52 pm
by zip
Can you send me the unrecognized track to zip[at]serviio.org ? Serviio is ctually not using ffmpeg to retrieve audio/image metadata, it's using other libraries instead, so there is either a bug in the library or I'm not implementing all the corner cases.

Metadata extraction from MP3s

PostPosted: Mon Sep 10, 2012 10:16 am
by Strupniveral
Sure, will do it once back at home this evening. The library you mention is included with serviio package or it should be avalabe at sys level? In the latter case, I can check if any updated version is available for my linux distro

Re: Metadata extraction from MP3s

PostPosted: Mon Sep 10, 2012 9:47 pm
by zip
it's a serviio library

Re: Metadata extraction from MP3s

PostPosted: Mon Sep 10, 2012 10:19 pm
by Strupniveral
oh, got it. Mail with mp3 sent ;)

Funny thing is that this issue happens with 6 songs from the very same albums - all the other mp3 not categorized properly had missing metadata or were put in the proper place after a second rescan - I wouldn't be surprised if it's something within the mp3 itself...

Thanks,
Luca

Re: Metadata extraction from MP3s

PostPosted: Tue Sep 11, 2012 9:39 pm
by Strupniveral
First of all, the problem is solved ;)

Short story:
the issue was in the metadata included in the MP3s - two mixed versions (v1.1 vs v2.3) and missing ones in v2.3 (even if iTunes was showing them)

Long story (just for future/others reference):
1. I tried to force ID3 metadata v2.4 directly from iTunes, then removed them from library, refreshed & reimport --> Failed (same thing as before)
2. I tried to force ID3 metadata v2.4, exported them and checked with an ID3 editor: I could see two mixed versions (v1.1 & v2.3)
3. Edited metadata with the external editor (removed v1.1, added missing v2.3 ones and converted to v2.4)
4. Reimported in iTunes --> iTunes was showing tags properly
5. Forced Serviio's library refresh --> All the MP3s were properly organized in serviio, solving the reported issue

As ID3 tag editors, I used the following:
Windows: http://www.mp3tag.de/en/ (as per your suggestion)
OSX: http://sourceforge.net/projects/kid3/