Announcement

Collapse
No announcement yet.

VA-API encoding

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • danboid
    started a topic VA-API encoding

    VA-API encoding

    I recently updated my laptop (Haswell i7 w/ i4600) to 14.04 and I was happy to get VA-API decoding working for 1080 h264. When playing back such files, CPU usage has reduced from ~10% (or 37% under 12.04!) to ~1%.

    The logical next step is to hopefully get VA-API accelerated h/x264 encoding working. A bit of searching says I should be able to use libav and/or Transmageddon (in combo with libgstreamer-vaapi) to achieve VA-API accelerated x264 encoding. Are those the only options? Is there any difference in the (perceived) picture quality or encoding speed between them?

    The Transmageddon in the 14.04 repos is rather out-of-date so I suspect I'd need to update to a newer version to get VA-API working? Would I also need to create a custom profile to enable VA-API?

    Has anyone got a working libav command to encode x264 w/ VA-API?

    What support do KDEnlive and Lightworks offer for VA-API?

    How does VA-API encoding compare to Quick Sync these days? Last I heard it was running at a fraction (less than 1/5th) of the speed.

    Finally, what is the max res. / bitrate of h264 I could encode in hardware with my i4600 GPU?

    Thank you, Intel encoding overlords!
    Last edited by danboid; 08-08-2014, 11:49 AM.

  • Dexterp91
    replied
    Mistake in my first post

    I don't think I have ever had HW acceleration working in Ubuntu, I just mistook the option h26n ITU as it. It was stupidly quick but gave nothing great for quality. I can't find much to explain what that option what/is either.

    Thank you for the reply. I'll try in Manjaro (I'm scared of pure Arch as they don't seem to care about posting system breaking updates)

    Leave a comment:


  • danboid
    replied
    vague update

    Hi Dexterp91

    I've been meaning to update this thread for months, just never got round to it. I did get HW encoding working under Transmageddon in the end but under Arch instead of Ubuntu. I just had to install the Intel GPU driver from AUR then Transmageddon VAAPI encoding (using the version in the official Arch repos) 'just worked'. I've not used it in a while but IIRC it was something like 4/5x faster than encoding in software so I was quite happy with that.

    I've never tried Quicksync but I've heard its both faster and better quality than VAAPI. Unfortnately I expect there is little you can do to improve the encoding quality other than wait for the Intel devs to improve VAAPI encoding. However, if there is anyone outside Intel who does know how to improve the situation there is a very good chance they read these forums so you asked in the right place.

    Leave a comment:


  • Dexterp91
    replied
    Hi there, I'm a newbie 'nix user that is very keen to abandon Windows, the one issue being Intel Quicksync support. I encode a lot for a website I run so having the speed and quality offered by my Haswell is a god send. The issue is, I really don't want to be tied to Windows.

    I have tried various settings and installs with regards to Transmaggedon. One thing that I quickly learnt was not to mess with Gstreamer, because as soon as I do I break all format support and hardware decoding as a result. This has resulted in numerous re-installs.

    I have managed to get Transmaggedon to use the hardware, but with incredibly poor quality; nothing like what has been shown off in this thread. Can anyone help out a Linux Newbie using Ubuntu 14.04 on an Intel? Pentium(R) CPU G3258 @ 3.20GHz ? 2 I am willingly to donate to anyone who can spend the time explaining this to me. Thank you!

    Leave a comment:


  • Pontostroy
    replied
    Originally posted by danboid View Post
    Just because Transmageddon / gstreamer has loaded your va-api driver doesn't mean its being used and in your case it won't be getting used because you have transcoded to ogg.

    To encode in a format that should use vaapi, choose AVI for the output format then it should choose h264 as the default codec.

    However, there is no point in trying unless you have the required gstreamer encoding plugins. What distro are you running and what output do you get when you run:

    Code:
    gst-inspect-1.0 | grep vaapi
    Also, make sure you are running at least Transmageddon 1.3. It seems your previous test used 1.2 and 1.3 fixed a bug that disabled vaapi.
    I use matroska + h264 and vaapi and omx works fine.
    How do you explain the difference in time and CPU load on screenshots?
    Special video for you, look carefully at what happens after 0.49s-0.50s


    Any questions?

    Leave a comment:


  • danboid
    replied
    Just because Transmageddon / gstreamer has loaded your va-api driver doesn't mean its being used and in your case it won't be getting used because you have transcoded to ogg.

    To encode in a format that should use vaapi, choose AVI for the output format then it should choose h264 as the default codec.

    However, there is no point in trying unless you have the required gstreamer encoding plugins. What distro are you running and what output do you get when you run:

    Code:
    gst-inspect-1.0 | grep vaapi
    Also, make sure you are running at least Transmageddon 1.3. It seems your previous test used 1.2 and 1.3 fixed a bug that disabled vaapi.
    Last edited by danboid; 08-12-2014, 03:24 AM.

    Leave a comment:


  • Pontostroy
    replied
    Originally posted by danboid View Post
    pontostroy:

    Your Transmageddon vaapi screenshot shows you transcoding into an Ogg Theora .mkv file and vaapi doesn't accelerate encoding Theora -that's why you can see 90+% of your CPU being used. vaapi can only encode H264 and MPEG2 in hardware.


    mean?
    1 It shows settings to transcoding into an Ogg Theora .ogg file
    2 This is default setting and after transcoding Transmageddon always changed all settings to ogg
    3 See konsole output, and look at words vaapi\omx

    Leave a comment:


  • danboid
    replied
    pontostroy:

    Your Transmageddon vaapi screenshot shows you transcoding into an Ogg Theora .mkv file and vaapi doesn't accelerate encoding Theora -that's why you can see 90+% of your CPU being used. vaapi can only encode H264 and MPEG2 in hardware.

    Also, what does

    Transmageddon 3.0 ? 1.2

    mean?

    Leave a comment:


  • danboid
    replied
    No suitable encoding plugins in Ubuntu repos

    Code:
    $ gst-launch-1.0 filesrc blocksize=10000000 location=bts.mp4 ! videoparse format=i420 height=1080 width=1920 framerate=30/1 ! vaapipostproc ! queue ! vaapiencode_h264 ! qtmux ! filesink location=test2.mp4
    libva info: VA-API version 0.35.0
    libva info: va_getDriverName() returns 0
    libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
    libva info: Found init function __vaDriverInit_0_35
    libva info: va_openDriver() returns 0
    WARNING: erroneous pipeline: no element "vaapiencode_h264"
    Code:
    $ gst-inspect-1.0 | grep vaapi
    vaapi:  vaapisink: VA-API sink
    vaapi:  vaapipostproc: VA-API video postprocessing
    vaapi:  vaapidecode: VA-API decoder
    Looks like I might need to build gst myself if I want vaapi encoding plugins?

    Leave a comment:


  • Pontostroy
    replied
    My tests
    Transmageddon benchmark (omx, vaapi, x264enc, mpeg4)
    http://www.gearsongallium.com/?p=1372

    Almost all videos from my youtube channel recorded with gsteamer vaapi\omx hardware encoding
    https://www.youtube.com/playlist?lis...vUQ1kZPUsVZAiE

    I made simple script and maintained some patches ( optimization of RGB > YUV conversion)
    https://github.com/pontostroy/gstreamer-screenrecording

    Leave a comment:

Working...
X