Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Wowfunhappy

macrumors 68000
Original poster
Mar 12, 2019
1,955
2,181
Because there's a limited amount to do during the age of COVID, for a while now I've been working on a weird project. I really enjoy watching videos in QuickTime Player X—I like the look and feel, and the minimalist UI—but the number of supported video formats is lacking, to say the least. It doesn't support older XVID videos, it doesn't support the VP9 format YouTube uses for 4K, and it doesn't support HEVC on any OS's older than 10.13.

Of these, the most annoying for me was the lack of VP9 support. I watch nearly all Youtube videos by downloading them with an Automator Service, and even on my 1080p screen, 4K Youtube videos clearly look nicer due to their higher bit-rate. QuickTime used to have a plugin system for third party codecs, but they dropped support beginning in Mavericks (my OS of choice). And because they dropped support, no one has ever bothered to release a plugin for HEVC or VP9.

But there were plugins! Flip4Mac developed a plugin for Microsoft's WMV format, and Perian famously added support for a wide range of formats by leveraging open-source FFmpeg code. Newer versions of FFmpeg support newer formats, but not the old version Perian is based on.

@Madd the Sane has tried a couple of times over the years to update Perian to use a newer version of FFmpeg, but he never got it working, and I didn't think I'd be able to do anything he could not. However, I noticed that another developer, René Bertin, had previously created a stripped down version of Perian called FFusion†, which removed a number of importers that (as I recall) never worked well anyway. I thought that this version might be easier to update, and I think I was right. :) Here's the result:


Copy this into Library/QuickTime, and you should be able play 4K videos downloaded from Youtube. You'll want to tell youtube-dl to grab the VP9 video stream and the AAC audio stream, and to combine the two into an MP4 container. Or, download videos via my nifty little Automator service; the 4K version will automatically select the right formats.

I've tested this component most extensively in Mavericks, but it also appears to work in Lion and Mountain Lion. It may or may not work in Snow Leopard.

----------

...now, if you've been paying weirdly close attention up until this point, the proceeding paragraph probably threw you for a loop. How can this component work on Mavericks, if Mavericks was when Apple dropped support for third party QuickTime components?

Well, that brings me to the other thing I've been working on—getting the Mountain Lion version of QuickTime to work in Mavericks! I wrote code to replace a couple of functions that Apple removed from AVFoundation, and added workarounds for a bunch of graphical glitches and a couple other quirks. I'm quite pleased with the result!


Now for an important caveat in all of this—these projects are designed for old OS's, but I'm nervous about how FFusion in particular will perform on old hardware. My 4790K is considerably faster than most Mavericks machines, and VP9 and especially HEVC are complicated formats.

I'm well aware that all of this is likely to have a very niche audience. It's for people running old versions of OS X, on either not-so-old or just unusually powerful hardware, who also download Youtube videos before watching them and also don't want to use VLC. At the end of the day, I basically made all of this for myself... but, I'm hoping it might be useful to someone else as well? I've certainly invested a lot of time at this point!

So, uh, if you're interested, try it and let me know how it works, or doesn't work? Up to you! :)

----------

† Okay, it's actually a little more complicated than that. The original version of FFusion was written circa-2003 by Jérôme Corne. This project later served as the basis for Perian, but Perian also added importers for a bunch of non-Apple container formats. In 2013, René Bertin removed all of Perian's importers so that the code would be easier to port to Windows, and named his version back to FFusion. I used René Bertin's version as a base for my version.
 
Last edited:
^ I've significantly expanded the description above. Hopefully someone will enjoy the history, regardless of whether the component itself is useful to anyone other than me!

I'll also add that if there's any actual developers here, and especially anyone with ffmpeg experience, I could really use some guidance on why HEVC isn't working. http://ffmpeg.org/pipermail/libav-user/2021-January/012644.html
 
...turns out performance isn't as bad as I thought it would be. I had the opportunity to use this over the weekend on my 2014 Macbook Air. 4K VP9 videos played without issue, although the fans did spin up.

That's still faster hardware than a lot of Macs, but not so fast either. And remember that decoding 4K is intensive no matter the codec; a VP9 stream that was 1080p or below would certainly consume less cpu.
 
  • Like
Reactions: lowendlinux
When our son took 4k-footage with his GoPro some years ago, my then core2duo 2.5GHz MBP was in real trouble with just stuttering playback.
I think 4k-video is the same for early Intels as 780p video is for PPC.
I keep my thumbs pressed for the success of your project!
 
This is reallllllly super cool and I'm excited to know it's possible!!!!
 
HEVC is done. Have fun. (But have some sympathy for your poor CPU, it's trying its best!)


Another reminder that you need a very good CPU! Even on my 4790K, QuickTime struggles with certain 4K HEVC videos, especially ones which use 10-bit color (yuv420p10le).

You may have more success with videos that use 8-bit color (yuv420p), and of course lower resolutions. The decoder is also very good at multi-threading, so if you have a Mac Pro with tons of cores, this is its time to shine!

I may or may not have broken Snow Leopard? I can't tell if the problem is my VM or if it will happen on real hardware. 10.7–10.9 all work though.

This is reallllllly super cool and I'm excited to know it's possible!!!!

Amazing what can happen when Apple actually supports third party codecs, as they once did, isn't it? :D
 
Last edited:
HEVC is done. Have fun. (But have some sympathy for your poor CPU, it's trying its best!)


Another reminder that you need a very good CPU! Even on my 4790K, QuickTime struggles with certain 4K HEVC videos, especially ones which use 10-bit color (yuv420p10le).

You may have more success with videos that use 8-bit color (yuv420p), and of course lower resolutions. The decoder is also multi-threaded, so if you have a Mac Pro with tons of cores, this is its time to shine!

I may or may not have broken Snow Leopard? I can't tell if the problem is related is caused by my VM. 10.7–10.9 all work though.



Amazing what can happen when Apple actually supports third party codecs, isn't it? :D

It's just a shame they don't do that any more with AVFoundation. I didn't initially realize just how old these frameworks were; the qtkit example code contains references to 68K CPUs!

I’m not (yet) able to get this to work with QTX and Snow Leopard, but I’m also mindful my hardware (T9500) may not be up to the challenge here.

This is a cool feature nevertheless!
 
I’m not (yet) able to get this to work with QTX and Snow Leopard, but I’m also mindful my hardware (T9500) may not be up to the challenge here.
May I ask what's happening? It should technically play even if your cpu is slow, it'll just be terribly stuttery. (Or in the case of Snow Leopard, the colors may be wrong, something is up with pixel formats.) Remember the video needs to be in a container that QuickTime knows how to open.

Does the attached, very small HEVC video work? In Snow Leopard, it should play in QuickLook too!

View attachment jellyfish-hevc-360p.mov.zip
 
May I ask what's happening? It should technically play, just be terribly stuttery. (Or in the case of Snow Leopard, the colors may be wrong, something is up with pixel formats.)

Remember the video needs to be in a container that QuickTime knows how to open, like a .mov file. (But you can switch to a different container very easily with ffmpeg; I have a script that does this automatically which I will also share at some point.)

Does the attached, very small HEVC video work? In Snow Leopard, it should play in QuickLook too!

View attachment 1806944

No, I think the issue may be more fundamental than anything specific to your component. The type of warning/error notifications (#1) look a whole lot like when I try to download a YT clip as mp4 in PPCMC whilst running in Rosetta (#2):

1626402524066.png
1626402710452.png


I haven’t figured out what the issue is. I did let @alex_free know about the error on the PPCMC thread, but now that I’m seeing it here as well, I think the issue could be related to youtube-dl (which is, as far as I know, the current build, as I used macports to install the latest version earlier today).
 
  • Like
Reactions: alex_free
May I ask what's happening? It should technically play even if your cpu is slow, it'll just be terribly stuttery. (Or in the case of Snow Leopard, the colors may be wrong, something is up with pixel formats.) Remember the video needs to be in a container that QuickTime knows how to open.

Does the attached, very small HEVC video work? In Snow Leopard, it should play in QuickLook too!

View attachment 1806944
Is this on PowerPC with the color issues? On PowerPC the ‘rgba’ spec name requested is byteswapped IIRC. I had to work around that specifically with FFplay by forcing it to play in rgba via the command line.
 
No, I think the issue may be more fundamental than anything specific to your component. The type of warning/error notifications (#1) look a whole lot like when I try to download a YT clip as mp4 in PPCMC whilst running in Rosetta (#2):

View attachment 1806945View attachment 1806949

I haven’t figured out what the issue is. I did let @alex_free know about the error on the PPCMC thread, but now that I’m seeing it here as well, I think the issue could be related to youtube-dl (which is, as far as I know, the current build, as I used macports to install the latest version earlier today).
This looks like there is no DNS and or internet to resolve the URL. If on Rosetta this may be a Rosetta bug.
 
  • Like
Reactions: B S Magnet
Is this on PowerPC with the color issues? On PowerPC the ‘rgba’ spec name requested is byteswapped IIRC. I had to work around that specifically with FFplay by forcing it to play in rgba via the command line.
Nope, Intel Snow Leopard, although I do wonder if it's related somehow, particularly as the color conversion code in FFusion has a bunch of byte-swapping routines. The other weird thing is QuickTime and QuickLook seem to display different colors.

(I haven't bothered trying this on PPC at all, due to how CPU intensive the new codecs are.)

No, I think the issue is more fundamental than anything specific to your component. The type of warning/error notifications (#1) looks a whole lot like when I try to download a YT clip in PPCMC whilst running in Rosetta (#2):

Okay! Just to be sure, the youtube-dl syntax I generally use these days is:

Code:
youtube-dl VIDEO-URL-HERE -f '((bestvideo[height>1080][vcodec!^=av01]/bestvideo[vcodec^=avc1])+bestaudio[ext=m4a])/best' --add-metadata --merge-output-format mp4

This will grab the VP9 video stream for >1080P Youtube videos which never have an H.264 stream, but will still get the H.264 stream for ≤ 1080P videos.

(I'm a little confused as to why the path to the FFusion codec is in the Terminal screenshot you posted. They shouldn't interact at all.)
 
Last edited:
  • Like
Reactions: alex_free
Nope, Intel Snow Leopard, although I do wonder if it's related somehow, particularly as the color conversion code in FFusion has a bunch of byte-swapping routines. The other weird thing is QuickTime and QuickLook seem to display different colors.

(I haven't bothered trying this on PPC at all, due to how CPU intensive the new codecs are.)



Okay! Just to be sure, the youtube-dl syntax I generally use these days is:

Code:
youtube-dl VIDEO-URL-HERE -f '((bestvideo[height>1080][vcodec!^=av01]/bestvideo[vcodec^=avc1])+bestaudio[ext=m4a])/best' --add-metadata --merge-output-format mp4

This will grab the VP9 video stream for >1080P Youtube videos which never have an H.264 stream, but will still get the H.264 stream for ≤ 1080P videos.

Using your syntax here and including the YT sample clip, just now:

1626405735678.png


(I'm a little confused as to why the path to the FFusion codec is in the Terminal screenshot you posted. They shouldn't interact at all.)

That was me trying something on a lark, sorry about that.
 
Snow Leopard issues have been fixed. This component should now work fully on Snow Leopard.

An old comment in the Perian code told me I needed to do something hacky. I read this comment and thought, screw you, that sounds stupid, oh look I just tried it without the hack and it worked fine! Turns out it didn't actually work fine, and I should have listened.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.