Quantcast
Channel: Intel® Software - Media
Viewing all articles
Browse latest Browse all 697

H264 Decoding performance on Linux.

$
0
0

I'm porting a windows transcoder to Linux, and running into an issue on the speed of decoding a 1080p H.264 video frame - the encoding works as expected.  Comparing the same feed from a low end Pentium Linux (N4200 - 1.1 GHz) to my Windows developer machine (i5-6500 - 3.2 GHz), the encode takes about 2x longer (as expected), but the decode takes 20x longer. (1+ milliseconds compared to over 26 milliseconds).  I'm wondering if there is something obvious I am doing wrong, or if this CPU isn't fully supported, or what ?

I'm running Ubuntu 19.10 server.

CPU: Intel(R) Pentium(R) CPU N4200 @ 1.10GHz

Installed the mfx packages: sudo apt-get -y install libmfx1 libmfx-tools libva-drm2 vainfo intel-media-va-driver-non-free
export LIBVA_DRIVER_NAME=iHD
Running: I see

libva info: VA-API version 1.5.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_5
libva info: va_openDriver() returns 0
awk: fatal: cannot open file `/etc/network/interfaces' for reading (No such file or directory)
 

As to my code: I'm opening up the VA display (_vaDisplay is shared between my encode/decode sessions)

    int _card = open("/dev/dri/card0", O_RDWR); /* primary card */
    VADisplay _vaDisplay = vaGetDisplayDRM(_card);
    VAStatus vaStatus = vaInitialize(_vaDisplay, &majorVersion, &minorVersion);
 

Opening up my session:

    mfxVersion min_version = { 3, 1 };  // min version 1.3 to support Low Latency.
    mfxStatus initStatus = MFXInit(MFX_IMPL_HARDWARE_ANY, &min_version, &session);
    initStatus = MFXVideoCORE_SetHandle(session, MFX_HANDLE_VA_DISPLAY, (mfxHDL)_vaDisplay);  // added for Linux

And the basic decode which I timed (obviously I do the DecodeHeader before, and necessary surface creation)

        sts = MFXVideoDECODE_DecodeFrameAsync(_session, &bitstream, inputFrame, &surface, &syncPoint);
        sts = MFXVideoCORE_SyncOperation(_session, syncPoint, MSDK_DEC_WAIT_INTERVAL);


Viewing all articles
Browse latest Browse all 697

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>