{"record":{"id":"649bdcf19cd0431c","repo":"ytdl-org/youtube-dl","slug":"only-mp3-and-m4a-mp4-are-supported-for-thumbnail-e","errorCode":null,"errorMessage":"Only mp3 and m4a/mp4 are supported for thumbnail embedding for now.","messagePattern":"Only mp3 and m4a/mp4 are supported for thumbnail embedding for now\\.","errorType":"exception","errorClass":"EmbedThumbnailPPError","httpStatus":null,"severity":"error","filePath":"youtube_dl/postprocessor/embedthumbnail.py","lineNumber":131,"sourceCode":"\n            p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n            stdout, stderr = process_communicate_or_kill(p)\n\n            if p.returncode != 0:\n                msg = stderr.decode('utf-8', 'replace').strip()\n                raise EmbedThumbnailPPError(msg)\n\n            if not self._already_have_thumbnail:\n                os.remove(encodeFilename(thumbnail_filename))\n            # for formats that don't support thumbnails (like 3gp) AtomicParsley\n            # won't create to the temporary file\n            if b'No changes' in stdout:\n                self._downloader.report_warning('The file format doesn\\'t support embedding a thumbnail')\n            else:\n                os.remove(encodeFilename(filename))\n                os.rename(encodeFilename(temp_filename), encodeFilename(filename))\n        else:\n            raise EmbedThumbnailPPError('Only mp3 and m4a/mp4 are supported for thumbnail embedding for now.')\n\n        return [], info\n","sourceCodeStart":113,"sourceCodeEnd":134,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/postprocessor/embedthumbnail.py#L113-L134","documentation":"Raised by EmbedThumbnailPP.run when info['ext'] is neither mp3 nor m4a/mp4 (and not the earlier ffmpeg/atomicparsley branches). Thumbnail embedding is only implemented for those containers in this post-processor, so any other extension (mkv, webm, 3gp, m4v variants, etc.) is rejected explicitly.","triggerScenarios":"Using --embed-thumbnail while forcing a format/container other than mp3/m4a/mp4, e.g. '-f best[ext=webm]' or re-muxing with --recode-video to mkv before embedding, or downloading a site whose only formats are webm/3gp.","commonSituations":"Default best format resolves to webm on YouTube; users combine --embed-thumbnail with --recode-video mkv; sites serving 3gp-only streams.","solutions":["Pick an mp4/m4a format: '-f bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]' before --embed-thumbnail","For audio, prefer mp3/m4a output (-x --audio-format mp3 or m4a)","If you need thumbnails in mkv/webm, switch to yt-dlp (uses ffmpeg, supports more containers) or embed with mkvpropedit afterwards"],"exampleFix":"# before\nyoutube-dl --embed-thumbnail -f best 'https://youtube.com/watch?v=...'\n# after\nyoutube-dl --embed-thumbnail -f 'best[ext=mp4]' 'https://youtube.com/watch?v=...'","handlingStrategy":"validation","validationCode":"SUPPORTED = {'mp3', 'm4a', 'mp4'}\n\ndef plan_supports_embed_thumbnail(requested_ext):\n    return requested_ext in SUPPORTED\n\nif opts.get('embedthumbnail') and fmt_ext not in SUPPORTED:\n    raise ValueError('embed-thumbnail needs mp3/m4a/mp4; got %s' % fmt_ext)","typeGuard":null,"tryCatchPattern":"try:\n    ydl.download([url])\nexcept PostProcessingError as e:\n    if 'Only mp3 and m4a/mp4 are supported' in str(e):\n        # re-run selecting an mp4/m4a format\n        ydl.params['format'] = 'best[ext=mp4]/bestaudio[ext=m4a]'\n        ydl.download([url])","preventionTips":["Pair --embed-thumbnail with an explicit mp4/m4a/mp3 format selection","Avoid combining --embed-thumbnail with --recode-video to non-MP4 containers in this fork"],"tags":["embed-thumbnail","unsupported-format","container","postprocessor"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}