Add attached_pic property to avformat consumer#1207
Add attached_pic property to avformat consumer#1207
Conversation
This allows applications to add cover art to files
There was a problem hiding this comment.
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_avformatmetadataversionto 6. - Add a new
attached_picconsumer 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. |
There was a problem hiding this comment.
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.
This allows applications to add cover art to files