How to use Hardware Acceleration

Discussion in 'Linux Ubuntu' started by mr3p, Mar 20, 2015.

  1. mr3p

    mr3p New Member

    Joined:
    Mar 20, 2015
    Messages:
    2
    Likes Received:
    0
    Hi all,
    i'm trying to play HD mp4 files.
    I've no problem at all with Rpi using omxplayer, but it's limited on other things :p

    So i decided to give a chance to UDOO.
    I've a UDOO dual.
    I'm using the latest Ubuntu image.

    Which player is compiled / optimized for hw acceleration?
    Is there a guide on hw accel?
    Pls don't suggest to use xbmc/openelec ;)

    M
     
  2. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Hi there mr3p,
    there is the official media player in UDOObuntu (Totem), give it a try! It supports HW acceleration.
    Andrea
     
  3. mr3p

    mr3p New Member

    Joined:
    Mar 20, 2015
    Messages:
    2
    Likes Received:
    0
    Hi,
    sure about hw accel support?

    I tried both Mplayer and Totem.
    No way to play a video file - mpeg4 codec (hd 1080p 24fps).
    Totem crash and Mplayer show a black screen.
    If launched by cli, mplayer shows this warning: "Your system is too SLOW to play this!"

    M
     
  4. fetcher

    fetcher Member

    Joined:
    Mar 9, 2014
    Messages:
    166
    Likes Received:
    20
    Freescale provides GPU-accelerated video support only for Gstreamer, unfortunately. So, if you use mplayer, normally my player of choice also, it has to do everything in software, including even YUV->RGB conversion and image scaling-- there's no direct equivalent to the 'xvideo' / 'xv' overlay common on PCs. The pure software method is inefficient, and beyond the capabilities of an i.MX6 CPU at HD resolution... hence that "too SLOW" warning. You should have gotten some sort of display out of it, though, however jerky.

    totem is a front-end to gstreamer, so that one should work if you can get past the crash issue. I don't want to pull in all the heavyweight GNOME dependencies, so haven't tried it myself.

    I did have some success playing HD video by invoking gstreamer directly, though, and having it render directly to the framebuffer:

    Code:
    gst-launch-0.10 playbin2 uri=file:/path/to/your/video.mp4  video-sink='mfw_isink'
    
    If there's no output, running "export VSALPHA=1" first may be necessary. With this low-level invokation you have no user interface or interactivity, so it isn't possible to seek through the video, only halt playback with ctrl-C (pausing via ctrl-Z, then 'fg' to resume might work). Beware also that the direct-to-framebuffer output doesn't respect either virtual consoles or X11 virtual desktops, taking over the whole screen unconditionally (well, you can render to windowed area with, e.g. video-sink='mfw_isink disp-width=720 disp-height=405 axis-left=300 axis-top=200'). As with omxplayer on the Pi, you can run this from a plain text console. It doesn't depend on X11.

    Beware that any abnormal gstreamer exit may leave the video overlay surface "stuck" in your framebuffer, with no easy way to get rid of it short of a reboot (if anyone knows a way to reset & clear all IPU surfaces and release their associated memory, please share!)

    Also, with mfw-isink output, parts of a video surface showing pure, saturated blue can let the underlying X desktop or console show through, apparently due to some inverse chroma-key mechanism. It should be possible to change how the keying overlay works, but I haven't yet found out how.

    The other gstreamer screen output method ("video-sink"), which I think most player apps use by default, is 'mfw-v4lsink'. I couldn't get this one to work.

    There is a simple gstreamer frontend 'gst123', installable from Debian APT respositories, meant mainly for music but also usable as a simple video player, with mplayer-like controls. So far this one gives me good audio playback from most videos, but no picture. The same is true for 'gplay', bundled with Debian and probably Ubuntu also (part of gst-fsl-plugins-3.5.7) 'parole', a GUI-based gstreamer also gives good sound, but only a bluescreen or blue window visual. I think all these are trying to use the 'v4lsink' overlay but somehow failing.
     

Share This Page