question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Embed video thumbnails in audio files as cover art

See original GitHub issue

So I found that the -f bestaudio feature downloads m4a files from youtube, which is great, but I’m missing my thumbnails. m4a files support embedding images in them, and video players such as mpv show those images as a static replacement of the video stream. Just like most of the music in video sites, but with a jpeg instead of a video with a single repeated frame.

I was considering writing a small script to get those files with youtube-dl --get-thumbnail and then embed them with AtomicParsley (a mpeg4 metadata manipulator, as this page suggests it’s not working with ffmpeg), but then realized it would be a good feature to have as part of youtube-dl, since it already has features to add metadata to the video.

Does this sound like a desirable feature? Is the dependency with AtomicParsley an issue? If it’s ok, I might go ahead and implement it, then send a PR later.

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
dequiscommented, Feb 22, 2014

I tried adding thumbnails to all the m4a I downloaded before, using both add-metadata and embed-thumbnail over a list of 206 videos.

$ perl -e 'while(<*.m4a>){ print s/^.*(.{11})\.m4a$/\1\n/r; }' > id_list
$ youtube-dl -f bestaudio --embed-thumbnail --add-metadata -a id_list

It succeeded with all the m4a files, except two, which I already used --embed-thumbnail with.

[download] [...].m4a has already been downloaded
[ffmpeg] Adding metadata to '[...].m4a'
ERROR: Could not write header for output file #0 (incorrect codec parameters ?): Operation not permitted

This can be reproduced with --embed-thumbnail once, then run youtube-dl again with the same video id and either --embed-thumbnail or --add-metadata. Sounds like another thumbnail related ffmpeg bug, I’m afraid 😕

1reaction
tripulsecommented, Oct 8, 2019

@cup, is right because AtomicParsley is not only the program that is able to embed metadata into a MPEG4 file. There are several others that do the same job. One worse or better than another. But, it seems the method of using AtomicParsley is quite easy because they provide pre-built binaries on their website.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Embed video thumbnails in audio files as cover art · Issue #2404
So I found that the -f bestaudio feature downloads m4a files from youtube, which is great, but I'm missing my thumbnails. m4a files...
Read more >
How to how to add cover art / thumbnail to an MP4 ... - YouTube
This video shows how to attach a thumbnail image to a video or audio file LosslessCut - The Swiss Army Knife of Lossless...
Read more >
Automatic thumbnails in video or audio files - Dropmark Support
To include a thumbnail within your video or audio files, you can add custom artwork (sometimes called poster frame or cover art) within...
Read more >
Extract video cover/thumbnail from file with embedded cover ...
What the command above does first is map all video streams (regular + attached pictures) and then use a negative mapping to disable...
Read more >
Embed thumbnail for audio file? : r/youtubedl - Reddit
Embed thumbnail in the video as cover art. I don't know if it means video file literally, I thought you can embed covert...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found