Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: VA-API encoding

  1. #1
    Join Date
    Jan 2009
    Location
    England
    Posts
    126

    Question 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 at 11:49 AM.

  2. #2
    Join Date
    Jan 2009
    Location
    England
    Posts
    126

    Default can't run transmageddon 1.3 under Trusty

    It seems versions 1.2 and 1.3 of Transmageddon introduced various fixes for VAAPI so it looks like I really need to be running 1.3 if I want VAAPI to work.

    I installed gstreamer1.0, gstreamer1.0-vaapi plus all the build deps listed in transmageddon INSTALL and README files but I can't get 1.3 to run under 14.04 - 0.25 ran just fine, albeit without VAAPI accel.

    I tried installing the package from here:

    https://launchpad.net/~whoopie79/+ar...+build/6191602

    With no luck and when I build it from source I get this error when I run it:

    Code:
    Traceback (most recent call last):
      File "transmageddon.py", line 141, in do_activate
        self.win = TransmageddonUI(self, source=self.source)
      File "transmageddon.py", line 320, in __init__
        self.setup_source()
      File "transmageddon.py", line 1337, in setup_source
        fileopen=theme.load_icon(Gtk.STOCK_OPEN, size, 0)
    gi._glib.GError: Icon 'gtk-open' not present in theme
    It seems Transmageddon 1.3 is already in Utopic but I'd rather not upgrade to 14.10 just yet.

  3. #3
    Join Date
    Jan 2009
    Location
    England
    Posts
    126

    Default libavcodec - vaapi decode only

    I've just been asking about vaapi support in the libav IRC channel. Apparently avconv has no support for vaapi yet. libavcodec, however, has support for vaapi decoding but no encoding yet.

    So, it seems gstreamer / transmageddon are the only currently available options for vaapi encoding and that KDEnlive must currently only support vaapi decoding.

    Has anyone got a working gstreamer command that uses vaapi to encode h264?

  4. #4
    Join Date
    Jan 2009
    Location
    England
    Posts
    126

    Default example VAAPI GST command

    I've not had any response from the Transmageddon dev yet re running 1.3 under Trusty but I have found an example gstreamer VAAPI command which I'll try tonight. The problem is that it is for GST 0.10 so it may not work under GST 1.0.


    Code:
    gst-launch-0.10 videotestsrc num-buffers=200 ! video/x-raw-yuv,format='(fourcc)'NV12,width=1280,height=720,framerate=30/1 ! vaapiconvert ! vah264encode ! qtmux faststart=true ! filesink location=h264.mp4
    https://gitorious.org/vaapi/gstreame...rge_requests/5

  5. #5
    Join Date
    Apr 2007
    Location
    Arctic circle, Finland
    Posts
    299

    Default

    I don't have clue about va-api encoding, but Transmageddon looks a bit like handbrake, which should support intel quicksync for video encoding(should be in universe repo):
    http://handbrake.fr/

  6. #6
    Join Date
    Jan 2009
    Location
    England
    Posts
    126

    Default Intel GST 1.0 encoding examples

    I've found some more contemporary (GST-1.0) examples here:

    http://www.intel.co.uk/content/dam/w...amer-paper.pdf

    Code:
    gst-launch-1.0 filesrc blocksize=10000000 location=infile.yuv ! videoparse format=i420 height=1080 width=1920 framerate=30/1 ! vaapipostproc ! queue ! vaapiencode_h264 ! qtmux ! filesink location=test2.mp4
    tuke81:

    I don't see gsteamer1.0-vaapi listed as a (recommended) dep. for Handbrake (in Trusty or sid) so its prob safe to presume it doesn't support it yet.

  7. #7
    Join Date
    Feb 2011
    Location
    Ukraine
    Posts
    142

    Default

    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

  8. #8
    Join Date
    Jan 2009
    Location
    England
    Posts
    126

    Default 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?

  9. #9
    Join Date
    Jan 2009
    Location
    England
    Posts
    126

    Default

    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?

  10. #10
    Join Date
    Feb 2011
    Location
    Ukraine
    Posts
    142

    Default

    Quote 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •