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

--embed-thumbnail for Opus files #22338

Open
pylorak opened this issue Sep 8, 2019 · 6 comments
Open

--embed-thumbnail for Opus files #22338

pylorak opened this issue Sep 8, 2019 · 6 comments
Labels

Comments

@pylorak
Copy link

@pylorak pylorak commented Sep 8, 2019

Checklist

  • I'm reporting a feature request
  • I've verified that I'm running youtube-dl version 2019.09.01
  • I've searched the bugtracker for similar feature requests including closed ones

Description

Please add support for embedding cover art in opus files.

@pylorak pylorak added the request label Sep 8, 2019
@tripulse
Copy link

@tripulse tripulse commented Dec 7, 2019

You could externally, use opusenc to embed thumbnails into a OPUS files.
I may try to implement that in youtube-dl.

@pylorak
Copy link
Author

@pylorak pylorak commented Dec 7, 2019

For the same reason that youtube-dl already supports embedding cover art into MP4, supporting it for Opus would be a lot more convenient for the user than having to post-process the file with a separate application like opusenc. Also, it would avoid having to re-encode the file just for the sake of adding a cover art.

@tripulse
Copy link

@tripulse tripulse commented Dec 10, 2019

I was quite wrong, opusenc cannot post-process though, it requires a WAV/PCM as input to encode to OPUS. This is results in lossy-to-lossy compression (quantization on already quantized signal) which degrades the quality even more.

OPUS doesn't define it's own bit-stream format, it's usually contained inside a OGG container, opusenc follows this way.


MP4 (ISO-BMFF) supports OPUS as a audio-codec. M4A is MP4 (Apple used this name to distinguish between Video and Audio files, besides that the structure is exactly the same).

OPUS is considered experimental in the MP4 container, older software might not parse it correctly neither those which strictly follow the specification.


youtube_dl should have a option to directly pass arguments to FFmpeg, while --recode-video* is a poor implementation (re-encodes again, doesn't streamcopy) looses quality.

@milahu
Copy link

@milahu milahu commented Feb 4, 2020

.... or keep the ogg container
and embed the cover art image as base64 comment like

METADATA_BLOCK_PICTURE=base64_string

https://superuser.com/questions/169151/embed-album-art-in-ogg-through-command-line-in-linux

@tripulse
Copy link

@tripulse tripulse commented Mar 9, 2020

.... or keep the ogg container
and embed the cover art image as base64 comment like

METADATA_BLOCK_PICTURE=base64_string

https://superuser.com/questions/169151/embed-album-art-in-ogg-through-command-line-in-linux

Appending a cover art this way has its limitations (eg. argument list can become too long that the current shell might now allow it). Also, this isn’t automation in anyway, suppose you downloaded a bunch of files, you have to iterate through all the files and download it’s corresponding thumbnail from the site where it was downloaded so at the end things become very messy.

I recently focused a bit on this problem and found out that mutagen as optional PyPI dependency to embed thumbnails into OGGOpus files would be great.

Update: I’ve finished the work of implementation, it supports FLAC, OGGVorbis, OGGOpus.

@pylorak
Copy link
Author

@pylorak pylorak commented Mar 10, 2020

Thank you! I'll test and report back as soon as a Windows build of the new version is published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.