Skip to content

Add attached_pic property to avformat consumer#1207

Open
bmatherly wants to merge 2 commits intomasterfrom
attached_pic
Open

Add attached_pic property to avformat consumer#1207
bmatherly wants to merge 2 commits intomasterfrom
attached_pic

Conversation

@bmatherly
Copy link
Member

This allows applications to add cover art to files

This allows applications to add cover art to files
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support to the avformat consumer for embedding cover art (FFmpeg “attached picture” stream) into output files, and updates the consumer metadata version accordingly.

Changes:

  • Bump consumer_avformat metadata version to 6.
  • Add a new attached_pic consumer parameter (file picker) to specify a cover-art image path.
  • Implement image loading, basic JPEG/PNG detection, dimension parsing, stream creation, and writing the attached picture packet right after the container header.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/modules/avformat/consumer_avformat.yml Adds the attached_pic parameter and bumps the module metadata version.
src/modules/avformat/consumer_avformat.c Implements attached-picture stream creation and writes cover art immediately after the container header.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
and only JPEG and PNG are supported. The image is added as an attached
picture stream with the AV_DISPOSITION_ATTACHED_PIC flag and is written
immediately after the container header. Most audio container formats
(e.g. MP3, M4A, OGG, FLAC) as well as Matroska support attached pictures.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently, Matroska is picky and needs some things like MIME type:
https://video.stackexchange.com/questions/35598/is-it-possible-to-embed-a-thumbnail-in-a-mkv-file

This talks about cover art for audio files, but what about video? Can it be used to set the thumbnail for video? That would be used by things like file and media browsers, and maybe YouTube or other social medias as well.

@ddennedy ddennedy added this to the v7.38.0 milestone Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants