Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.
3056 Discussions

Media SDK Sample Encode is not working on Intel NUC(D54250WYKH) machine.

sumit_j_1
Beginner
1,015 Views

HI All,

I am beginner in Intel media SDK. I am trying to run sample examples given in this

http://software.intel.com/sites/default/files/mediasdk-tutorials-0.0.3.tar.gz

On my set up i am able to run simple_session example which has printed output like this-

"

libva info: VA-API version 0.35.0

libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/local/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_35
libva info: va_openDriver() returns 0

Implementation: HARDWARE                 API Version: 1.15

"

When i ran Decode then also it worked.

But with Encode I am getting this error-

"

libva info: VA-API version 0.35.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/local/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_35
libva info: va_openDriver() returns 0
Cannot get function of m_fvaCmExtSendReqMsg!

 Device operation failure. src/simple_encode.cpp 172

"

On debugging i found that-

sts = mfxENC.Init(&mfxEncParams);
MSDK_IGNORE_MFX_STS(sts, MFX_WRN_PARTIAL_ACCELERATION);

MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);

this sts value= MFX_ERR_DEVICE_FAILED.

Plz suggest how to proceed further. Let me know if more information is required.

 

 

 

 

 

 

0 Kudos
20 Replies
Shaojuan_Z_Intel
Employee
971 Views

Hi Sumit,

What version of Media Server Studio (MSS) did you installed? The latest API version is 1.16. And which OS is your system in? Does your system have the latest driver? After installation, did you verify the correctness of installation by following the steps in Getting Started Guide? Also, do you see the same issue when running Samples here? Thanks.

0 Kudos
sumit_j_1
Beginner
971 Views

Hi,

Mss version- MediaServerStudioEssentials2015R5

Api version  1.15

Driver..updated

Kernel..3.14 as per user guide.

I followed the procedures given in user guide which u have pointed to me to check installation. I am using generic version of procedures.

My os is.Linux(Ubuntu).

Decode example (sample_2_decode)is working on my set up. I am facing issue with encode example.

Thanks

Sumit 

0 Kudos
Jiandong_Z_Intel
Employee
971 Views

Hi Sumit,

From your output -

"libva info: Trying to open /usr/local/lib/dri/i965_drv_video.so"

Maybe your user mode driver(UMD) is not install correct.

The correct one should -

libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so

Following topic can help you to install MSS on Ubuntu -

https://software.intel.com/en-us/forums/topic/562610

https://software.intel.com/en-us/forums/topic/543365

 

Thanks,

Zachary

0 Kudos
sumit_j_1
Beginner
971 Views

 

Hi Zachary,

I am trying to build examples given  here R5-linux.

I have added  new ENV variables  paths-

LD_LIBRARY_PATH="/usr/local/lib;/usr/lib64"

LIBVA_DRIVER_NAME=iHD 

LIBVA_DRIVERS_PATH=/opt/intel/mediasdk/lib64

So now my outputs are like this when i am trying to run sample_encode_drm 

command- ./sample_encode_drm  h264 -i input.yuv -o /tmp/EncodeVid.264  -w 720 -h 576 -hw

outputs-

libva info: VA-API version 0.35.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_0_32
libva info: va_openDriver() returns 0
Encoding Sample Version 0.0.000.0000

Input file format       YUV420
Output video            AVC
Source picture:
        Resolution      720x576
        Crop X,Y,W,H    0,0,720,576
Destination picture:
        Resolution      720x576
        Crop X,Y,W,H    0,0,720,576
Frame rate      30.00
Bit rate(Kbps)  3000
Target usage    balanced
Memory type     system
Media SDK impl          hw
Media SDK version       1.15

Processing started

It got hanged there. On debugging  I found from here it starts hanging-(pipeline_encoder.cpp)

nEncSurfIdx = GetFreeSurface(m_pEncSurfaces, m_EncResponse.NumFrameActual);

Also , I tried to run as usual without adding above ENV variables paths.

my outputs is like this-

libva info: VA-API version 0.35.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/local/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_35
libva info: va_openDriver() returns 0
Cannot get function of m_fvaCmExtSendReqMsg!
 I am in Encode.c....profile-ntel_enc_hw_context_init
 I am in Encode.c....profile-
Encoding Sample Version 0.0.000.0000

Input file format       YUV420
Output video            AVC
Source picture:
        Resolution      720x576
        Crop X,Y,W,H    0,0,720,576
Destination picture:
        Resolution      720x576
        Crop X,Y,W,H    0,0,720,576
Frame rate      30.00
Bit rate(Kbps)  3000
Target usage    balanced
Memory type     system
Media SDK impl          hw
Media SDK version       1.15

Processing started

Return on error: error code -12,        /MediaSDK2015R5/MediaSamples_Linux_6.0.16043138.138/samples/sample_encode/src/pipeline_encode.cpp   1176


Return on error: error code -12,        /MediaSDK2015R5/MediaSamples_Linux_6.0.16043138.138/samples/sample_encode/src/pipeline_encode.cpp   1338


Return on error: error code 1,  /MediaSDK2015R5/MediaSamples_Linux_6.0.16043138.138/samples/sample_encode/src/sample_encode.cpp     646

Here on debugging, I found that after running 5-6 times while loops error comes from GetFreeTask.

sts = GetFreeTask(&pCurrentTask);    -pipeline_encode.cpp   1219
MSDK_BREAK_ON_ERROR(sts)

mfxStatus CEncodingPipeline::GetFreeTask(sTask **ppTask)
{
     mfxStatus sts = MFX_ERR_NONE;

     sts = m_TaskPool.GetFreeTask(ppTask); 
     if (MFX_ERR_NOT_FOUND == sts)
    {
         sts = SynchronizeFirstTask();
        MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);

       // try again
        sts = m_TaskPool.GetFreeTask(ppTask);
    }
    return sts;
 }

return sts is-MFX_ERR_ABORTED by   sts = m_TaskPool.GetFreeTask(ppTask);

 

Plz suggest solution.

Thanks 

Sumit Jha

 

 

0 Kudos
Jiandong_Z_Intel
Employee
971 Views

Hi Sumit,

Where did you got i965_drv_video.so ?

It looks you Kernel Mode Driver also not install correct.

Have you following  Getting Started Guide setup KMD ?

using following command line check your kernel version

$ uname -r

3.14.5
 

Thanks

Zachary

0 Kudos
sumit_j_1
Beginner
971 Views

HI Zachary,

Actually i build  that library-i965_drv_video.so  using--libva-intel-driver-1.3.2 from here.(01.org).

I have followed that Kernel Mode install Instructions-

$ wget 
https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.5.tar.xz ;

$ tar -xJf linux-3.14.5.tar.xz

$ cp 
/opt/intel/mediasdk/opensource/patches/kmd/3.14.5/intel-kernel-patche
s.tar.bz2 .
$ tar -xvjf intel-kernel-patches.tar.bz2
$ cd linux-3.14.5
$ for i in ../intel-kernel-patches/*.patch; do patch -p1 < $i; done

$ make olddefconfig
$ make -j 8
$ make modules_install
$ make install

          Reboot.

Then i tried-

lsmod | grep 'i915'

  i915                  829967  3
drm_kms_helper         55228  1 i915
video                  19443  1 i915
drm                   300741  3 i915,drm_kms_helper
i2c_algo_bit           13413  1 i915

 

And --->> umane -r gave me-----3.15.2-nuc

Why not it is taking -3.14.5 ?

Regards,

Sumit

 

 

 

 

 

0 Kudos
Jiandong_Z_Intel
Employee
971 Views

Hi Sumit,

You should not use i965_drv_video.so  if you want use Media Server Studio. MSS use  /opt/intel/mediasdk/lib64/iHD_drv_video.so, and keep this in mind.

KMD build steps are correct.

Have you select 3.14.5 menu entry in Grub menu when you boot up after run "make install" ?

can you send following command line ?

$  ls -l /boot/*3.14.5*
 

Thanks

Zachary

 

0 Kudos
sumit_j_1
Beginner
971 Views

Hi,

The command- $ls -l /boot/*3.14.5* - outputs-

-rw-r--r-- 1 root root    166421 Sep 14 11:32 /boot/config-3.14.5
-rw-r--r-- 1 root root 162332345 Sep 14 11:33 /boot/initrd.img-3.14.5
-rw-r--r-- 1 root root   3396687 Sep 14 11:32 /boot/System.map-3.14.5
-rw-r--r-- 1 root root   5842512 Sep 14 11:32 /boot/vmlinuz-3.14.5

Regards,

Sumit Jha

 

0 Kudos
Jiandong_Z_Intel
Employee
971 Views

Hi ,

Your kernel 3.14.5 have been installed successfully.

Can you select 3.14.5 menu entry in grub menu during boot up ?

Following command line can help to check grub menu. Can you send output ?

$ grep menuentry /boot/grub/grub.cfg

Thanks

Zachary

0 Kudos
sumit_j_1
Beginner
971 Views

HI,

the command - $ grep menuentry /boot/grub/grub.cfg output is-

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
  menuentry_id_option=""
export menuentry_id_option
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-6c64822c-fc4c-4d48-89af-dbf20410290a' {
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-6c64822c-fc4c-4d48-89af-dbf20410290a' {
        menuentry 'Ubuntu, with Linux 3.15.2-nuc' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.15.2-nuc-advanced-6c64822c-fc4c-4d48-89af-dbf20410290a' {
        menuentry 'Ubuntu, with Linux 3.15.2-nuc (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.15.2-nuc-recovery-6c64822c-fc4c-4d48-89af-dbf20410290a' {
        menuentry 'Ubuntu, with Linux 3.14.5' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.14.5-advanced-6c64822c-fc4c-4d48-89af-dbf20410290a' {
        menuentry 'Ubuntu, with Linux 3.14.5 (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.14.5-recovery-6c64822c-fc4c-4d48-89af-dbf20410290a' {
        menuentry 'Ubuntu, with Linux 3.13.11.2-nuc' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.11.2-nuc-advanced-6c64822c-fc4c-4d48-89af-dbf20410290a' {
        menuentry 'Ubuntu, with Linux 3.13.11.2-nuc (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.11.2-nuc-recovery-6c64822c-fc4c-4d48-89af-dbf20410290a' {
        menuentry 'Ubuntu, with Linux 3.13.0-55-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-55-generic-advanced-6c64822c-fc4c-4d48-89af-dbf20410290a' {
        menuentry 'Ubuntu, with Linux 3.13.0-55-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-55-generic-recovery-6c64822c-fc4c-4d48-89af-dbf20410290a' {

 

Regards,

Sumit 

0 Kudos
sumit_j_1
Beginner
971 Views

Hi Zachary,

With libraray- /usr/local/lib/dri/i965_drv_video.so.  Decode example was working   but now with iHD_drv_video.so even sample_decode_drm is now working,,

Error is-

libva info: VA-API version 0.35.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_0_32
libva info: va_openDriver() returns 0
Decoding Sample Version 0.0.000.0000


Input video     AVC
Output format   YUV420
Resolution      1280x720
Crop X,Y,W,H    0,0,0,0
Frame rate      22.00
Memory type             system
MediaSDK impl           hw
MediaSDK version        1.15

Decoding started
Frame number:    0, fps: 0.000, fread_fps: 0.000, fwrite_fps: 0.000
Return on error: error code -1, 

/MediaSDK2015R5/MediaSamples_Linux_6.0.16043138.138/samples/sample_decode/src/pipeline_decode.cpp   1325


Return on error: error code 1,  

/MediaSDK2015R5/MediaSamples_Linux_6.0.16043138.138/samples/sample_decode/src/sample_decode.cpp     526

 

Is this because of kernel issue which i am seeing with encode also.

Regards,

Sumit jha

 

0 Kudos
Jiandong_Z_Intel
Employee
971 Views

Hi ,

Have you select menu entry 'Ubuntu, with Linux 3.14.5' in grub menu when boot up ?

what is your currently kernel version ?

$uname -r

How did you install your UMD ?

Do you install your UMD refer following topic ?

https://software.intel.com/en-us/forums/topic/562610

https://software.intel.com/en-us/forums/topic/543365

Have you  add the user(s) who will run Intel Media Server Studio – SDK applications to the video group ?

 

Thanks

Zachary

0 Kudos
sumit_j_1
Beginner
971 Views

hi Zachary,

Thank you for your kind support.

When i installed USD mode, I didn't add any user in  video group as  I am the only user. Except that i followed all the step given in documentation. So do i need to install it again ?

Steps-

 $ tar -xvzf MediaServerStudio*.tar.gz
$ cd MediaServerStudio*
$ tar -xvzf SDK*.tar.gz
$ cd SDK*

 

then used Genric installation steps-

UMD install steps:

1. unzipped generic folder-in which i got opt-etc-usr folders 
2.  Copy the contents of etc, opt, and usr to /etc, /opt/ and /usr   (destinations, paths, etc. 
may need to be tweaked depending on your distro)
3.  Remove other versions of libdrm and libva from the /usr directory.   Multiple versions 
of these libraries can cause problems.
4.  Rebuild and install libdrm from /opt/intel/mediasdk/opensource/libdrm.   Some 
prerequisites like libxcb-devel and libpciaccess-devel may be required
5.  Rebuild and install libva from /opt/intel/mediasdk/opensource/libva/.   Installing some 
prerequisites may be required to complete its configure stage
6.  Set these environment variables in /etc/environment

LD_LIBRARY_PATH="/usr/local/lib;/usr/lib64"
LIBVA_DRIVER_NAME=iHD 
LIBVA_DRIVERS_PATH=/opt/intel/mediasdk/lib64

 

 

0 Kudos
Jiandong_Z_Intel
Employee
971 Views

Hi Sumit,

Once your KMD is okay,

$ uname -r

3.14.5

You can do UMD (user mode driver) installation, I suggest using following script to finish UMD installation.

#!/bin/bash

echo "Modify file for ubuntu ..."
find -name "*.pc" | xargs sed -i 's|lib64|lib/x86_64-linux-gnu|g'

# if using MSS version less than R6, please uncomment this.
#sed -i 's|lib64|lib/x86_64-linux-gnu|g' etc/OpenCL/vendors/intel.icd

echo "Remove old MSS install files ..."
sudo rm -rf /opt/intel/mediasdk
sudo rm -rf /opt/intel/common
sudo rm -rf /opt/intel/opencl

# remove old libdrm and libva
find /usr -name "libdrm*" | xargs sudo rm -rf
find /usr -name "libva*" | xargs sudo rm -rf

echo "Install MSS files ..."
sudo cp -rdf opt/* /opt/
sudo cp -rdf etc/* /etc/

sudo cp -rdf usr/bin/*     /usr/bin/
sudo cp -rdf usr/include/* /usr/include/
sudo cp -rdf usr/lib64/*   /usr/lib/x86_64-linux-gnu/
sudo cp -rdf usr/share/*   /usr/share


echo "Install finished, please reboot ..."

This script is a reference for install MSS UMD on Ubuntu.  You can use this script  instead of  install_media.sh in MSS "Generic" package.

Thanks

Zachary

 

0 Kudos
sumit_j_1
Beginner
971 Views

Hi Zachary,

I didn't change any setting except Kernel.

Now my kernel is 3.14.5.

I tried to run decode/encode/transcode. All three examples are running now.

Thanks for your help in debugging the issue.

Plz suggest some good source of material which will help me to write my own application. I need some conceptual clarity on SDK functioning.

Regards,

Sumit Jha

 

0 Kudos
sumit_j_1
Beginner
971 Views

Hi,

All sample examples are built for 64 bit machine.  Can i do same for 32 bit machine ? I want to run these samples/other samples binaries for 

32 bit machine- Intel(R) Atom(TM) CPU CE5316.

Plz suggest how to proceed.

Regards,

Sumit Jha

 

0 Kudos
Jiandong_Z_Intel
Employee
971 Views

Hi Sumit,

Great to know MSDK samples worked for you.

You can start your own application from MSDK tutorial http://software.intel.com/sites/default/files/mediasdk-tutorials-0.0.3.tar.gz, it is simpler than MSDK samples https://software.intel.com/en-us/intel-media-server-studio-support/code-samples, easy to following.

Following documents can be referred during the your development

Intel® Media SDK Dev Guide

Intel Media SDK Reference Manual

 

For Linux only 64 bit are supported by Media Server Studio.

For Windows your can through Intel INDE Suite, which is available here https://software.intel.com/intel-inde/try-buy. You can download the professional version which free right now. And 32 bit MSDK sample can download from https://software.intel.com/en-us/media-client-solutions-support/code-samples (version 6.0.0.68)

 

Thanks

Zachary

0 Kudos
sumit_j_1
Beginner
971 Views

Hi all,

I have one doubt regarding use of MEDIA SDK API and VA-API(libva). As per my basic understanding of MEDIA SDK, SDK application calls VA-API to use HW -decode/encode.AS follows-

{My application + MediaSDK Application} ---->VA-API --> Kernel--> Device Driver for HW DECODE/ENCODE.

Now if i use directly VA-API as follows-

My Application--->VA-API --> Kerenel--> Device Driver for HW DECODE/ENCODE.

i.e no Media SDK.

What will be pros and cons for this exercise.

My naive guess says that  it will give some benefits  by getting rid of Media SDK overhead. But at the same time one has write own  wrapper to use VA-API.So basically implementation of that wrapper will  decides which one is better.

Does libVA of MEDIA SDK package is better implementation of opensource VA -API libs ?

Regards,

Sumit Jha

0 Kudos
sumit_j_1
Beginner
971 Views

HI all,

I am modifying my previous doubt after going through some query and replies.

As per my basic understanding of MEDIA SDK-, SDK-API calls   VA-API to use HW -decode/encode.AS follows-

{ MediaSDK Application}-API ---->VA-API --> Kernel--> Device Driver for HW DECODE/ENCODE.

Now if i use directly VA-API as follows-

My Application--->VA-API --> Kerenel--> Device Driver for HW DECODE/ENCODE.

i.e no Media SDK-API

What will be pros and cons for this exercise.

My naive guess says that  it will give some benefits  by getting rid of Media SDK overhead. But at the same time one has write own  wrapper to use VA-API.So basically implementation of that wrapper will  decides which one is better.

Does libVA of MEDIA SDK package is better implementation of opensource VA -API libs ?

And, what extra media SDK gives apart from libVA (non-open source,)which comes with SDK package.

Regards,

Sumit Jha

0 Kudos
Jiandong_Z_Intel
Employee
865 Views

Hi Sumit

Your question is the same with https://software.intel.com/en-us/forums/intel-media-sdk/topic/594461.

So, we are closing this issue. Please start a new post, if you come across any new issues. 

Thanks

Zachary

 

0 Kudos
Reply