-
Notifications
You must be signed in to change notification settings - Fork 92
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
Videos are displayed as a static snapshot in QuickLook previews. #3
Comments
would absolutely fantastic if they could be played back like mp4 files do |
I think that the only way to achieve this with the current QuickLook API would be to dynamically transcode the content into a format that AVFoundation can understand - i.e. into some version of MPEG. |
afaik VLCKit provides VLCMediaPlayer thought it would be possible somehow to initialize that in the QuickLook view? |
You can get a CGContext that VLCMediaPlayer could draw to ('though I didn't manage to get this working myself) by calling QLPreviewRequestCreateContext. But that context is intended for drawing a static bitmap, so I don't think that it can be dynamically updated. If you could get hold of the Finder's QuickLook preview window/panel then maybe VLCMediaPlayer could draw into that. But I don't know of any way to get hold of the Finder's QuickLook preview window/panel. (There's QLPreviewView, but I think that's for embedding a quicklook preview in your own app). |
Thanks for your work! |
@magdesign |
Hello, you have 100% more experience with Quick Look than me :-) |
@jnai7 |
Not a solution for this, but i saw someone (was in Japanese, and the URL is dead) using some kind of key action (using most likely a 3rd party solution) that passed the playback to a shell script (workaround style) invoking mplayer (in the example he used a Homebrew installed binary of mplayer). Have been trying myself, but no luck yet (making it seamless or usable). Some former colleagues working at a Encoding company (they have extremely good communication with Apple), said that they maybe have a solution for this (the issue). I'll keep you posted. |
The ideal solution would be to do the same as whatever the default Movie generator is doing in order to play the video into the Finder's Preview window. But I've tried and failed to reverse engineer what the Movie generator is doing so unless your guys at Telestream or anyone else can provide some pointers this is currently a dead end. I hadn't considered the approach of intercepting a keystroke and playing the video directly into a "fake" preview window. I guess the main challenge here is tracking the user's navigation in the Finder window in order to keep the contents of the "fake" preview window reflecting the user's selection - i.e. emulating QuickLook's behaviour. And if that turns out to be too difficult then I'm not sure we've achieved anything worthwhile - after all ⌘-↓ is a perfectly good existing keyboard shortcut for just playing a video file :-) |
Hello. First off, thank you so much for writing this quick look generator. |
Turns out that movie previews aren't produced by the QuickLook generator plugin /System/Library/QuickLook/Movie.qlgenerator. (Presumably this is because QuickLook generator plugins can't produce anything other than static text or images). The good news is that these are also plugins, so in theory it might be possible to produce a similar plugin for non-native video files. |
Interesting. I suppose that the LegacyMovie plugin isn't used in Mavericks(?). |
It doesn't appear to be used, and I don't know how to force it. Agree that an AVFoundation plugin would be preferable as more general solution. But a QLDisplayBundle plugin might possibly be easier to reverse engineer. |
Just a ”update”. Maybe it should be posted at some rumour forum than in this thread. I talked yesterday with a friend at the company i mentioned earlier. They have now a somewhat working plugin for Quicklook with video playback for third party codecs (only installed within their own applications in someway, but that includes almost every codec made). But it's very unstable (causing Kernel Panics at it worsts), and is also not developed anymore in-house (and no, they don't want to open source it). But he said that there is a strong possibility that the Finder will have their own extensions (think Photos.app that is built on adding features with extensions for both Apple in-house and 3rd party) in coming versions of Mac OS X (10.11 maybe?). When i asked how so, he said they (Apple) is developing a somewhat rewritten (again!) Finder that will get some stuff from iOS (the return of the Simple Finder!), but will also please ”power users” with the just mentioned extensions. According to him, in the internal development version, they used a extension Boilerplate (no surprise of course) and added some of the Photos.app extensions to the Finder (Photos.app will be more integrated in the Finder), but also 1 (internal test) extension showing of some kind of file comparison capabilities you see in the app Kaleidoscope (and other diff apps), and 1 extension for viewing common medical image formats. That would make it possible for extensions for different 3rd party media codecs (because it's targeted to 3rd party developers. Of course there will be some shortcomings with restrictions and more sandbox features.) That may sound like just some wishful thinking, but the guy that i worked with, has worked at Apple (Quicktime and Final Cut Pro as i remember), while it was a pretty long time ago, he still have friends inside, but also have some access for testing new things (within the company he works for), which is pretty unusual for Apple. He don't comment on future stuff most of the time, but when he has, everything turned out true (except some minor details that Apple may have changed). I don't out him with this post (taken care of that) if you wonder. Even if it's 100% true, Apple can change it at anytime (when i met the Quicktime Core Developers at a talk in Sweden 1 month before the release of QuickTime 4.0 back in 1999, they dismissed MP3 support as ”that's just crap pirates using, so there is no way we are adding that”. But as it turned, Steve Jobs himself demanded MP3 support. So they added support only a week before the release). |
@christopheranderton Any update? I am on 10.11.3 & when I tried to play webm, all I get is a static image. While webp & gifv shows gibberish & html respectively. |
@qbektrix I'm sorry, but i think you need to address that to the developers of the media player you are using. This repo is for a Quick Look-plugin by @Marginal and it will not playback unsupported media files. From the README:
About my earlier post, as you may know, OS X 10.11.x didn't contain any of the features mentioned. It may come in the feature, or not (giving Apple's track record, i wouldn't count on it). |
webp is a static image format. There's a QuickLook plugin for it here. gifv "files" are actually either mp4 or webm. Sounds like you downloaded some HTML wrapper rather than the video content. |
First of all thanks for your work. Then I didn't understand well: is mkv supported? I mean, I do get the thumbnails, but that's it. And I have VLC installed if it matters. |
@Michelasso mkv playback ist NOT supported... you will however get a static thumbnail for mkv files |
@cytec all right, thanks. I wanted to be sure there wasn't something wrong with my installation. :) |
If you rename LegacyMovie.qldisplay to Movie.qldisplay it will work with non-native video containers as on pre-10.9 OS X
I think this is impossible, because all *.qldisplay IDs are hardcoded into QuickLook.framework
Maybe there is a way to choose display bundle programmatically but I don't know how to do this. |
LegacyMovie.qldisplay does OK on some codec/container combinations if you have Perian installed, but it's painfully slow on some of my .mkv test files. Weirdly it can't handle some combinations e.g. DV, or H.264 in .mts, that Movie.qldisplay handles fine. I've created a new branch LegacyMovie which defers to LegacyMovie if LegacyMovie can preview the content, and provides static previews otherwise. For this to work you have to:
Let me know how it works for you if you try this. |
Marginal, Need some clarification (I'm not well versed in coding/computer terms). When you say "Symlink LegacyMovie.qldisplay as Movie.qldisplay" followed by the terminal commands, do you simply copy and paste that text into terminal? |
Marginal, Clarification no longer needed. I just copied and pasted into terminal and it worked like a charm! I even tried it in 10.11 (El Capitan) and it worked! All I had to do was disable System Integrity Protection, add the command to terminal, and re-enable System Integrity Protection. Thanks for this! |
Marginal, if I'm to understand correctly is there now a workaround that makes QLVideo work (as in play video) with more video formats than before? For example, QLVideo doesn't currently play .flv video formats and shows still images. If I perform the SymLink directions above, will .flv videos play in QuickLook now? Also, in your instructions you say to move "Movie.qldisplay out the way". Can I just rename it with an underscore in front of it so I can easily change it back later if needed? Also, is changing this stuff risky to the system stability? The other thing I'm trying to understand - Do I have to use the new branch LegacyMovie you link to for any of this to work? I don't see a package download for it, so I'm confused as to how I should implement it with your instructions above. Thank you! |
The instructions above allow .flv and other "non-native" video types to play in QuickLook on 10.9 and 10.10, and on 10.11 and later if you first disable SIP.
Yes.
That branch has been folded into the master branch. Just make sure you're on the latest release of QLVideo. Actually QLVideo isn't required at all to get .flv videos to play in QuickLook, but it's still useful to have for videos that the LegacyMovie QuickLook plugin can't handle. |
Thank you, Marginal. It works great. |
@krokofant I just grabbed webm video file from here: http://www.webmfiles.org/demo-files/ It's playing fine with QuickLook, although I did just notice it has an "Open in Chromium" option top-right I never noticed before. And when I do "Get Info" it shows "Open with" Chromium and will play the video preview there in the "Get Info" window. Not sure if that's relevant or not. The only other thing I can think of is maybe you need QuickTime 7 installed? I've also found if I have glitches with QuickLook a restart will sometimes fix it. Please let us know if you get it working or not, I may have some other ideas for you. |
@krokofant you ever get your issue with webm resolved? |
@gitguys Sorry for my delayed answer. I've not found any solution. I've installed updates, reinstalled whatever I could think of incl. iTunes (🤢). I tested with several previous working webms including a big buck bunny one. |
It appears you had it working before. Which OS version was that and which specific macOS version doesn't work now? Do you have QuickTime 7 re-installed? https://support.apple.com/kb/dl923?locale=en_US Do you have an old backup of your 'LegacyMovie.qldisplay' folder somewhere on external drive? Maybe try to dig that up. Otherwise, it'd appear perhaps something on your system got corrupted. I would try it with a different user account and see if it works that way. |
Quicklook Video play doesn't in 10.13 macOS High Sierra |
@zxspectrum are you saying this only works for <= 10.12? |
it use to work in Sierra. Definitely not working for me in High Sierra. I can see the thumbnail but can't play the movie via quicklook.../ |
@zxspectrum https://github.com/Marginal/QLVideo/releases/tag/rel-190 should fix it but I haven't tested it myself. Can you please test it and report back? :) |
Success!
|
@krokofant So can you QuickLook play video files like x264 / x265 .mkv files? |
@adriel I believe so, not sure about x265 though |
@krokofant hmm, might have to give it a try. I've got one of the new MBP's that has hardware support for H.265, so might work here. |
I tried the steps listed by @krokofant but there were a few disadvantages
.flv did eventually play but quicklook was spinning for a long time (about 30 secs) before it played Does anyone know how to get .mkv and .flv files to play via quicklook using regular qldisplay (Movie.qldisplay) and not the Legacy version? |
I also have bo "scrubber" bar, but it's better than not working at all. |
I'm still on Sierra and it sounds like it's degraded pretty badly in High Sierra overall. Is there any possible fixes for the missing scrubber bar, delays and loss of playback for various formats that's being reported here? |
I was looking at the latest version and it says it only shows static images for non-standard formats. Does this workaround to have formats such as .asf, .avi, .flv, .mkv, .rm, .webm, .wmf etc no longer work in the new version? |
Does moving video still work in High Sierra like it used to for Sierra? I currently have Sierra with a bunch of video formats working such as .asf, .avi, .flv, .mkv, .rm, .webm, .wmf formats working great with QuickLook and has a scrubber bar. Anyone figure out a way to get the scrubber bar back in High Sierra? |
THANK YOU ALL. |
What if instead of showing some sort of list of static snapshots the quicklook preview actually showed a webpage with some sort of HTML5 player contained in the quicklook plugin itself that using the video codecs could allow to play the video file directly? Would it be possible? Would this allow to bypass the QL static view limitations? |
No, because WebKit would have to support the video formats. It would be possible to run a server that does live transcoding, but that's just silly. This is one of those cases where Apple just did something sucky and that's that. |
Oh ok, I thought you could do almost everything with html5 and JavaScript :) too bad |
Hey all, I've successfully gotten a webm to play in Quicklook using @giovariot 's idea. In macOS 11.3 (and the associated version of Safari), Apple finally added webm support: https://www.macrumors.com/2021/02/18/safari-to-support-webm-after-11-years/ I have QLVideo installed and using Quicklook directly on the .webm file shows the static frame, but if I create a simple HTML file containing a The HTML is the following:
Note my (futile) attempts to hide the video controls with CSS (which on my system do not function). It is not the prettiest but it is a start. Perhaps the QLVideo plugin can, in the case of .webm files, render an HTML file like the above and embed the .webm in the HTML? The biggest two issues are the unwanted controls and dynamically sizing the preview window. Also, I am not sure if Apple's support for .webm includes all of the common codecs. My sample .webm is from 4chan which only supports VP8 video inside of .webm files; hopefully VP9 and any others would also work. macOS 11.4, M1 chip Screen.Recording.2021-06-30.at.7.45.34.PM.mp4 |
So - a possible solution would be to have a launchd service triggered by a port that gets a file:// URL and transcodes it to something fast that a JS video player can play? |
I'm not sure transcoding would be necessary? Since the macOS 11.3 update seems to allow the system HTML viewer (I assume the same version of webkit that Safari uses) to play webm files out of the box. I notice that the preview generator in QLVideo already creates HTML for one of the paths, so I think just creating HTML in a similar manner in the case of a webm file. But I don't know a whole lot about the macOS APIs unfortunately. I'm referring to the code here: QLVideo/qlgenerator/GeneratePreviewForURL.m Line 215 in 876295c
|
Sure, for webm its fine, but a host of older formats aren't supported. Transcoding is lossy, so best to keep them in their original form. |
Has anyone had any luck getting this to work (particularly with .mkv files) in Mojave? Any info would be appreciated, especially from the OG genius, Marginal. Thanks all! |
That's interesting workaround!
Latest Safari supports VP8/VP9/Vorbis/Opus, just not AV1. |
I try to make a QuickLook Preview Extension that generates an HTML to play WebM and it works! The preview is animated and the playback controls are displayed normally. Checkout https://github.com/exgphe/quicklook-webm. Any feedback is welcome! |
I try to make a QuickLook Preview Extension that generates an HTML to play WebM and it works! The preview is animated and the playback controls are displayed normally. Checkout https://github.com/exgphe/quicklook-webm. Any feedback is welcome! |
No description provided.
The text was updated successfully, but these errors were encountered: