Encoding VP9 Videos with Intel Quick Sync?

Sonic Angel Knight

Well-Known Member
OP
Member
Joined
May 27, 2016
Messages
14,404
Trophies
1
Location
New York
XP
12,959
Country
United States
Lately, I been messing around with ffmpeg. If you don't know what it is, you can use it to encode or decode video and audio files of many formats. It basic use is through command line (Which I'm not the best at without a cheat sheet to help remember) Anyway, I messed around with encoding videos to the webm format which is technically VP9 that youtube uses. It takes patience to do but the result is a small file with no visual blemishes that I can see. :)

Recently I found out that on some intel hardware pc, you can use hardware acceleration to encode videos that makes it a lot faster. So it doesn't take over 30 minutes to encode a 10 minute video at 3.2 fps. According to what I learned my pc uses a supported intel chip that supports encoding VP9 format. But I don't know how to do it, and it has been bugging me for awhile now. I can do H264 encoding with the so called "Intel quick sync" but not vp9. :(

I was wondering if any of you has managed to encode vp9 with intel quick sync hardware acceleration feature. I made sure to check if my system can do it and it does. I just don't know how. The intel chip I have is called "Kaby Lake" and says "encode 8-bit vp9" :blink:

Code:
Encoder vp9_qsv [VP9 video (Intel Quick Sync Video acceleration)]:
    General capabilities: delay hybrid
    Threading capabilities: none
    Supported hardware devices: qsv qsv qsv
    Supported pixel formats: nv12 p010le qsv
vp9_qsv encoder AVOptions:
  -async_depth       <int>        E..V...... Maximum processing parallelism (from 1 to INT_MAX) (default 4)
  -avbr_accuracy     <int>        E..V...... Accuracy of the AVBR ratecontrol (from 0 to INT_MAX) (default 0)
  -avbr_convergence  <int>        E..V...... Convergence of the AVBR ratecontrol (from 0 to INT_MAX) (default 0)
  -preset            <int>        E..V...... (from 1 to 7) (default medium)
     veryfast        7            E..V......
     faster          6            E..V......
     fast            5            E..V......
     medium          4            E..V......
     slow            3            E..V......
     slower          2            E..V......
     veryslow        1            E..V......
  -rdo               <int>        E..V...... Enable rate distortion optimization (from -1 to 1) (default -1)
  -max_frame_size    <int>        E..V...... Maximum encoded frame size in bytes (from -1 to 65535) (default -1)
  -max_slice_size    <int>        E..V...... Maximum encoded slice size in bytes (from -1 to 65535) (default -1)
  -bitrate_limit     <int>        E..V...... Toggle bitrate limitations (from -1 to 1) (default -1)
  -mbbrc             <int>        E..V...... MB level bitrate control (from -1 to 1) (default -1)
  -extbrc            <int>        E..V...... Extended bitrate control (from -1 to 1) (default -1)
  -adaptive_i        <int>        E..V...... Adaptive I-frame placement (from -1 to 1) (default -1)
  -adaptive_b        <int>        E..V...... Adaptive B-frame placement (from -1 to 1) (default -1)
  -b_strategy        <int>        E..V...... Strategy to choose between I/P/B-frames (from -1 to 1) (default -1)
  -forced_idr        <boolean>    E..V...... Forcing I frames as IDR frames (default false)
  -low_power         <boolean>    E..V...... enable low power mode(experimental: many limitations by mfx version, BRC modes, etc.) (default false)
  -profile           <int>        E..V...... (from 0 to INT_MAX) (default unknown)
     unknown         0            E..V......
     profile0        1            E..V......
     profile1        2            E..V......
     profile2        3            E..V......
     profile3        4            E..V......
 

Tom Bombadildo

Dick, With Balls
Member
Joined
Jul 11, 2009
Messages
14,578
Trophies
2
Age
29
Location
I forgot
Website
POCKET.LIKEITS
XP
19,236
Country
United States
Out of curiosity, if you find FFMPEG a little difficult to use with commandline, why not use a GUI for it?

https://axiomui.github.io/ < ie Axiom, I use it whenever I can't be bothered to install Handbrake, will let you set any option you can use via commandline with nice helpful buttons instead, including whether to use Intel Quick Sync for hardware acceleration
 
  • Like
Reactions: Sonic Angel Knight

Wuigi

Well-Known Member
Member
Joined
Sep 14, 2012
Messages
728
Trophies
1
XP
1,788
Country
United States
I use hevc via libx265 for encoding and h264_qsv as decoder to get the best quality at the smallest size for 900p60 footage which was too much for my 8700k's QSV encoder, but it also takes more time via software.
When I tried to encode vp9 some time ago, it required me to change the extension of the output file to .webm to use the correct container.
Did you try that already?
According to wikipedia profile 1 with 4:2:0, 4:2:2 or 4:4:4 or profile 0 with 4:2:0 are 8-bit encodings, so maybe additionally try -pix_fmt yuv420p to enforce it.
 
Last edited by Wuigi,

Sonic Angel Knight

Well-Known Member
OP
Member
Joined
May 27, 2016
Messages
14,404
Trophies
1
Location
New York
XP
12,959
Country
United States
I use hevc via libx265 for encoding and h264_qsv as decoder to get the best quality at the smallest size for 900p60 footage which was too much for my 8700k's QSV encoder, but it also takes more time via software.
When I tried to encode vp9 some time ago, it required me to change the extension of the output file to .webm to use the correct container.
Did you try that already?
According to wikipedia profile 1 with 4:2:0, 4:2:2 or 4:4:4 or profile 0 with 4:2:0 are 8-bit encodings, so maybe additionally try -pix_fmt yuv420p to enforce it.
The command I use is
Code:
ffmpeg -i input.avi -c:v vp9_qsv output.webm

Then the log says
Code:
[vp9_qsv @ 000001cf9aa40d00] Selected ratecontrol mode is unsupported
[vp9_qsv @ 000001cf9aa40d00] Low power mode is unsupported
[vp9_qsv @ 000001cf9aa40d00] Current frame rate is unsupported
[vp9_qsv @ 000001cf9aa40d00] Current picture structure is unsupported
[vp9_qsv @ 000001cf9aa40d00] Current resolution is unsupported
[vp9_qsv @ 000001cf9aa40d00] Current pixel format is unsupported
[vp9_qsv @ 000001cf9aa40d00] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters.
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!

Of course if i change the encoder to H264_qsv instead of vp9_qsv and mp4 instead of webm, the video encodes

Code:
Output #0, mp4, to 'output.mp4':
  Metadata:
    encoder         : Lavf58.61.100
    Stream #0:0: Video: h264 (h264_qsv) (avc1 / 0x31637661), nv12(progressive), 256x224, q=-1--1, 1000 kb/s, 60 fps, 15360 tbn, 60 tbc
    Metadata:
      encoder         : Lavc58.109.100 h264_qsv
    Side data:
      cpb: bitrate max/min/avg: 0/0/1000000 buffer size: 0 vbv_delay: N/A
    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.109.100 aac
frame=  319 fps=0.0 q=12.0 Lsize=     523kB time=00:00:05.33 bitrate= 802.9kbits/s speed=   7x
video:423kB audio:90kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.950069%
[aac @ 00000238d8673b80] Qavg: 735.079
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,348
Country
United Kingdom
Do check the quality of the hardware accelerated encodings if you do end up finding a means (or another codec that supports if ffmpeg did not include the option yet) hardware acceleration.

I can't say I have particularly messed with VP9 (I live in a part of the world where software patents are not a thing so don't have to worry about using the weird and wonderful codecs unless they are going to do something for me), much less various hardware encoding options for it, but going back to when hardware acceleration for encoding first started to come on the scene they often sacrificed quality for speed (same bitrates and settings) and it has seemingly remained that way ever since -- I don't know of any serious video encoder that will do hardware acceleration for anything other than a rough cut. This is not just for posterity I should type things but actual side by side you can notice and if you know what to look for then truly horrific.
 
  • Like
Reactions: Sonic Angel Knight

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • K3Nv2 @ K3Nv2:
    Thought it was some warzone dlc bs
  • Psionic Roshambo @ Psionic Roshambo:
    Looks like an enhanced Far cry 1
  • K3Nv2 @ K3Nv2:
    That's a far cry from it
  • BigOnYa @ BigOnYa:
    Is it a free to play bs, pay to get any good weapon/gear
  • K3Nv2 @ K3Nv2:
    Not free to play but $35
  • K3Nv2 @ K3Nv2:
    Inb4 kiiwii gives it a 0/10
  • BigOnYa @ BigOnYa:
    6/10 rating on steam
  • Psionic Roshambo @ Psionic Roshambo:
    I would like a Predator game "Kill Team" it takes place in the Jungle of the first movie, your team is sent to hunt the predator, using current tech drones and a trained team. Set traps use strategy to hunt and trap or kill the predator.
  • BigOnYa @ BigOnYa:
    Ill stick with my Battlefield. Yea a predator hunting game like that would be cool. Esp if you can be Arnold and say "Get to da choppa"
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Maybe Arnold could do a cameo voice acting, he is the one briefing you on the mission
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Honestly surprised they didn't make a tie in game for Predators that movie was awesome
  • Psionic Roshambo @ Psionic Roshambo:
    I was kinda sad the Yakuza guy died sword fighting a predator lol
  • Psionic Roshambo @ Psionic Roshambo:
    The Russian guy went out like a boss
  • Psionic Roshambo @ Psionic Roshambo:
    Double claymores to the face definitely kill a predator lol
  • BigOnYa @ BigOnYa:
    I went today and looked at a motorcycle someone was selling. I get there and the battery on it was dead, so the guy grabbed a battery charger and hooked it up. He plugged it into the wall, and the motorcycle sparked and started smoking. Come to find out the bike uses a 6 volt battery and the guy had the charger set to 12v. I said sorry to the dude and walked away. I felt bad for him tho.
  • Psionic Roshambo @ Psionic Roshambo:
    Sounds like it would be an exciting ride....
  • Psionic Roshambo @ Psionic Roshambo:
    Not sure I would want something on fire between my legs
  • BigOnYa @ BigOnYa:
    He ruined it basically. Sad cause it was a decent old bike. It would take more money to rewire the bike than it was worth tho.
  • Psionic Roshambo @ Psionic Roshambo:
    Yeah I'm sure at minimum the starter was fried
  • Psionic Roshambo @ Psionic Roshambo:
    Alternator and battery
  • BigOnYa @ BigOnYa:
    Prob alot of fried parts. It was still smoking when I left.
  • K3Nv2 @ K3Nv2:
    I would've said show me how it rides
  • Psionic Roshambo @ Psionic Roshambo:
    I always wanted one of those Smart Cars with a Hyabusa motor in it.
    Psionic Roshambo @ Psionic Roshambo: I always wanted one of those Smart Cars with a Hyabusa motor in it.