mkv + 1080p = choke

The Perian forums have moved to Google Groups, this forum is read only.
ball
Harmless
Posts: 13
Joined: Tue May 25, 2010 5:48 am

mkv + 1080p = choke

Postby ball » Tue May 25, 2010 8:00 pm

Hello,
I tried to view a h264 1080p show on my 2.8ghz C2D Macbook 17 using Perian and QuickTime Player X. I was hoping hardware acceleration would be used, but I doubt this is the case. Fortunately, a beta of Plex supports HW acceleration and it worked beautifully (forgiving the fact that Plex's UI blows).

I have read that the fix may not be within the ability of a 3rd party due to the manner QuickTime works. Now that Google has chosen Matroska as their container format (renaming it WebM, which is idiotic IMO), perhaps Apple could be convinced that they are falling behind the curve and ought to make QuickTime more flexible and allow, among other things, streaming in real-time without the hack of sending mp4 segments.

The MP4 patent pool was disbanded due to lack of interest, so there's no bone to fight over, here. Any MP4 features not in MKV can be incorporated to make a better overall container format.

Thoughts?

Trevize
Harmless
Posts: 13
Joined: Thu Mar 24, 2005 9:14 am
Contact:

Re: mkv + 1080p = choke

Postby Trevize » Tue May 25, 2010 9:37 pm

QuickTime 7 hardware acceleration is quite limited. It probably won't play your high profile h.264 video.

Yes, WebM is so flexible that it only allows VP8 and Vorbis. And I don't see Google adding any other formats soon, it's already hard to have browser support for one pair of video/audio.
Outside of WebM, matroska just feeds off piracy, like divx. Apple never cared much about it.

Streaming is a non-issue. There are already dedicated protocol for it, and the http based solutions works well, so why change it? Apple uses .m2ts segments (not mp4) for their http streaming technology, Microsoft uses fragmented mp4 for silverlight's smoothstreaming. I guess those are more optimized than just sending a .mkv files to a client.

ball
Harmless
Posts: 13
Joined: Tue May 25, 2010 5:48 am

Re: mkv + 1080p = choke

Postby ball » Tue May 25, 2010 11:01 pm

Well I don't know if you're just spreading FUD, but I'll say that without HW acceleration I can't play these videos. Your comment about how hard it is "to have browser support for one pair of video/audio" smells of pure BS.

If it's useful I could try converting one of them to mp4 (mov/MooV) and see if QuickTime no longer chokes on it.

gbooker
Cocoaforge Admin
Posts: 723
Joined: Sat May 06, 2006 2:47 am
Contact:

Re: mkv + 1080p = choke

Postby gbooker » Wed May 26, 2010 12:42 am

ball wrote:The MP4 patent pool was disbanded due to lack of interest, so there's no bone to fight over, here

You try and violate one of the patents and see if someone doesn't come after you. If you're Google, they likely will. I will be surprised if Google isn't sued over VP8 for it's patent infringement.

Trevize wrote:QuickTime 7 hardware acceleration is quite limited. It probably won't play your high profile h.264 video.

We've noticed that QT's hardware acceleration does have some issues with high-profile content.

Trevize wrote:Outside of WebM, matroska just feeds off piracy, like divx.

Stop it with the libel. MKV (and divx too) has a thriving and completely legitimate community. In fact, the primary use for MKV when it was added to Perian was freely distributed anime.

ball wrote:If it's useful I could try converting one of them to mp4 (mov/MooV) and see if QuickTime no longer chokes on it.

That's certainly a useful test. It will improve performance since the content is not being imported during playback, the question is to what extent.

ball
Harmless
Posts: 13
Joined: Tue May 25, 2010 5:48 am

Re: mkv + 1080p = choke

Postby ball » Wed May 26, 2010 12:53 am

OK, well I've seen conflicting methods on the best way to convert a mkv to mov. Should I just open the clip in QTP and save it? It's also been suggested to use mkvextract and MP4Box.

http://forums.macrumors.com/showthread.php?t=301017

Mr VacBob
Crema
Posts: 330
Joined: Thu Jan 04, 2007 11:14 pm
Contact:

Re: mkv + 1080p = choke

Postby Mr VacBob » Wed May 26, 2010 10:48 pm

gbooker wrote:We've noticed that QT's hardware acceleration does have some issues with high-profile content.


QTX seems to work okay. I think a QT7 component using VDADecoder will work out, but someone has to write it. I don't have time unfortunately.

gbooker wrote:
ball wrote:If it's useful I could try converting one of them to mp4 (mov/MooV) and see if QuickTime no longer chokes on it.

That's certainly a useful test. It will improve performance since the content is not being imported during playback, the question is to what extent.


If you want to do a straight copy (loses subtitles), export as MPEG4 and set Video/Audio to Passthrough. Use QTAmateur if you don't have QuickTime Pro. That should be HW accelerated under QTX and the right hardware.

If you want to reencode (make a hardsub) using some non-QT encoder is preferable. Unfortunately I can't recommend anything that will support ASS.
Save to Web from QT Player will work, as well as exporting to MPEG-4 without choosing Passthrough, but might lose embedded fonts (limitation of Perian) and will generate very oversized files (limitation of QT).

x264Encoder will help but it's still complicated… I know someone working on ASS support for Handbrake, at least, so that should help.

ball
Harmless
Posts: 13
Joined: Tue May 25, 2010 5:48 am

Re: mkv + 1080p = choke

Postby ball » Thu May 27, 2010 1:09 am

For the record, it is QTX that's choking. I haven't even attempted playing HD movies with Carbon QT.

I don't want to re-encode as the only reason I'm considering converting containers is to see if that fixes HW acceleration.

Dragon
Harmless
Posts: 4
Joined: Wed Jun 22, 2005 6:35 am

Re: mkv + 1080p = choke

Postby Dragon » Sat May 29, 2010 8:52 pm

Unless i"m mistaken, if you play any non mp4 file in QTX, ie files needing plugins, it still gets handed to the QT7 framework for actual playback? hence the issue currently.

ball
Harmless
Posts: 13
Joined: Tue May 25, 2010 5:48 am

Re: mkv + 1080p = choke

Postby ball » Mon May 31, 2010 9:50 pm

I've been playing other mkv, avi, etc. files in QTX with Perian no problem.

I have a little bit of free time now, so I'll try converting the container and see what happens

ball
Harmless
Posts: 13
Joined: Tue May 25, 2010 5:48 am

Re: mkv + 1080p = choke

Postby ball » Tue Jun 01, 2010 1:19 am

OK guys, I've experimented a bit and here's what I've observed.

First of all, these are the video players I've tested listed from best performance to worst (in terms of jerkiness, playing the sample .mkv):

• Plex accelerated (doesn't drop frames)

• QuickTime Player 7 (woohoo! Seems to use acceleration, too, based on CPU usage)

• Plex unaccelerated (close, but uses a LOT more CPU)

• QTX (jerky)

• QTAmateur (uses more CPU than QTX and jerks more)

• VLC (extremely poor. Visual quality looks poorer, as well)

I also opened it in MPEG Streamclip and saved it as a .mov and .mp4 to see if that would help. The .mov version didn't affect playback speed in any player to my eye, although, curiously, it disabled audio in VLC and Plex (the audio stream is DTS 5.1). However, the .mp4 played full speed in QTX and the MOST efficiently of all players (lowest CPU). Unfortunately, this export lacked the audio stream and I haven't figured out how to add it to an .mp4. MPEG Streamclip also provided these stats on the clip I'm using to test:

Duration: 0:00:26
Data Size: 109.54 MB
Bit Rate: 35.18 Mbps

Video Tracks:
H.264, 1920 × 1080, 25 fps, 34.20 Mbps

Audio Tracks:
?, 0.001 kHz, 1.51 Mbps

Stream Files:
BBC.Life.E01.2009_sample.mkv (109.54 MB)


1) There is absolutely a difference between Plex with hw acceleration and without. Without, it doesn't drop many frames, but CPU usage increases by more than half.

2) Plex plays the movie better than QTX or QTAmateur, which is unfortunate given the poor interface. However, I installed QT7 (optional installation in Snow Leopard) and it worked fabulously. QTX only plays full speed if it's an .mp4.

3) When using QTX, the process consuming the CPU is QTKitServer and uses 75%+ with choppy play. I believe this is due to the Carbon container which allows QTX to use the older components. When using QTAmateur, it uses over 100% CPU which suggests to me QuickTime may be smart enough to decode the audio and video in separate threads *shrug*. When using QT7, CPU usage is lower than 30% and it plays well.

QTX has become my favourite player, but unfortunately I can't as yet figure out how to put the audio stream back in the mp4 container. Fortunately I've discovered QT7 plays .mkv with Perian just fine! Woot!

ball
Harmless
Posts: 13
Joined: Tue May 25, 2010 5:48 am

Re: mkv + 1080p = choke

Postby ball » Tue Jun 01, 2010 1:37 am

PS: There is quite a delay when playing after pausing or seeking in QT7. Not so in Plex. QTX has to hit a keyframe in the mp4 before it resumes properly.

ball
Harmless
Posts: 13
Joined: Tue May 25, 2010 5:48 am

Re: mkv + 1080p = choke

Postby ball » Tue Jun 01, 2010 2:46 am

OK, so I descended the rabbit hole that is converting mkvs to mp4s. I extracted the dts and h264 streams using mkvextract, converted the audio to aac, but when I MP4Box them QTX doesn't like the file. Plays in VLC. QT7 complains "An invalid sample description was found in the movie."

The .ac3 file plays in Quicktime, as does the mp4 before I add the ac3 stream. They just don't play when MP4Boxed together.

gbooker
Cocoaforge Admin
Posts: 723
Joined: Sat May 06, 2006 2:47 am
Contact:

Re: mkv + 1080p = choke

Postby gbooker » Tue Jun 01, 2010 2:57 am

ball wrote:PS: There is quite a delay when playing after pausing or seeking in QT7. Not so in Plex. QTX has to hit a keyframe in the mp4 before it resumes properly.

Upon play/resume, QT7 (maybe X too, not sure) reconstructs the frame from the last keyframe. We've seen this when running the debug logging enabled in Perian.

So, let me get this straight:
MKV: Plays fine in QT7 and Plex?
MP4: Same?
QTX, VLC don't play either well?
QTAmateur is the worst of the lot?

I imagine NicePlayer will be the same as QTAmateur. I noticed that NicePlayer doesn't seem to thread, which could be the same with QTAmateur as well.

BTW, I believe the carbon interface also is 32-bit but QTX is 32/64-bit. Try QTX in 32-bit mode and see if it makes a difference (I don't remember how to do that right now as my 64-bit computer has been at Apple's repair place for a week now).

ball
Harmless
Posts: 13
Joined: Tue May 25, 2010 5:48 am

Re: mkv + 1080p = choke

Postby ball » Tue Jun 01, 2010 3:30 am

OK, here's the magic sauce:

http://bahut.alma.ch/2010/02/quicktime- ... ample.html

Specifically:
"Examining the difference, it seems that both ffmpeg and MP4Box were making an MPEG-2 AAC track, and Quicktime wanted an MPEG-4 track instead."

Unfortunately, the source seems to be incompatible with the libtool included in SnowLeopard.

ball
Harmless
Posts: 13
Joined: Tue May 25, 2010 5:48 am

Re: mkv + 1080p = choke

Postby ball » Tue Jun 01, 2010 3:34 am

gbooker wrote:So, let me get this straight:
MKV: Plays fine in QT7 and Plex?

Yes
MP4: Same?

Yea, but mp4 can only have acc audio and I can't compile the magic tool to make that work (mp4creator)
QTX, VLC don't play either well?

QTX plays the video-only mp4 just fine, and plays it using the least amount of CPU
QTAmateur is the worst of the lot?

VLC is the worst, by far

I imagine NicePlayer will be the same as QTAmateur. I noticed that NicePlayer doesn't seem to thread, which could be the same with QTAmateur as well.

BTW, I believe the carbon interface also is 32-bit but QTX is 32/64-bit. Try QTX in 32-bit mode and see if it makes a difference (I don't remember how to do that right now as my 64-bit computer has been at Apple's repair place for a week now).


Uh, OK but I highly doubt this will help.

ball
Harmless
Posts: 13
Joined: Tue May 25, 2010 5:48 am

Re: mkv + 1080p = choke

Postby ball » Tue Jun 01, 2010 3:35 am

QTX in 32bit mode changes nothing

ball
Harmless
Posts: 13
Joined: Tue May 25, 2010 5:48 am

Re: mkv + 1080p = choke

Postby ball » Tue Jun 01, 2010 3:42 am

NicePlayer also chokes about the same as QTX when playing mkv

Mr VacBob
Crema
Posts: 330
Joined: Thu Jan 04, 2007 11:14 pm
Contact:

Re: mkv + 1080p = choke

Postby Mr VacBob » Wed Jun 02, 2010 6:11 am

ball wrote:OK, here's the magic sauce:

http://bahut.alma.ch/2010/02/quicktime- ... ample.html

Specifically:
"Examining the difference, it seems that both ffmpeg and MP4Box were making an MPEG-2 AAC track, and Quicktime wanted an MPEG-4 track instead."

Unfortunately, the source seems to be incompatible with the libtool included in SnowLeopard.


I think that's not the real difference - it sounds like the AAC extradata (profile type) isn't being reconstructed properly. I couldn't comment without seeing the generated files myself. If you could post part of the original .mpg, I can see if ffmpeg can be fixed in the future.

ball
Harmless
Posts: 13
Joined: Tue May 25, 2010 5:48 am

Re: mkv + 1080p = choke

Postby ball » Thu Jun 03, 2010 4:36 am

Small update:

Armed with this knowledge, I started watching all my h254 mkvs with QT7 and my CPU usage has gone down drastically. Even though QTX can keep up with most HD vids which haven't as high a bit rate, QT7 plays them better.


Return to “Perian”

Who is online

Users browsing this forum: No registered users