How to make transcoding to extenders use QuickSync?

Having trouble playing all your different media types? Ask here!
Post Reply
glugglug

Posts: 391
Joined: Thu Jun 09, 2011 1:34 am
Location:

HTPC Specs: Show details

How to make transcoding to extenders use QuickSync?

#1

Post by glugglug » Wed Mar 19, 2014 6:27 pm

If either the XBOX struggles with playback of a video, or the quality and non-negligible CPU level make it evident that the playback is transcoding, what I do now with my Haswell system is transcode it to an mp4 using handbrake QSV h.264 encoding, with "Best Quality" QSV preset (meaning slowest as opposed to faster with a higher bitrate for the same quality) H.264 4.1, Q16 (higher quality than recommended for both HD and SD, basically looks non-lossy), look ahead and other options enabled, etc, and transcode the audio to AAC.


Even with these slowest settings it takes about 5-10 minutes to transcode a 2 hour movie that plays perfectly on the xbox, and the CPU usage is actually pretty low during the transcoding (it might not even be a multithreaded codec!). So there is no reason it shouldn't be able to do real-time transcoding with no noticable quality loss. I vaguely remember there being a section of the registry that tells WMC what bitrate (and codec?) to use for each resolution of transcoded video. Do I need transcode 360 installed to enable this? (I am kind of afraid of it making things worse. Wasn't it really for Vista which didn't do transcoding of codecs not natively extender supported by default?) How do I make the transcoding use QSV x264 (and a higher bitrate) instead of whatever it is using now?


I have the Sharky007 codec installed, but nowhere near the latest version. (Would any newer version of it enable QSV transcoding?)

glugglug

Posts: 391
Joined: Thu Jun 09, 2011 1:34 am
Location:

HTPC Specs: Show details

#2

Post by glugglug » Thu Mar 20, 2014 1:45 am

I'm guessing it requires some additions to the HKLM\Software\Microsoft\Windows Media Player NSS\3.0\Transcode registry branch. But there are A LOT of keys under there for each codec. Is there any documentation anywhere on what these registry settings do?

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#3

Post by barnabas1969 » Thu Mar 20, 2014 4:45 am

Wow. Your question is so complicated, I'm not sure what you really want.

But... as I understand it... "Transcode 360" doesn't really transcode anything on Win 7/8. As mikinho has described it, it is really the "transcode hole", which actually just passes the original video codec, without any modification, to the Xbox360.

If you've found a way to reliably transcode 2-hour videos in 5-10 minutes, then I would recommend that you do two things:

1) SHARE IT WITH EVERYONE!
2) Don't change anything.

glugglug

Posts: 391
Joined: Thu Jun 09, 2011 1:34 am
Location:

HTPC Specs: Show details

#4

Post by glugglug » Thu Mar 20, 2014 12:32 pm

So yes, Quicksync is just that good that it takes 5-10 minutes to transcoded 2 hours with the slowest settings for the best quality/bitrate ratio. The nightly betas of Handbrake have supported it about 6 months now, but its still not in the release build yet. With default settings its more like 2 minutes to transcode 2 hours of HD.

Remember when Has well was first released reviewers noticed that Quicksync was slower on Haswell than Ivy Bridge and they thought it was a bug (while still insanely fast)? It turns out not to be a bug..... Its because the fastest settings on Haswell are higher quality than the slowest on Ivy. In fact I've seen a site showing that for any bitrate below ~6Mbps, Haswell QSV produces better quality output than the best x264.


The problem is is Media Center is clearly *NOT* using QSV in its automatic transcoding. I'd like it to do this to eliminate the extra step of transcoding each file in Handbrake after torrenting the wife's EastEnders each week for example.

mike_ekim

Posts: 174
Joined: Fri Feb 07, 2014 4:12 pm
Location:

HTPC Specs: Show details

#5

Post by mike_ekim » Thu Mar 20, 2014 3:38 pm

glugglug wrote:So yes, Quicksync is just that good that it takes 5-10 minutes to transcoded 2 hours with the slowest settings for the best quality/bitrate ratio. The nightly betas of Handbrake have supported it about 6 months now, but its still not in the release build yet. With default settings its more like 2 minutes to transcode 2 hours of HD.
What are you transcoding from, i.e. what is the original container and audio/video format? My (admittedly limited) understanding is that transcoding involves first decoding and then encoding the video, and doing the same with the audio, and quick sinc helps encoding to h.264 but has no benefit whatsoever with decoding the non-h.264 video or with the audio. Typical numbers I have seen are about a 2.5X to 6X encoding speed improvement with quick sinc, depending on (for example) if the new look ahead is used, which increases quality but decreases speed.

When I transcode it takes about 2 minutes just to remux the container.

http://www.tetrachromesoftware.com/q264 ... Ahead.html

And here's an article where a haswell takes about 8 minutes to transcode a 30-minute video with the best settings using an i7-4770K. That would translate to 32 minutes to transcode a 2-hour video.

http://missingremote.com/review/intel-q ... erformance

glugglug

Posts: 391
Joined: Thu Jun 09, 2011 1:34 am
Location:

HTPC Specs: Show details

#6

Post by glugglug » Thu Mar 20, 2014 4:27 pm

mike_ekim wrote: My (admittedly limited) understanding is that transcoding involves first decoding and then encoding the video, and doing the same with the audio, and quick sinc helps encoding to h.264 but has no benefit whatsoever with decoding the non-h.264 video or with the audio.
This may account for a large amount the difference. It is likely that the earlier QSV transcoders only supported encode acceleration. The handbrake beta supports decode acceleration when the input is H.264 (although IIRC this is not the default).
And here's an article where a haswell takes about 8 minutes to transcode a 30-minute video with the best settings using an i7-4770K. That would translate to 32 minutes to transcode a 2-hour video.

http://missingremote.com/review/intel-q ... erformance
I'm not sure what app they are using to test the Quicksync encoding in that article, but the handbrake support for it didn't exist yet when that was written (even in the betas). It may be that both the libraries themselves and the apps using them have substantially improved since then. And yes, I'm talking about actual transcodes, not just container remuxes. There have been at least 2 revisions to the underlying QSV libraries themselves adding new options since September.

The input is usually a downloaded MKV, which either WMC is transcoding or the XBOX is freezing on. It could be transcoding because of the it using DTS or other audio codecs the XBOX doesn't support natively, or maybe it was done as XVID or something like that causing it to transcode. The freeze-ups would typically be H.264 so automatic transcoding doesn't happen, but using something like a 5.1 profile or VBR bitrates peaking above ~16Mbps, either of which cause the XBOX to freeze up. I reencode to an mp4 using H.264 4.1 High profile, constant quality ("16"), usually with AAC audio remuxed to 224kbps stereo if it was 5.1.


And yeah, like you said, on a typical machine it would take ~2 minutes to remux, limited by disk speed. I am using a pool of 4x 4TB WD40ZFRX (red) drives (2x replication in DrivePool), and 16GB of RAM so it could potentially be finished awhile before the writes have flushed to disk. Read striping is enabled, so it could potentially be reading a large file like that at up to 300MB/s.

mike_ekim

Posts: 174
Joined: Fri Feb 07, 2014 4:12 pm
Location:

HTPC Specs: Show details

#7

Post by mike_ekim » Thu Mar 20, 2014 5:25 pm

glugglug wrote: This may account for a large amount the difference. It is likely that the earlier QSV transcoders only supported encode acceleration. The handbrake beta supports decode acceleration when the input is H.264 (although IIRC this is not the default).
Wow, that's pretty awesome. I had read up on Haswell QuickSync last fall when all the issues hadn't been worked out, but hadn't been keeping up with it. When I googled it yesterday/today I guess I didn't come across the latest and greatest info.

Between the speed and the quality improvements it is obvious I need to change how I'm set up to transcode.

glugglug

Posts: 391
Joined: Thu Jun 09, 2011 1:34 am
Location:

HTPC Specs: Show details

#8

Post by glugglug » Mon Mar 31, 2014 3:28 am

One of the handbrake changes this week was listed as "fixing" the quality slider for QSV and H.265, I went and grabbed the latest nightly beta and noticed 2 things:

1. My Q16 preset got changed to Q35 or something like that, the slider now has a bigger range.
2. When I set it back to 16 and try it out, it is going about half the speed and producing a larger file. I need to figure out what quality to use now to get the same result as before. Maybe the Q35 it changed my Q16 preset to by default?

Post Reply