google-code-export / beets

Automatically exported from code.google.com/p/beets
MIT License
0 stars 0 forks source link

Album import causes beets to crash. #360

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What's the problem? How can I reproduce it?
Trying to import the album Emperor - Anthems to the Welkin at Dusk, beets 
crashes:
beet -v import /pool/backup/mp3/Emperor/Emperor\ -\ Anthems\ to\ the\ Welkin\ 
at\ Dusk/  -ql beets.log
config file: /home/akegata/.beetsconfig
library database: /home/akegata/data/musiclibrary.blb
library directory: /pool/beetslibrary
Looking up: /pool/backup/mp3/Emperor/Emperor - Anthems to the Welkin at Dusk
Tagging Emperor - Anthems to the Welkin at Dusk
No album IDs found.
Search terms: Emperor - Anthems to the Welkin at Dusk
Album might be VA: False
fingerprinted: '/pool/backup/mp3/Emperor/Emperor - Anthems to the Welkin at 
Dusk/01 - Alsvartr (the Oath).mp3'
fingerprinted: '/pool/backup/mp3/Emperor/Emperor - Anthems to the Welkin at 
Dusk/02 - Ye Entrancemperium.mp3'
fingerprinted: '/pool/backup/mp3/Emperor/Emperor - Anthems to the Welkin at 
Dusk/03 - Thus Spake the Nightspirit.mp3'
fingerprinted: '/pool/backup/mp3/Emperor/Emperor - Anthems to the Welkin at 
Dusk/04 - Ensorcelled by Chaos.mp3'
fingerprinted: '/pool/backup/mp3/Emperor/Emperor - Anthems to the Welkin at 
Dusk/05 - The Loss and Curse of Reverence.mp3'
fingerprinted: '/pool/backup/mp3/Emperor/Emperor - Anthems to the Welkin at 
Dusk/06 - The Acclamation of Bonds.mp3'
fingerprinted: '/pool/backup/mp3/Emperor/Emperor - Anthems to the Welkin at 
Dusk/07 - With Strength I Burn.mp3'
fingerprinted: '/pool/backup/mp3/Emperor/Emperor - Anthems to the Welkin at 
Dusk/08 - The Wanderer.mp3'
fingerprinted: '/pool/backup/mp3/Emperor/Emperor - Anthems to the Welkin at 
Dusk/09 - In Longing Spirit.mp3'
fingerprinted: '/pool/backup/mp3/Emperor/Emperor - Anthems to the Welkin at 
Dusk/10 - Opus a Satana.mp3'
Traceback (most recent call last):
  File "/usr/local/bin/beet", line 9, in <module>
    load_entry_point('beets==1.0b13', 'console_scripts', 'beet')()
  File "/usr/local/lib/python2.6/dist-packages/beets/ui/__init__.py", line 725, in main
    subcommand.func(lib, config, suboptions, subargs)
  File "/usr/local/lib/python2.6/dist-packages/beets/ui/commands.py", line 740, in import_func
    timid, query, incremental, ignore)
  File "/usr/local/lib/python2.6/dist-packages/beets/ui/commands.py", line 638, in import_files
    ignore = ignore,
  File "/usr/local/lib/python2.6/dist-packages/beets/importer.py", line 835, in run_import
    pl.run_parallel(QUEUE_SIZE)
  File "/usr/local/lib/python2.6/dist-packages/beets/util/pipeline.py", line 242, in run
    out = self.coro.send(msg)
  File "/usr/local/lib/python2.6/dist-packages/beets/importer.py", line 536, in initial_lookup
    task.set_match(*autotag.tag_album(task.items, config.timid))
  File "/usr/local/lib/python2.6/dist-packages/beets/autotag/match.py", line 445, in tag_album
    va_likely)
  File "/usr/local/lib/python2.6/dist-packages/beets/autotag/hooks.py", line 114, in _album_candidates
    out.extend(plugins.candidates(items))
  File "/usr/local/lib/python2.6/dist-packages/beets/plugins.py", line 228, in candidates
    out.extend(plugin.candidates(items))
  File "/usr/local/lib/python2.6/dist-packages/beetsplug/chroma.py", line 114, in candidates
    for relid in _all_releases(items):
  File "/usr/local/lib/python2.6/dist-packages/beetsplug/chroma.py", line 87, in _all_releases
    aidata = acoustid_match(item.path)
  File "/usr/local/lib/python2.6/dist-packages/beetsplug/chroma.py", line 42, in __call__
    res = self.func(*args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/beetsplug/chroma.py", line 54, in acoustid_match
    parse=False)
  File "/usr/local/lib/python2.6/dist-packages/acoustid.py", line 277, in match
    duration, fp = _fingerprint_file_audioread(path)
  File "/usr/local/lib/python2.6/dist-packages/acoustid.py", line 235, in _fingerprint_file_audioread
    with audioread.audio_open(path) as f:
  File "/usr/local/lib/python2.6/dist-packages/audioread/__init__.py", line 86, in audio_open
    return ffdec.FFmpegAudioFile(path)
  File "/usr/local/lib/python2.6/dist-packages/audioread/ffdec.py", line 43, in __init__
    self._get_info()
  File "/usr/local/lib/python2.6/dist-packages/audioread/ffdec.py", line 73, in _get_info
    self._parse_info(''.join(out_parts))
  File "/usr/local/lib/python2.6/dist-packages/audioread/ffdec.py", line 93, in _parse_info
    r'duration: (\d+):(\d+):(\d+).(\d)', s
AttributeError: 'NoneType' object has no attribute 'groups'

ls -lh /pool/backup/mp3/Emperor\ -\ Anthems\ to\ the\ Welkin\ at\ Dusk/
total 84M
-rw-r--r-- 1 akegata akegata 6.0M 2012-03-12 22:16 01 - Alsvartr (the Oath).mp3
-rw-r--r-- 1 akegata akegata 7.3M 2012-03-12 22:16 02 - Ye Entrancemperium.mp3
-rw-r--r-- 1 akegata akegata 6.2M 2012-03-12 22:16 03 - Thus Spake the 
Nightspirit.mp3
-rw-r--r-- 1 akegata akegata 9.2M 2012-03-12 22:16 04 - Ensorcelled by Chaos.mp3
-rw-r--r-- 1 akegata akegata 8.5M 2012-03-12 22:16 05 - The Loss and Curse of 
Reverence.mp3
-rw-r--r-- 1 akegata akegata 8.2M 2012-03-12 22:16 06 - The Acclamation of 
Bonds.mp3
-rw-r--r-- 1 akegata akegata  12M 2012-03-12 22:16 07 - With Strength I Burn.mp3
-rw-r--r-- 1 akegata akegata 4.0M 2012-03-12 22:16 08 - The Wanderer.mp3
-rw-r--r-- 1 akegata akegata 8.2M 2012-03-12 22:16 09 - In Longing Spirit.mp3
-rw-r--r-- 1 akegata akegata 5.9M 2012-03-12 22:16 10 - Opus a Satana.mp3
-rw-r--r-- 1 akegata akegata 8.8M 2012-03-12 22:16 11 - The Loss and Curse of 
Reverence (Live).mp3
-rw-r--r-- 1 akegata akegata  83K 2012-03-12 22:16 folder.jpg

If it seems relevant, what system are you running on (OS, Python version,
etc.)?
Ubuntu 10.04
Python 2.6.5

Original issue reported on code.google.com by akegata@gmail.com on 17 Mar 2012 at 10:59

GoogleCodeExporter commented 9 years ago
Attaching the file that seems to cause the problem.

Original comment by akegata@gmail.com on 17 Mar 2012 at 11:49

Attachments:

GoogleCodeExporter commented 9 years ago
It looks like this audio file is missing its MP3 header, so FFmpeg doesn't know 
its duration. Oddly, my version of FFmpeg ("20120127", latest in Arch Linux) is 
willing to make a guess based on the bitrate.

Anyway, it sounds like your version of FFmpeg is just not reporting a duration 
for this broken MP3. I've fixed the audioread library to avoid crashing in 
situations like this. Here's the commit:
https://github.com/sampsyo/audioread/commit/0bea6a9e4ae40f382ba02887125d15b2fc7a
16bd
Can you try installing audioread from the latest source in git to see if this 
fixes the problem?

Original comment by adrian.sampson on 18 Mar 2012 at 10:51

GoogleCodeExporter commented 9 years ago
Yup, this solved the problem. :)
Actually, the fingerprinting seems to still fail (fingerprint matching 
'/pool/backup/beetscrash/Emperor - Anthems to the Welkin at Dusk/11 - The Loss 
and Curse of Reverence (Live).mp3' failed: missing required parameter 
"duration"), but at least the file gets imported based on the rest of the album.

For the record, my FFmpeg version is SVN-r0.5.1-4:0.5.1-1ubuntu1.1, it's 
probably several years old.

Original comment by akegata@gmail.com on 19 Mar 2012 at 6:44

GoogleCodeExporter commented 9 years ago
Great news. I don't think there's a way around the failing fingerprint (without 
a duration, we can't make the Acoustid API call), so not crashing will have to 
be good enough. :)

Original comment by adrian.sampson on 19 Mar 2012 at 6:56