This project has moved and is read-only. For the latest updates, please go here.

Open Source QuickSync Encoder Now Available

Mar 19, 2013 at 4:37 PM
I saw that Andy VT just released an open sourced encoder for Quick sync called QSTranscode located here: http://babgvant.com/blogs/andyvt/archive/2013/03/18/qstranscode.aspx

I ran a quick test and it did a 720P conversion in under 10 min on a SNB processor (~4x faster than my handbrake profile). However, it had some stuttering issues and I will need to do some investigations (I fed it a WTV directly to get an MP4 - no remux).

It might be an interesting option to add to MCEBuddy. Is it difficult to add it as an encoder?
Mar 20, 2013 at 5:31 PM
Although the transcoding speed is wonderful and the picture looks good for my needs, I have been unable to find acceptable settings for my Apple devices. The video plays smoothly on VLC, but had audio sync issues. However, the Video stutters heavily in Quicktime, ATV2, and Ipad. It will need some work before I can use it... I will take the feedback back to their forum.
Mar 21, 2013 at 5:14 AM
Any new encoder would need to support basic functions such a resizing cropping volume quality audio track selection.

If these are documented I can look at adding support for the encoder.

On Mar 20, 2013, at 12:31 PM, "stodly" <notifications@codeplex.com> wrote:

From: stodly

Although the transcoding speed is wonderful and the picture looks good for my needs, I have been unable to find acceptable settings for my Apple devices. The video plays smoothly on VLC, but had audio sync issues. However, the Video stutters heavily in Quicktime, ATV2, and Ipad. It will need some work before I can use it... I will take the feedback back to their forum.
Mar 21, 2013 at 5:18 AM
It looks pretty good support wise for required features. Once it stabilizes let me know and I will add support for it.

On Mar 19, 2013, at 11:37 AM, "stodly" <notifications@codeplex.com> wrote:

From: stodly

I saw that Andy VT just released an open sourced encoder for Quick sync called QSTranscode located here: http://babgvant.com/blogs/andyvt/archive/2013/03/18/qstranscode.aspx

I ran a quick test and it did a 720P conversion in under 10 min on a SNB processor (~4x faster than my handbrake profile). However, it had some stuttering issues and I will need to do some investigations (I fed it a WTV directly to get an MP4 - no remux).

It might be an interesting option to add to MCEBuddy. Is it difficult to add it as an encoder?
Oct 17, 2013 at 8:37 PM
Edited Oct 17, 2013 at 8:45 PM
Any news on this? QSTranscode has been updated a lot since March :)

http://sourceforge.net/projects/qstranscode/
Oct 18, 2013 at 1:23 AM
No. Since handbrake has provided support for quick sync encoder this is redundant.

Search the forum on how to download and use the latest version of handbrake with qs support
Oct 18, 2013 at 1:34 AM
Thanks. Trying the new handbrake now. :)
Oct 18, 2013 at 1:35 AM
Let me know how it goes.

Also since you brought this up, I"ll look into the feasability for this.
Oct 18, 2013 at 2:37 AM
Edited Oct 18, 2013 at 2:50 AM
It doesn't work correctly when I run it with MCEBuddy.
2013-10-17T20:23:38 MCEBuddy.AppWrapper.Handbrake --> [20:23:38] thread 28e6d0 started ("libhb")
2013-10-17T20:23:38 MCEBuddy.AppWrapper.Handbrake --> HandBrake svn5838 (2013101601) - MinGW x86_64 - http://handbrake.fr
2013-10-17T20:23:38 MCEBuddy.AppWrapper.Handbrake --> 4 CPUs detected
2013-10-17T20:23:38 MCEBuddy.AppWrapper.Handbrake --> Opening C:\Program Files\MCEBuddy2x\working0\test.ts...
2013-10-17T20:23:38 MCEBuddy.AppWrapper.Handbrake --> [20:23:38] CPU: Intel(R) Core(TM) i5-4570S CPU @ 2.90GHz
2013-10-17T20:23:38 MCEBuddy.AppWrapper.Handbrake --> [20:23:38]  - Intel microarchitecture Haswell
2013-10-17T20:23:38 MCEBuddy.AppWrapper.Handbrake --> [20:23:38]  - logical processor count: 4
2013-10-17T20:23:38 MCEBuddy.AppWrapper.Handbrake --> [20:23:38] OpenCL: No OpenCL-compatible GPU found.
2013-10-17T20:23:38 MCEBuddy.AppWrapper.Handbrake --> [20:23:38] Intel Quick Sync Video support: yes
2013-10-17T20:23:38 MCEBuddy.AppWrapper.Handbrake --> [20:23:38]  - Intel Media SDK hardware: API 1.7 (minimum: 1.3)
2013-10-17T20:23:38 MCEBuddy.AppWrapper.Handbrake --> [20:23:38]  - Preferred implementation: hardware (any)
2013-10-17T20:23:39 MCEBuddy.AppWrapper.Handbrake --> ERROR: encqsvInit: MFXVideoENCODE_Init failed (-15)
2013-10-17T20:23:39 MCEBuddy.AppWrapper.Handbrake --> ERROR: Failure to initialise thread 'H.264/AVC encoder (Intel QSV)'
When I run it manually it works (using the same command)

"C:\Program Files\MCEBuddy2x\handbrake\HandBrakeCLI.exe" -i "d:\test.ts" --decomb --denoise="weak" --loose-anamorphic --verbose=2 -f mp4 -4 --start-at duration:3 -e qsv_h264 -b 1800 -x me=hex:trellis=2:subq=8:partitions=all:8x8dct:ref=5:rc_lookahead=50:keyint=25:keyint_min=20:bframes=3:weight_b:level_idc=40:b_pyramid=normal:direct_pred=auto:mixed_refs:deblock=-1,-1:nofast_pskip:nodct_decimate:b_adapt=2:threads=auto -X 720 -E faac -R auto -B 384 -D 2.5 -6 stereo -o "d:\test.mp4" -2
[20:23:42] hb_init: starting libhb thread

[20:23:42] thread 1d0e480 started ("libhb")
HandBrake svn5838 (2013101601) - MinGW x86_64 - http://handbrake.fr
4 CPUs detected
Opening d:\test.ts...
[20:23:42] CPU: Intel(R) Core(TM) i5-4570S CPU @ 2.90GHz
[20:23:42]  - Intel microarchitecture Haswell
[20:23:42]  - logical processor count: 4
[20:23:42] GPU #1: Intel(R) Corporation Intel(R) HD Graphics 4600
[20:23:42]  - driver version: 9.18.10.3272
[20:23:42]  - OpenCL device type: GPU
[20:23:42] Intel Quick Sync Video support: yes
[20:23:42]  - Intel Media SDK hardware: API 1.7 (minimum: 1.3)
[20:23:42]  - Preferred implementation: hardware (any)
Oct 18, 2013 at 2:17 PM
Edited Oct 18, 2013 at 2:30 PM
It looks like there may be a problem with the service seeing the GPU.

Quicksync not available to a service process?

I followed some advice here and allowed the MCEBuddy service interact with the desktop, but that didn't help.
Oct 18, 2013 at 2:22 PM
Very interesting, I think Windows 8 may support accessing Graphics drivers from the Windows Session 0 (service).

Can you post the profile you've used here so I can try and test it out. I'm assuming you've downloaded the latest Windows CLI.
Oct 18, 2013 at 2:22 PM
Let me see if I can provide a workaround for this.
Oct 18, 2013 at 2:36 PM
Edited Oct 18, 2013 at 2:39 PM
Thanks, it would be great if you could "workaround" this :)

I am using Windows 7 x64 because I have extenders for WMC and they don't work on Windows 8. :(

I did download the latest nightly build from here

I am using the default profile (switched to qsv_h264)

[MP4 High Quality]
Description=High profile, high quality 2 pass MP4 (H.264/AAC) conversion, primarily for HD videos. Takes the most time but produces the best results.
2pass=true
order=handbrake,ffmpeg,mencoder
mencoder-general=-ss 3 -vf pullup,softskip,yadif=0:-1,hqdn3d,harddup
mencoder-video=-ovc x264 -x264encopts bitrate=1800:me=hex:trellis=2:subq=8:partitions=all:8x8dct:ref=5:rc_lookahead=50:keyint=25:keyint_min=20:bframes=3:weight_b:level_idc=40:b_pyramid=normal:direct_pred=auto:mixed_refs:deblock=-1,-1:nofast_pskip:nodct_decimate:b_adapt=2:threads=auto
mencoder-audio=-oac faac -faacopts br=192:mpeg=4:tns:object=2
mencoder-audioac3=-oac faac -faacopts br=384:mpeg=4:tns:object=2
mencoder-ext=.avi
mencoder-remuxto=.mp4
mencoder-audiodelay=skip
ffmpeg-general=-threads 0
ffmpeg-video=-ss 3 -vf yadif=0:-1,hqdn3d -vcodec libx264 -b 1800k -x264opts me=hex:trellis=2:subq=8:partitions=all:8x8dct=1:ref=5:rc-lookahead=50:keyint=25:min-keyint=20:bframes=3:weightb=1:level=4.0:b-pyramid=normal:direct=auto:mixed-refs=1:deblock=-1,-1:no-fast-pskip=1:no-dct-decimate=1:b-adapt=2:threads=auto -map 0:a -map 0:v
ffmpeg-audio=-acodec libfdk_aac -ab 192k -cutoff 18000
ffmpeg-audioac3=-acodec libfdk_aac -ab 384k -cutoff 18000
ffmpeg-ext=.mp4
ffmpeg-audiodelay=skip
handbrake-general=--decomb --denoise="weak" --loose-anamorphic --verbose=2 -f mp4 -4
handbrake-video=--start-at duration:3 -e qsv_h264 -b 1800 -x me=hex:trellis=2:subq=8:partitions=all:8x8dct:ref=5:rc_lookahead=50:keyint=25:keyint_min=20:bframes=3:weight_b:level_idc=40:b_pyramid=normal:direct_pred=auto:mixed_refs:deblock=-1,-1:nofast_pskip:nodct_decimate:b_adapt=2:threads=auto
handbrake-audio=-E faac -R auto -B 192 -D 0 -a 1,2,3,4,5
handbrake-audioac3=-E faac -R auto -B 384 -D 0 -a 1,2,3,4,5
handbrake-ext=.mp4
handbrake-audiodelay=skip
PreConversionCommercialRemover=true
Oct 21, 2013 at 3:37 AM
I am seeing the same issue as cmgj. Only Mencoder works for me.
Oct 21, 2013 at 4:45 AM
What do you mean by mencoder work? Can you elaborate.


Oct 24, 2013 at 2:51 PM
Edited Oct 24, 2013 at 3:38 PM
Oct 27, 2013 at 3:41 PM
rboy1 wrote:
What do you mean by mencoder work? Can you elaborate.
Only Mencoder works. Handbrake does not work at all... well MCEBuddy skips Handbrake even though it is listed first in the profile.
Oct 27, 2013 at 9:26 PM
Does mencoder have hardware encoding support?

Oct 28, 2013 at 6:20 PM
rboy1 wrote:
Does mencoder have hardware encoding support?
Not the version that I am using.
Nov 4, 2013 at 10:49 PM
Any progress on working around the "Session 0" issue in Win7 to get Quicksync to work in Win7? I see the same limitation as above - Can run the CLI manually, but can't access the GPU From MCEBuddy (2.3.14).
Nov 5, 2013 at 4:43 AM
yes I have a work around it'll have to wait for a few weeks until I get to putting the workaround in. I need to write wrappers for a whole new encoder which will take some time.
Next release we plan to dedicate to supporting hardware encoders (2.3.15). Bear with us till then.


Nov 5, 2013 at 2:42 PM
That is great new. Thanks so much!
Nov 5, 2013 at 4:46 PM
That is wonderful news. I look forward to seeing it.
Nov 6, 2013 at 5:05 AM
Before I get going on this (since I don't have a machine with OpenCL yet) I need to tell me if you can run handbrake WITH HARDWARE ENCODER as:
  1. Regular user (create a new user as a regular/restricted user)
  2. Administrator with UAC enabled - i.e. login with an Administrative account open a Command prompt and run handbrake
  3. Most important -> Administrator with Elevated privileges or UAC disabled - i.e Disable UAC in Windows, reboot login as Administrator and run handbrake OR, login as administrator, right click on Command Prompt, select Run As Administrator (now you've elevated privileges) and then run handbrake
3 Is most important to me, I need to understand if handbrake hardware encoder is not running under kernel or even under PURE administrator elevated privileges.
Nov 6, 2013 at 2:23 PM
Edited Nov 6, 2013 at 3:05 PM
Uploaded Test to cmgj/HardwareEncodeTest. Logs are included.

They all seemed to pass, and created a mp4 file with 1, 2, and 3.
Nov 9, 2013 at 4:21 PM
you can try this as a workaround for now for Windows 7.
Take the latest 2.3.14 BETA build, form the start menu under MCEBuddy click on Start CommandLine MCEBuddy Service Engine. This will stop the Windows Service and instead start a command line version of it.

Now assuming you have the new handbrake CLI, install it to the mcebuddy handbrake folder and change your profile settings. It should work. Try it and let me know.
Nov 9, 2013 at 4:23 PM
Remember the command line version is more limited in it's functionality, some functions like power management (suspend on battery etc) which are available to the windows service are not available here (atleast for now). See how it goes then we can see how to enhance this version better.
Nov 11, 2013 at 4:24 AM
Edited Nov 11, 2013 at 4:38 AM
Ok, I have had a chance to test...and this does solve the issue with the hardware encoding in session 0.

There is the same speed with the [MP4 High Quality] profile unless these are removed: --decomb --denoise="weak"

handbrake-general=--decomb --denoise="weak" --loose-anamorphic --verbose=2 -f mp4 -4
to
handbrake-general=--loose-anamorphic --verbose=2 -f mp4 -4

Any ideas here?

This was changed to do the hardware encoding;

-e qsv_h264

On my machine the orig conversion would take ~21 minutes per pass on the 2 pass encoding.

With the hardware encoding 2 pass it is now ~6 minutes per pass.

Thanks for this work around!
Nov 11, 2013 at 2:24 PM
there you go congrats.


Nov 11, 2013 at 6:04 PM
Thank you rboy1!

I am also able to speed up encoding. My 46 minute encode dropped to 22 minutes and I think there may be a bit more to gain as I didn't have the donator version comskip running. I also had to tweak the parameters to get the speed (thanks cmgj).
Nov 11, 2013 at 6:10 PM
Your welcome stodly,

I do my commercial scanning ahead of time and then tweak it manually and then pass the edl for conversion. For the last 2 one hour shows I have 16 and 20 minute conversions.

I am curious if this is the best profile for hardware encoding , or if there is something different we should use.
Nov 11, 2013 at 6:21 PM
follks please post your "optimizations" here. 2.3.15 will be decidated to hardware encoding enhancements so it'll help a taking this to next level.

e.g. you had suggestd that removing teh decomb filter helps (and I think in part because handbrake as a new filter for hardware deinterlacing)
Nov 11, 2013 at 8:10 PM
Edited Nov 11, 2013 at 8:18 PM
So far this is for the [MP4 High Quality] profile.
handbrake-general=--deinterlace=qsv --loose-anamorphic --verbose=2 -T -f mp4 -4
handbrake-video=--start-at duration:3 -e qsv_h264 -b 1800 -x me=hex:trellis=2:subq=8:partitions=all:8x8dct:ref=5:rc_lookahead=50:keyint=25:keyint_min=20:bframes=3:weight_b:level_idc=40:b_pyramid=normal:direct_pred=auto:mixed_refs:deblock=-1,-1:nofast_pskip:nodct_decimate:b_adapt=2:threads=auto
handbrake-audio=-E faac -R auto -B 192 -D 0 -a 1,2,3,4,5
handbrake-audioac3=-E faac -R auto -B 384 -D 0 -a 1,2,3,4,5
handbrake-ext=.mp4
handbrake-audiodelay=skip
Nov 11, 2013 at 10:54 PM
I am still evaluating and will need to test this more, but basically, I am trying to merge in the default ATV2 preset from handbrake with QSV. I may add QSV deinterlacing for some shows... Also note: I keep AC3 as primary Audio and tweak the title in the metadata to make it show up correctly on the ATV2.

[M4V Apple QS Normal]
Description=Apple compatible 1 pass MP4 (H.264/AAC) conversion. Produces good results and is faster than the two pass conversion. 4GB file size limit. More sensitive to errors in the source video.
order=handbrake
handbrake-general= --loose-anamorphic --verbose=2 -f mp4
handbrake-video=--start-at duration:3 -e QSV_h264 -w 1280 --modulus 2 -q 20 --cfr --qsv-preset=balanced --h264-level="3.1" --h264-profile=high
handbrake-audio=-a 1,1 -E copy:ac3,av_aac -6 auto,dpl2 -R Auto,Auto -B 0,160 -D 0,0 --gain 0,0 --audio-fallback ac3
handbrake-ext=.m4v
handbrake-audiodelay=skip
PreConversionCommercialRemover=true
CustomCommandPath="C:\Program Files\MCEBuddy2x\atomicparsley\Atomicparsley.exe"
CustomCommandParameters=""%convertedfile%" --title "%episodename%" --overWrite""
CustomCommandHangPeriod=200
CustomCommandCritical=false
Nov 12, 2013 at 2:28 PM
Just thought of an option. Can we get an option to point to the installed handbrake CLI just like we can with the comskip? This would help in reinstalls :)
Jan 8, 2014 at 9:40 AM
well if continue making progress, we don't need now will we :)
Down step 1, now I need to buy a computer with quicksync to test it :(
Jan 8, 2014 at 1:30 PM
That's very true.... :)
Jan 9, 2014 at 6:22 AM
I'd love to see Quick Sync support too. But of course I want to be able to output H.264 files in a WTV container.

I see there's a request on FFMPEG for this also:
https://trac.ffmpeg.org/ticket/2591
Feb 6, 2014 at 6:30 AM
Well we are close, I'm testing the new BETA with native quicksync support (via handbrake for now, but ffmpeg opencl also works - beta tested ofcourse, feel free to play with it when it's out).

So here's a quick comparison, I ran MP4 HQ with QuickSync vs MP4 Fast with CPU and MP4 HQ finishes 50% faster than MP4 Fast - WOW that's one fast GPU! (normally with CPU MP4 HQ takes 450% more time than MP4 Fast)
Feb 7, 2014 at 10:45 PM
Hardware encoding support with MCEBuddy running as a Service and Command Line just went live. Right now it supports OpenCL 1.2 (QuickSync and NVidia OpenCL for newer cards which support OpenCL 1.2). Currently only handbrake provides support for OpenCL encoding but MCEBuddy has been designed to support Mencoder and ffmpeg encoders also if future versions support hardware encoding.

For those who like to experiment, you can build and use the OpenCL version of ffmpeg (which support unshake and unsharp filters via OpenCL) and the current build of ffmpeg that comes with MCEBuddy allows x264lib to use OpenCL for lookahead offloading. To enable this you will need to manually edit the ffmpeg-video section and under x264opts add "opencl" to it. Google it for details. Note however that x264 in ffmpeg and opencl are still not very stable.

I haven't seen any build of mencoder which support OpenCL or any hardware encoding, however if it comes along, pop it in , customize the profile and you're ready to go.
Marked as answer by rboy1 on 2/7/2014 at 2:45 PM
Feb 7, 2014 at 11:03 PM
BTW it also works with ATI OpenCL 1.2 drivers