Skip to content
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

Beet convert spitting out lots of error reading #2599

Closed
CommunicationAnimale opened this issue Jun 16, 2017 · 7 comments
Closed

Beet convert spitting out lots of error reading #2599

CommunicationAnimale opened this issue Jun 16, 2017 · 7 comments
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."

Comments

@CommunicationAnimale
Copy link

Problem

When running beet convert, beet prints twice the same error message error reading ... (see below) after every conversion. However every file seems to have been correctly written to its destination, so I'm not sure what the error really is, maybe the error message could be changed to something more informative?

❯ beet convert Disclosure Intro
Disclosure - Settle - Intro
Convert? (Y/n) y
convert: Encoding /home/com/Music/Library/Disclosure/Settle/01 Intro.flac
convert: Finished encoding /home/com/Music/Library/Disclosure/Settle/01 Intro.flac
error reading /home/com/Music/Library/Disclosure/Settle/01 Intro.flac: b'/home/com/Music/Converted/Disclosure/Settle/01 Intro.mkv'
error reading /home/com/Music/Library/Disclosure/Settle/01 Intro.flac: b'/home/com/Music/Converted/Disclosure/Settle/01 Intro.mkv'

Setup

  • OS: Fedora 25
  • Python version: Python 3.5.3
  • beets version: 1.4.4
  • Turning off plugins made problem go away (yes/no): N.a

My configuration (output of beet config) is:

lyrics:
    bing_lang_from: []
    fallback:
    bing_lang_to:
    bing_client_secret: REDACTED
    google_engine_ID: REDACTED
    auto: yes
    sources: [google, lyricwiki, musixmatch]
    force: no
    genius_api_key: REDACTED
    google_API_key: REDACTED
directory: ~/Music/Library
convert:
    dest: ~/Music/Converted
    never_convert_lossy_files: yes
    command: ffmpeg -i $source -vn -c:a libopus -vbr on -b:a 128k -threads 0 $dest
    extension: mkv
    formats:
        ogg: ffmpeg -i $source -y -vn -acodec libvorbis -aq 3 $dest
        aac:
            extension: m4a
            command: ffmpeg -i $source -y -vn -acodec aac -aq 1 $dest
        opus: ffmpeg -i $source -y -vn -acodec libopus -ab 96k $dest
        alac:
            extension: m4a
            command: ffmpeg -i $source -y -vn -acodec alac $dest
        flac: ffmpeg -i $source -y -vn -acodec flac $dest
        wma: ffmpeg -i $source -y -vn -acodec wmav2 -vn $dest
        mp3: ffmpeg -i $source -y -vn -aq 2 $dest

    paths: {}
    auto: no
    format: mp3
    copy_album_art: no
    quiet: no
    max_bitrate: 500
    album_art_maxwidth: 0
    pretend: no
    threads: 4
    tmpdir:
    embed: yes

import:
    copy: yes
    move: no
library: ~/.local/share/beets/musiclibrary.db

plugins: [fetchart, lyrics, convert]
fetchart:
    cover_names:
    - cover
    - front
    - art
    - album
    - folder
    google_key: REDACTED
    cautious: no
    maxwidth: 0
    auto: yes
    minwidth: 0
    sources:
    - filesystem
    - coverart
    - itunes
    - amazon
    - albumart
    store_source: no
    google_engine: 001442825323518660753:hrh5ch1gjzm
    enforce_ratio: no
    fanarttv_key: REDACTED
@sampsyo sampsyo added the needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature." label Jun 16, 2017
@sampsyo
Copy link
Member

sampsyo commented Jun 16, 2017

Hi! Can you please include a verbose log? You can run beet -vv convert Disclosure Intro.

@CommunicationAnimale
Copy link
Author

Sure, here it is:

❯ beet -vv convert Disclosure Intro -d Test
user configuration: /home/com/.config/beets/config.yaml
data directory: /home/com/.config/beets
plugin paths:
Sending event: pluginload
lyrics: Disabling google source: no API key configured.
library database: /home/com/.local/share/beets/musiclibrary.db
library directory: /home/com/Music/Library
Sending event: library_opened
Disclosure - Settle - Intro
Convert? (Y/n) y
convert: Encoding /home/com/Music/Library/Disclosure/Settle/01 Intro.flac
convert: Finished encoding /home/com/Music/Library/Disclosure/Settle/01 Intro.flac
Sending event: write
error reading /home/com/Music/Library/Disclosure/Settle/01 Intro.flac: b'/home/com/Music/Test/Disclosure/Settle/01 Intro.mkv'
convert: embedding album art from /home/com/Music/Library/Disclosure/Settle/cover.jpg
convert: embedding /home/com/Music/Library/Disclosure/Settle/cover.jpg
Sending event: write
error reading /home/com/Music/Library/Disclosure/Settle/01 Intro.flac: b'/home/com/Music/Test/Disclosure/Settle/01 Intro.mkv'
Sending event: after_convert
Sending event: cli_exit

@sampsyo
Copy link
Member

sampsyo commented Jun 17, 2017

OK; thanks! That helps. It looks like the problem is that you're converting to a format that beets itself doesn't support (MKV). The convert plugin tries to set the metadata tags on those converted files after transcoding and can't. We should definitely clarify that error message.

sampsyo added a commit that referenced this issue Jun 17, 2017
...when Mutagen doesn't recognize the type at all.
@sampsyo
Copy link
Member

sampsyo commented Jun 17, 2017

OK, I've pushed some changes that should make it clearer what's going on.

On a minor note, I looked into why the error was being printed twice. It looks like the convert plugin writes the file once with the basic tags and then a second time with the album art. This might be worth trying to collapse down into one write call to improve efficiency and reduce confusion.

@sampsyo sampsyo closed this as completed Jun 17, 2017
@CommunicationAnimale
Copy link
Author

Thanks! For reference, I simply changed extension: mkv to extension: ogg and everything works great! (Android cannot read opus in .opus files, but apparently accepts both .mkv and .ogg, though only .mkv is documented.)

@sampsyo
Copy link
Member

sampsyo commented Jun 19, 2017

Oh cool! That makes sense. Maybe it's a documentation bug? It does seem odd that they'd only want to support .mkv files, which are usually used for video...

@CommunicationAnimale
Copy link
Author

CommunicationAnimale commented Jun 19, 2017

Well, I also tried the other container formats supporting Opus listed on Wikipedia (.opus, .mkv, .webm, .ts .mp4), and only ogg (though it wasn't even mentionned on the Wikipedia page) was displayed by the default music player.
However, if I understood correctly, a .opus file simply is an ogg-encapsulated opus stream with a different extension, so it really is weird that Android accepts .ogg but not .opus...

Edit: I'm using LineageOS, so this behavior might be different on AOSP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."
Projects
None yet
Development

No branches or pull requests

2 participants