-
-
Notifications
You must be signed in to change notification settings - Fork 770
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
preview-tui: mpv kitty and sixel support for img, gif & vid preview #1749
Conversation
Please check the Also, which terminals does this target? I guess sixel terminals that do not themselves support multiplexing? Or I guess one might prefer |
yes you are right. This is targeted towards foot, putty, wezterm, alacritty, and other terminals wherein which the user wants to use the same terminal with tmux as multiplexer(rather than using terminal's built-in multiplexing capabilities) for nnn media previewer. |
@luukvbaal or @N-R-K please merge when this is ready. |
Sure, I haven't had the chance to test this yet but it looks better now. |
@N-R-K please merge when ready. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks okay, but I don't have my mpv built with sixel support so I didn't test.
Sorry for the delay, finally got around to looking into this. Looks alright but I think some more work is needed to implement this properly. We need to make sure we don't try to use the sixel backend on terminals that do not support it. I actually haven't gotten the mpv sixel backend to work yet on my machine. It prints the raw sixel data when running tmux with sixel support, in a terminal that doesn't support sixel. #1590 also mentions the kitty backend, I tried adding support for that and that seems to work fine. I'll try to add a commit and merge this PR this weekend if I can get sixel to work... |
OK mpv in the arch repo is not built with the sixel backend, installing mpv-full did the trick. What terminal are you using this on @abhinav3398? I'm currently testing on WezTerm which supports both the sixel and kitty backends. Kitty backend works all right but the sixel backend is horribly slow. Is performance alright for you? |
bca9f9e
to
5384a6f
Compare
Added a commit to also support the mpv kitty backend. Also try to detect sixel support and better honor the I'm fine to merge this now, but I'll test a bit more and wait for reviews one more time. |
That's exactly what I used.
I'm using foot. works perfectly fine for me. Mpv used to display videos fine about 2 weeks ago. It just recently started lagging for me. But the lag is fine for prewing purposes. Haven't tried on other terminals yet but I'll try it out on other terminals and try to add a check for sixel support for the terminal after the weekend. Thanks for the help @luukvbaal as I'm busy during the weekend. |
Yeah I suppose so. I doubt there is much we can do about performance anyways besides hoping it gets improved upstream ^^ Thanks for kicking off the mpv support, it's cool :) |
Doesn't seem like there's any performance issues on sixel output being reported upstream (that's probably because no one uses it). Pinging @mia-0. |
Performance is mostly bottlenecked by libsixel (the quantization step in particular; dithering options may affect it) and the terminal emulator. So there’s not much we can do about it on mpv’s side without replacing libsixel I’m afraid. |
Assuming this is good to go then? |
Thanks guys! |
adds sixel image, video and gif preview support when tmux is buit with
./configure --enable-sixel
requirements for preview apart from sixel supported tmux: