QSV vs CPU -- Wow...

Post your testing results with HandBrake.
Post Reply
jhsweeney
Posts: 11
Joined: Fri Feb 16, 2007 5:44 pm

QSV vs CPU -- Wow...

Post by jhsweeney »

My primary transcoding jobs consist of converting saved TiVo videos to M4V to watch on my Apple TV. That lets me keep whole seasons of shows without filling up the hard drive in my TiVo

Here is my basic work flow:

Copy the video.tivo from my TiVo to my PC using TiVo Desktop
Remove commercials and decrypt the video using VideoReDo TVSuite V4
convert to M4V using Handbrake with the "AppleTV" preset

I transcode using a desktop system with an i7-3930K CPU overclocked to 4.5GHz

I recently got a new laptop (Lenovo X1 Carbon) that has an i5-3427U CPU @ 1.80GHz

The i7 has 6 cores and no integrated graphics.

The i5 has 2 cores and Intel HD Graphics 4000

I thought it would be interesting to see how the Quick Sync Video beta would stack up against 6 CPUs (12 Threads) running the 0.9.9 release...

While I was at it, I thought I would see how the i5 would perform using CPU cores only.

Just for completeness - I've listed excepts from the logs to give full config data at the bottom of this post.

The results were pretty unbelievable

System Description / average encoding speed / Final File Size
i7-3930K desktop system / 129.26 fps / 719MB
i5-3427U laptop using CPU / 35.61 fps / 717MB
i5-3427U laptop using QSV / 119.14 fps / 849MB

I watched samples of all three videos and did not see any obvious difference in quality.

The QSV capability is very impressive. A dual Core CPU with HD4000 graphics was only 10% slower than a 6 Core CPU overclocked to 4.5GHz! The final video file produced by the QSV beta was about 20% bigger than the ones produced using the CPU only (but with 1TB drives under $100, who cares...)

It will be very interesting to how the next generation Haswell CPUs with HD5000 Graphics will perform. The news reports claim "up to 3x" improvement in graphics performance...!

System Configuration Data

i7-3930K desktop system:

Code: Select all

HandBrake 0.9.9.5470 - 64bit Version
OS: Microsoft Windows NT 6.1.7601 Service Pack 1
CPU: Intel(R) Core(TM) i7-3930K CPU @ 3.20GHz <== Remember, this CPU is actually overclocked to 4.5GHz
Ram: 16333 MB, Screen: 1680x1050

CLI Query:  -i "F:\Variation Under Nature.tivo" -t 1 --angle 1 -c 1 -o "F:\03 Variation Under Nature.m4v"  -f mp4  -4  -w 960 --loose-anamorphic  --modulus 2 -e x264 -q 20 -r 30 --pfr -a 1,1 -E faac,copy:ac3 -6 dpl2,auto -R Auto,Auto -B 160,0 -D 0,0 --gain 0,0 --audio-fallback ffac3 --markers="C:\AppData\Local\Temp\03 Variation Under Nature-1-chapters.csv" -x qpmin=4:cabac=0:ref=2:b-pyramid=none:weightb=0:weightp=0:vbv-maxrate=9500:vbv-bufsize=9500 --verbose=1
User Query: False <== This is the AppleTV pre-set

12 CPUs detected
i5-3427U laptop using CPU only:

Code: Select all

HandBrake svn5476 (Nightly Build) - 64bit Version
OS: Microsoft Windows NT 6.2.9200.0
CPU: Intel(R) Core(TM) i5-3427U CPU @ 1.80GHz
Ram: 3914 MB, Screen: 1600x900

CLI Query:  -i "C:\Variation Under Nature.tivo" -t 1 --angle 1 -c 1 -o "C:\Variation CPU.m4v"  -f mp4  -4  -w 960 --loose-anamorphic  --modulus 2 -e x264 -q 20 -r 30 --pfr -a 1,1 -E faac,copy:ac3 -6 dpl2,auto -R Auto,Auto -B 160,0 -D 0,0 --gain 0,0 --audio-fallback ffac3 --markers="C:\AppData\Local\Temp\Variation CPU-1-chapters.csv" -x qpmin=4:cabac=0:ref=2:b-pyramid=none:weightb=0:weightp=0:vbv-maxrate=9500:vbv-bufsize=9500 --verbose=1
User Query: False <== This is the AppleTV preset

4 CPUs detected
i5-3427U laptop using QSV:

Code: Select all

HandBrake svn5476 (Nightly Build) - 64bit Version
OS: Microsoft Windows NT 6.2.9200.0
CPU: Intel(R) Core(TM) i5-3427U CPU @ 1.80GHz
Ram: 3914 MB, Screen: 1600x900

CLI Query:  -i "C:\Variation Under Nature.tivo" -t 1 --angle 1 -c 1 -o "C:\Variation QSV.m4v"  -f m4v  -4  -w 960 --loose-anamorphic  --modulus 2 -e qsv_h264 -q 20 --cfr -a 1,1 -E faac,copy:ac3 -6 dpl2,auto -R Auto,Auto -B 160,0 -D 0,0 --gain 0,0 --audio-fallback ffac3 --markers="C:\AppData\Local\Temp\Variation QSV-1-chapters.csv" -x target-usage=2:gop-ref-dist=4:gop-pic-size=32:async-depth=4 --verbose=1
User Query: False <== AppleTV preset with Video Codec switched to QSV

4 CPUs detected
Last edited by Anonymous on Tue May 21, 2013 10:21 am, edited 1 time in total.
Reason: Logs must be placed in between [code] [/code] blocks
Deleted User 11865

Re: QSV vs CPU -- Wow...

Post by Deleted User 11865 »

A few things to keep in mind:

- the AppleTV is a tricky device to target, and switching the preset to use QSV instead of x264 may cause stuttering (QSV does have CABAC enabled by default, and its "constant quality" mode does not support VBV limits)

- the QSV numbers do look pretty slow, IMO; I suspect your source was not H.264 so you ended up using software decoding & scaling (would be nice to see a complete log)
It will be very interesting to how the next generation Haswell CPUs with HD5000 Graphics will perform. The news reports claim "up to 3x" improvement in graphics performance...!
Quick Sync is not a GPGPU encoder, it uses dedicated hardware for video decoding/encoding/filtering - so QSV performance does not directly correlate with GPU performance. That's not to say there won't be improvements, however (we'll know pretty soon, Haswell is not that far away now).
jhsweeney
Posts: 11
Joined: Fri Feb 16, 2007 5:44 pm

Re: QSV vs CPU -- Wow...

Post by jhsweeney »

I thought the QSV performance was great - and it makes me want to think about changing the system I use as my primary Handbrake host! Seems like I might be building a new system this summer!

I scanned the log and see that you are correct QSV was used for encode only. The TiVo video is mpeg2 before conversion.

I'll need to watch more than a few minutes to look for stuttering issues, but they didn't jump out at me.

It would be great if the release notes or users guide could include tips for making the best use of QSV (or maybe the documentation already exists, and I just haven't looked :shock: )

Code: Select all

HandBrake svn5476 (Nightly Build) - 64bit Version
OS: Microsoft Windows NT 6.2.9200.0
CPU: Intel(R) Core(TM) i5-3427U CPU @ 1.80GHz
Ram: 3914 MB, Screen: 1600x900
Temp Dir: C:\Users\AppData\Local\Temp\
Install Dir: C:\Program Files\Handbrake
Data Dir: C:\Users\AppData\Roaming\HandBrake\HandBrake\0.0.0.5476

-------------------------------------------

CLI Query:  -i "C:\Users\Desktop\Variation Under Nature.tivo" -t 1 --angle 1 -c 1 -o "C:\Users\Desktop\Variation QSV.m4v"  -f m4v  -4  -w 960 --loose-anamorphic  --modulus 2 -e qsv_h264 -q 20 --cfr -a 1,1 -E faac,copy:ac3 -6 dpl2,auto -R Auto,Auto -B 160,0 -D 0,0 --gain 0,0 --audio-fallback ffac3 --markers="C:\Users\AppData\Local\Temp\Variation QSV-1-chapters.csv" -x target-usage=2:gop-ref-dist=4:gop-pic-size=32:async-depth=4 --verbose=1
User Query: False

[21:28:13] hb_init: starting libhb thread
HandBrake svn5476 (2013051801) - MinGW x86_64 - http://handbrake.fr
4 CPUs detected
Opening C:\Users\Desktop\Variation Under Nature.tivo...
[21:28:13] hb_scan: path=C:\Users\Desktop\Variation Under Nature.tivo, title_index=1
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening C:\Users\Desktop\Variation Under Nature.tivo/BDMV/index.bdmv
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening C:\Users\Desktop\Variation Under Nature.tivo/BDMV/BACKUP/index.bdmv
libbluray/bluray.c:1725: nav_get_title_list(C:\Users\Desktop\Variation Under Nature.tivo) failed (0000000001BF6B40)
[21:28:13] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 4.1.3
libdvdread: Encrypted DVD support unavailable.
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[21:28:13] dvd: not a dvd - trying as a stream/file instead
[21:28:13] file is MPEG Program Stream
[21:28:13] Probing 1 unknown stream
[21:28:13]     Probe: Found stream mpeg2video. stream id 0xe0-0x0
[21:28:13] Found the following streams
[21:28:13]     Video Streams : 
[21:28:13]       0xe0-0x0 type MPEG2 (0x2)
[21:28:13]     Audio Streams : 
[21:28:13]       0xbd-0x80 type AC3 (0x81)
[21:28:13]     Subtitle Streams : 
[21:28:13]     Other Streams : 
[21:28:13] stream id 0xbd (type 0x81 substream 0x80) audio 0x8000bd
[21:28:13] scan: decoding previews for title 1
[21:28:13] scan: audio 0x8000bd: AC-3, rate=48000Hz, bitrate=384000 Unknown (AC3) (5.1 ch)
Scanning title 1 of 1, preview 2, 20.00 %
Scanning title 1 of 1, preview 3, 30.00 %
Scanning title 1 of 1, preview 5, 50.00 %
Scanning title 1 of 1, preview 7, 70.00 %
Scanning title 1 of 1, preview 9, 90.00 %[21:28:14] scan: 10 previews, 1920x1080, 23.976 fps, autocrop = 4/6/0/0, aspect 16:9, PAR 1:1
[21:28:14] stream: 145 good frames, 0 errors (0%)
[21:28:14] libhb: scan thread found 1 valid title(s)
- intel quick sync video support: yes
  - hardware version: 1.4 (minimum: 1.4)
+ title 1:
  + stream: C:\Users\Desktop\Variation Under Nature.tivo
  + duration: 00:43:40
  + size: 1920x1080, pixel aspect: 1/1, display aspect: 1.78, 23.976 fps
  + autocrop: 4/6/0/0
  + chapters:
    + 1: cells 0->0, 0 blocks, duration 00:43:40
  + audio tracks:
    + 1, Unknown (AC3) (5.1 ch) (iso639-2: und), 48000Hz, 384000bps
  + subtitle tracks:
    + 1, Closed Captions (iso639-2: und) (Text)(CC)
Reading chapter markers from file C:\Users\AppData\Local\Temp\Variation QSV-1-chapters.csv
[21:28:14] 1 job(s) to process
[21:28:14] starting job
[21:28:14] sync: expecting 62829 video frames
[21:28:14] work: only 1 chapter, disabling chapter markers
[21:28:14] job configuration:
[21:28:14]  * source
[21:28:14]    + C:\Users\Desktop\Variation Under Nature.tivo
[21:28:14]    + title 1, chapter(s) 1 to 1
[21:28:14]  * destination
[21:28:14]    + C:\Users\Desktop\Variation QSV.m4v
[21:28:14]    + container: MPEG-4 (.mp4 and .m4v)
[21:28:14]      + 64-bit formatting
[21:28:14]  * video track
[21:28:14]    + decoder: mpeg2
[21:28:14]      + bitrate 38810 kbps
[21:28:14]    + frame rate: 23.976 fps -> constant 23.976 fps
[21:28:14]    + filters
[21:28:14]      + Framerate Shaper (1:27000000:1126125)
[21:28:14]        + frame rate: 23.976 fps -> constant 23.976 fps
[21:28:14]      + Crop and Scale (960:534:4:6:0:0)
[21:28:14]        + source: 1920 * 1080, crop (4/6/0/0): 1920 * 1070, scale: 960 * 534
[21:28:14]    + loose anamorphic
[21:28:14]      + storage dimensions: 960 * 534, mod 2
[21:28:14]      + pixel aspect ratio: 534 / 535
[21:28:14]      + display dimensions: 958 * 534
[21:28:14]    + encoder: H.264 (Intel QSV)
[21:28:14]      + options: target-usage=2:gop-ref-dist=4:gop-pic-size=32:async-depth=4
[21:28:14]      + quality: 20.00 (QP)
[21:28:14]  * audio track 1
[21:28:14]    + decoder: Unknown (AC3) (5.1 ch) (track 1, id 0x8000bd)
[21:28:14]      + bitrate: 384 kbps, samplerate: 48000 Hz
[21:28:14]    + mixdown: Dolby Pro Logic II
[21:28:14]    + encoder: AAC (faac)
[21:28:14]      + bitrate: 160 kbps, samplerate: 48000 Hz
[21:28:14]  * audio track 2
[21:28:14]    + decoder: Unknown (AC3) (5.1 ch) (track 1, id 0x8000bd)
[21:28:14]      + bitrate: 384 kbps, samplerate: 48000 Hz
[21:28:14]    + AC3 Passthru
[21:28:14] file is MPEG Program Stream
[21:28:14] Probing 1 unknown stream
[21:28:14]     Probe: Found stream mpeg2video. stream id 0xe0-0x0
[21:28:14] reader: first SCR 72 id 0xe0 DTS 18000
[21:28:14] mpeg2: "Chapter 1" (1) at frame 0 time 3003
[21:28:14] sync: first pts is 3003
[21:28:15] qsv: Intel QSV/MediaSDK uses hardware implementation
[21:28:15] qsv: Using for encode only.
[21:28:15] qsv: RateControlMethod:MFX_RATECONTROL_CQP(I:20/P:22/B:22) TargetKbps:22
[21:28:15] qsv: TargetUsage:2 AsyncDepth:4
[21:28:15] qsv: GopRefDist:4 GopPicSize:32 NumRefFrame:0
[21:28:15] 0.600600s: Video -> Film
[21:28:17] 4.587922s: Film -> Video
[21:28:18] 5.889222s: Video -> Film
[21:28:19] 6.756755s: Film -> Video
[21:28:19] 7.223889s: Video -> Film
[21:28:23] 13.930589s: Film -> Video
[21:28:23] 14.230889s: Video -> Film
[21:28:24] 16.599922s: Film -> Video
[21:28:24] 16.900223s: Video -> Film
[21:28:27] 21.938589s: Film -> Video
[21:28:28] 22.739389s: Video -> Film
[21:28:29] 25.108421s: Film -> Video
[21:28:30] 26.076056s: Video -> Film
[21:28:32] MP4Mux: PTS 0 < DTS 22522
[21:28:32] MP4Mux: PTS 3753 < DTS 30030
[21:28:32] MP4Mux: PTS 11261 < DTS 37537
[21:28:32] MP4Mux: PTS 30030 < DTS 41291
[21:28:32] MP4Mux: PTS 18768 < DTS 45045
[21:28:32] MP4Mux: PTS 22522 < DTS 48798
[21:28:32] MP4Mux: PTS 26276 < DTS 52552
[21:28:32] MP4Mux: PTS 45045 < DTS 56306
[21:28:32] MP4Mux: PTS 33783 < DTS 60060
[21:28:32] MP4Mux: PTS 37537 < DTS 63813
[21:28:32] MP4Mux: PTS 41291 < DTS 67567
[21:28:32] MP4Mux: PTS 60060 < DTS 71321
[21:28:32] MP4Mux: PTS 48798 < DTS 75075
[21:28:32] MP4Mux: PTS 52552 < DTS 78828
[21:28:32] MP4Mux: PTS 56306 < DTS 82582
[21:28:32] MP4Mux: PTS 75075 < DTS 86336
[21:28:32] MP4Mux: PTS 63813 < DTS 90090
[21:28:32] MP4Mux: PTS 67567 < DTS 93843
[21:28:32] MP4Mux: PTS 71321 < DTS 97597
[21:28:32] MP4Mux: PTS 90090 < DTS 101351
[21:28:32] MP4Mux: PTS 78828 < DTS 105105
[21:28:32] MP4Mux: PTS 82582 < DTS 108858
[21:28:32] MP4Mux: PTS 86336 < DTS 112612
[21:28:32] MP4Mux: PTS 105105 < DTS 116366
[21:28:32] MP4Mux: PTS 93843 < DTS 120120
[21:28:32] MP4Mux: PTS 97597 < DTS 123873
[21:28:32] MP4Mux: PTS 101351 < DTS 127627
[21:28:32] MP4Mux: PTS 116366 < DTS 131381
[21:28:32] MP4Mux: PTS 108858 < DTS 135135
[21:28:32] MP4Mux: PTS 112612 < DTS 138888
[21:28:32] MP4Mux: PTS 120120 < DTS 142642
[21:28:33] MP4Mux: PTS 135135 < DTS 146396
[21:28:33] MP4Mux: PTS 123873 < DTS 150150
[21:28:33] MP4Mux: PTS 127627 < DTS 153903
[21:28:33] MP4Mux: PTS 131381 < DTS 157657
[21:28:33] MP4Mux: PTS 150150 < DTS 161411
[21:28:33] MP4Mux: PTS 138888 < DTS 165165
[21:28:33] MP4Mux: PTS 142642 < DTS 168918
[21:28:33] MP4Mux: PTS 146396 < DTS 172672
[21:28:33] MP4Mux: PTS 165165 < DTS 176426
[21:28:33] MP4Mux: PTS 153903 < DTS 180180
[21:28:33] MP4Mux: PTS 157657 < DTS 183933
[21:28:33] MP4Mux: PTS 161411 < DTS 187687
[21:28:33] MP4Mux: PTS 180180 < DTS 191441
[21:28:33] MP4Mux: PTS 168918 < DTS 195195
[21:28:33] MP4Mux: PTS 172672 < DTS 198948
[21:28:33] MP4Mux: PTS 176426 < DTS 202702
[21:28:33] MP4Mux: PTS 195195 < DTS 206456
[21:28:33] MP4Mux: PTS 183933 < DTS 210210
[21:28:33] MP4Mux: PTS 187687 < DTS 213963
[21:28:33] MP4Mux: PTS 191441 < DTS 217717
[21:28:33] MP4Mux: PTS 210210 < DTS 221471
[21:28:33] MP4Mux: PTS 198948 < DTS 225225
[21:28:33] MP4Mux: PTS 202702 < DTS 228978
[21:28:33] MP4Mux: PTS 206456 < DTS 232732
[21:28:33] MP4Mux: PTS 225225 < DTS 236486
[21:28:33] MP4Mux: PTS 213963 < DTS 240240
[21:28:33] MP4Mux: PTS 217717 < DTS 243993
[21:28:33] MP4Mux: PTS 221471 < DTS 247747
[21:28:33] 32.949589s: Film -> Video
[21:28:33] MP4Mux: PTS 236486 < DTS 251501
[21:28:33] MP4Mux: PTS 228978 < DTS 255255
[21:28:33] MP4Mux: PTS 232732 < DTS 259008
[21:28:34] MP4Mux: PTS 240240 < DTS 262762
[21:28:34] MP4Mux: PTS 255255 < DTS 266516
[21:28:34] MP4Mux: PTS 243993 < DTS 270270
[21:28:34] MP4Mux: PTS 247747 < DTS 274023
[21:28:34] MP4Mux: PTS 251501 < DTS 277777
[21:28:34] 33.416721s: Video -> Film
[21:28:34] MP4Mux: PTS 270270 < DTS 281531
[21:28:34] MP4Mux: PTS 259008 < DTS 285285
[21:28:34] MP4Mux: PTS 262762 < DTS 289038
[21:28:34] MP4Mux: PTS 266516 < DTS 292792
[21:28:34] MP4Mux: PTS 285285 < DTS 296546
[21:28:34] MP4Mux: PTS 274023 < DTS 300300
[21:28:34] MP4Mux: PTS 277777 < DTS 304053
[21:28:34] MP4Mux: PTS 281531 < DTS 307807
[21:28:34] MP4Mux: PTS 300300 < DTS 311561
[21:28:34] MP4Mux: PTS 289038 < DTS 315315
[21:28:34] MP4Mux: PTS 292792 < DTS 319068
[21:28:34] MP4Mux: PTS 296546 < DTS 322822
[21:28:34] MP4Mux: PTS 315315 < DTS 326576
[21:28:34] MP4Mux: PTS 304053 < DTS 330330
[21:28:34] MP4Mux: PTS 307807 < DTS 334083
.
.
.
[21:37:38] MP4Mux: PTS 237526038 < DTS 237552315
[21:37:38] MP4Mux: PTS 237529792 < DTS 237556068
[21:37:38] MP4Mux: PTS 237533546 < DTS 237559822
[21:37:38] work: average encoding speed for job is 119.135529 fps
[21:37:38] sync: got 67109 frames, 62829 expected
[21:37:38] render: 63287 frames output, 3822 dropped and 0 duped for CFR/PFR
[21:37:38] render: lost time: 0 (0 frames)
[21:37:38] render: gained time: 0 (0 frames) (0 not accounted for)
[21:37:38] mpeg2 done: 67113 frames
[21:37:38] enc_qsv done: frames: 63287 in, 63287 out
[21:37:43] mux: track 0, 63287 frames, 709737551 bytes, 2150.98 kbps, fifo 2048
[21:37:43] mux: track 1, 123734 frames, 52787378 bytes, 159.98 kbps, fifo 4096
[21:37:43] mux: track 2, 82489 frames, 126703104 bytes, 384.00 kbps, fifo 4096
[21:37:43] stream: 1862174 good frames, 0 errors (0%)
[21:37:43] libhb: work result = 0
Encode done!
HandBrake has exited.
mduell
Veteran User
Posts: 8197
Joined: Sat Apr 21, 2007 8:54 pm

Re: QSV vs CPU -- Wow...

Post by mduell »

jhsweeney wrote:The QSV capability is very impressive. A dual Core CPU with HD4000 graphics was only 10% slower than a 6 Core CPU overclocked to 4.5GHz! The final video file produced by the QSV beta was about 20% bigger than the ones produced using the CPU only
Did you try watching the encode? The comparable x264 setting would be superfast or ultrafast.
jhsweeney wrote:It would be great if the release notes or users guide could include tips for making the best use of QSV (or maybe the documentation already exists, and I just haven't looked :shock: )
It's not even in beta yet; really just for advanced users capable of their own research.
Post Reply