Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support embedded thumbnail of video as the preview #2518

Open
2 tasks done
rieje opened this issue Mar 23, 2025 · 4 comments
Open
2 tasks done

Support embedded thumbnail of video as the preview #2518

rieje opened this issue Mar 23, 2025 · 4 comments

Comments

@rieje
Copy link

rieje commented Mar 23, 2025

What system are you running Yazi on?

Linux Wayland

What terminal are you running Yazi in?

Alacritty

yazi --debug output

N/A

Describe the question

Downloaded Youtube videos with yt-dlp contain thumbnails explicitly embedded into these files as e.g. image files as mkv attachments provide added context so file managers can show them instead of a thumbnail preview of the video generated for the video. They are meaningful, containing e.g. the topic of the video.

My GUI file manager (PCManFM) picks these up automatically and those that don't have embedded image files fallback to previewing the automatically generated one.

Yazi should be able to do that same. Currently it shows only the automatically generated one, which is rarely useful compared to the embedded thumbnail. For example, for a Youtube video series the automatically generated ones are just 99% pure white because they happen to be generated from a bad position (time) in the video whereas the Youtube thumbnail contains the topic's name.

Anything else?

No response

Checklist

  • I have read all the documentation
  • I have searched the existing discussions/issues

Originally posted by @rieje in #2506

@rieje rieje changed the title ### Support embedded thumbnail of video as the preview Support embedded thumbnail of video as the preview Mar 24, 2025
@sxyazi
Copy link
Owner

sxyazi commented Apr 6, 2025

Yazi uses ffmpeg to preview videos, is there any way to make ffmpeg prioritize the embedded thumbnail when it is available?

@maga-tama
Copy link

Check attached_pic disposition?

@sxyazi
Copy link
Owner

sxyazi commented Apr 6, 2025

I tried to download a video using yt-dlp with --embed-thumbnail:

yt-dlp --embed-thumbnail 'https://www.youtube.com/watch?v=xXV98mzdXHc'

and then inspected it with ffprobe, but the attached_pic is always 0:

ffprobe -v quiet -select_streams v -show_entries stream=index,codec_name:stream_disposition=attached_pic -of json test.mkv
{
    "programs": [

    ],
    "stream_groups": [

    ],
    "streams": [
        {
            "index": 0,
            "codec_name": "av1",
            "disposition": {
                "attached_pic": 0
            }
        }
    ]
}

Is it that this YouTube video doesn't have an embedded thumbnail? Can you give me a URL that does have one?

@maga-tama
Copy link

yt-dlp -f137 https://www.youtube.com/watch?v=R3a6dnS5sqU --embed-thumbnail
Works, could be Format/Container issue? (Any case - out of scope / yt-dlp issue)

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

No branches or pull requests

3 participants