fmang / opustags

Ogg Opus tags editor
BSD 3-Clause "New" or "Revised" License
81 stars 11 forks source link

[Question]How can I add a cover to an opus file ? #50

Closed sebma closed 1 year ago

sebma commented 3 years ago

Hi,

How can I add a cover to an opus file ?

fmang commented 3 years ago

I don’t think it’s something specific to Opus, but more like a convention followed by most of Xiph’s formats. See https://wiki.xiph.org/VorbisComment#METADATA_BLOCK_PICTURE

opustags does not generate that tag, but if you dump the base64 data as a regular comment it should work. Note however that opustags does not currently support tags exceeding 64kB.

I saw your question on Stack Overflow (https://superuser.com/questions/1385109/add-album-art-cover-to-an-ogg-opus-file-from-the-command-line). How about trying hackerb9’s answer to generate a recoded Opus with the right tags using opusenc, then reproducing the tags from the recoded file to the original one using opustags? The command for reproducing tags is opustags merged.opus | opustags -S audio.opus -o final.opus. Though that solution is quite wasteful, the result should be just right.

Maybe someday opustags will support cover arts. Someone once hacked opustags for that, see https://github.com/fmang/opustags/pull/21.

sebma commented 3 years ago

@fmang Thanks a lot. I'll look into it.

iconoclasthero commented 3 years ago

I'm interested in this as a future option.

shmerl commented 1 year ago

This fork had a feature for adding a cover, but it was deleted: https://github.com/zvezdochiot/opustags

I saved the repo though, so there is an example how it can be done.

zvezdochiot commented 1 year ago

@shmerl say:

but it was deleted: https://github.com/zvezdochiot/opustags

https://github.com/Sound-Linux-More/libopustags

shmerl commented 1 year ago

Oh, thanks for the pointer!

shmerl commented 1 year ago

Would it make sense to merge these projects since opustag is active now too? Adding a cover was a really hard to do operation for opus files when last time I tried, until I found that fork.

zvezdochiot commented 1 year ago

@shmerl say:

Would it make sense to merge these projects since opustag is active now too?

Opustags writes multi-page meta correct. In libopustag, multi-page metas are written with a small error == warning. But I can't stand C++, so there won't be any merging under any pretext.

See also: #58

fmang commented 1 year ago

My recent works on 1.7.0 for supporting multi-page headers made support for cover arts one step closer. I’ve just added --set-cover and --output-cover in the master branch if anyone would like to try. I will probably release the feature by the end of the month.