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.
3066 Discussions

Sample code in MSS Essentials 2015R6 returning error

Robby_S
New Contributor I
463 Views

Dear Intel Engineers,

After I successfully (I believe) installed the MSS (Media Server Studio) Essentials 2015R6 release, the first sample code I run is returning errors. Could you help me decide what the issue is? Thanks!

Please read the following for details.

******************************************************

My platform:

CPU: Intel Core i7-4870HQ CPU@2.50GHz x 8

GPU: Intel Haswell Mobile (the sticker by the touchpad has "Iris Pro Graphics" on it)

OS: CentOS Linux release 7.1.1503 (Core)

Linux Kernel: 3.10.0-229.7.2.el7.x86_64 #1 SMP (this did not change after the MSS installation and reboot)

MSS version: Essentials 2015R6 for Linux (mediaserverstudioessentials2015r6.tar.gz)

******************************************************

My procedure:

I followed the document, Intel® Media Server Studio 2015 - Driver, SDK, Samples for Linux* Getting Started Guide (below I'll refer to it as MSSGSG for the sake of brevity). I didn't download MSSGSG directly from Intel's website. Rather I got it after first untarring mediaserverstudioessentials2015r6.tar.gz, and then untarring SDK2015Production16.4.2.1.tar.gz.

Before installing MSS, I tested the pre-erquisite as below:

-------------------------------------------------------------

$ lspci -nn -s 00:02.0
00:02.0 VGA compatible controller [0300]: Intel Corporation Crystal Well Integrated Graphics Controller [8086:0d26] (rev 08)

-------------------------------------------------------------

I then followed MSSGSG all the way through the section, Verifying correct installation. Below is what I got:

-------------------------------------------------------------

$ lsmod | grep 'i915'
i915                  929459  6
i2c_algo_bit           13413  1 i915
drm_kms_helper         98226  1 i915
drm                   311588  5 i915,drm_kms_helper
i2c_core               40325  7 drm,i915,i2c_i801,i2c_hid,drm_kms_helper,i2c_algo_bit,videodev
video                  19263  1 i915

-------------------------------------------------------------

Compared with the list in MSSGSG, I didn't have intel_gtt and button. Is that expected? Other than those two items missing, the MSS installation seemed successful.

******************************************************

How the error was generated:

I did not follow MSSGSG to download and build the sample code. Rather, I noticed that a sample package, MediaSamples_Linux_bins_6.0.16043175.175.tar.gz, already existed inside the directory that had been generated after I untarred mediaserverstudioessentials2015r6.tar.gz. I decided to use that sample package to save me from building the sample from source.

I untarred the sample package, and copied the generated directory to /opt/intel/mediasdk/samples. Below is a list of files in the directory and its sub-directory:

-------------------------------------------------------------

$ ls -al
total 3044
drwxr-xr-x.  3 rsun rsun   4096 Jul 15 15:38 .
drwxr-xr-x. 10 root root   4096 Jul 15 15:39 ..
drwxr-xr-x.  2 rsun rsun   4096 Jul 15 15:38 content
-rwxr-xr-x.  1 rsun rsun     94 Jul 15 15:38 README
-rwxr-xr-x.  1 rsun rsun 362625 Jul 15 15:38 sample_decode_drm
-rwxr-xr-x.  1 rsun rsun 362370 Jul 15 15:38 sample_decode_x11
-rwxr-xr-x.  1 rsun rsun 384344 Jul 15 15:38 sample_encode_drm
-rwxr-xr-x.  1 rsun rsun 384254 Jul 15 15:38 sample_encode_x11
-rwxr-xr-x.  1 rsun rsun 471562 Jul 15 15:38 sample_multi_transcode_drm
-rwxr-xr-x.  1 rsun rsun 471307 Jul 15 15:38 sample_multi_transcode_x11
-rwxr-xr-x.  1 rsun rsun 325875 Jul 15 15:38 sample_vpp_drm
-rwxr-xr-x.  1 rsun rsun 321466 Jul 15 15:38 sample_vpp_x11
$ ls -al content
total 3436
drwxr-xr-x. 2 rsun rsun    4096 Jul 15 15:38 .
drwxr-xr-x. 3 rsun rsun    4096 Jul 15 15:38 ..
-rwxr-xr-x. 1 rsun rsun     237 Jul 15 15:38 about-the-video.txt
-rwxr-xr-x. 1 rsun rsun 2559744 Jul 15 15:38 test_stream_176x96.yuv
-rwxr-xr-x. 1 rsun rsun  267554 Jul 15 15:38 test_stream.264
-rwxr-xr-x. 1 rsun rsun  145198 Jul 15 15:38 test_stream.265
-rwxr-xr-x. 1 rsun rsun   10242 Jul 15 15:38 test_stream.jpg
-rwxr-xr-x. 1 rsun rsun  214320 Jul 15 15:38 test_stream.mpeg2
-rwxr-xr-x. 1 rsun rsun  117268 Jul 15 15:38 test_stream_vp8.ivf
-rwxr-xr-x. 1 rsun rsun  178689 Jul 15 15:38 test_stream_vp9.ivf

-------------------------------------------------------------

Note that I had the permission to create new files in the /opt/intel/mediasdk/samples directory. Then I typed the command below to run the sample, and got the following errors:

-------------------------------------------------------------

$ ./sample_multi_transcode_drm -i::h264 content/test_stream.h264 -o::h264 test_out.h264 -hw
Multi Transcoding Sample Version 6.0.16043175.175

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

Return on error: error code -2,    /home/lab_msdk/buildAgentDir/buildAgent_MediaSDK3/git/mdp_msdk-samples/samples/sample_multi_transcode/src/pipeline_transcode.cpp    2515

Return on error: error code -2,    /home/lab_msdk/buildAgentDir/buildAgent_MediaSDK3/git/mdp_msdk-samples/samples/sample_multi_transcode/src/sample_multi_transcode.cpp    146

-------------------------------------------------------------

What I don't understand, is that there is no such directory /home/lab_msdk/ on my PC, but the errors seem to indicate that I should have some source code files in that non-existing directory. Why is that?

It's a long post. Thank you in advance for reading, understanding, and trouble shooting my problem!

-Robby

0 Kudos
1 Solution
Shaojuan_Z_Intel
Employee
463 Views

Hi Robby,

After reading again, I noticed that you copied the content folder already. Sorry I missed it earlier. Regarding to your questions, error code -17 means device failure. You can find more information about the error codes in mfxdefs.h under /opt/intel/mediasdk/include. The file test_stream.264 is a short test video, it is unlikely that it is corrupted. If you want, you can play it with ffplay too.

I looked through your comment, and noticed that the kernel after reboot seems not right. After reboot, when you type uname -r, you should see something with "MSSrN" in the ID (where N is the release number). Please ensure you reboot to the correct kernel. If not, the installation was not successful. Also, when you run the samples as a regular user, please make sure the user is added to video group already, otherwise, please run the samples as root. Thanks!

View solution in original post

0 Kudos
5 Replies
Shaojuan_Z_Intel
Employee
463 Views

Hi Robby,

Thank you for providing detailed information! This makes the investigation much easier. The error code -2 means MediaSDK found null pointer, in this case, it could be that it didn't find the specified source file. In your command, I guess you were in the samples binary directory, and the test stream should be in a folder that's upper level, and the file name should be test_stream.264 instead of test_stream.h264. So you might try again with this command "./sample_multi_transcode_drm -i::h264 ../content/test_stream.264 -o::h264 test_out.h264 -hw" instead, and please let us know if you see a different error.Thanks!

0 Kudos
Robby_S
New Contributor I
463 Views

Hi Shaojuan,

Thanks for your response, and yes the file name extension should be .264, not .h264. That's a nice catch.

I was in the samples binary directory, but I made sure that content/test_stream.264 was in the same directory, as shown above by the `ls -al` commands. I tried the same command (with file extension corrected), and this time I got different errors. Please see below:

-------------------------------------------------------------

$ ./sample_multi_transcode_drm -i::h264 content/test_stream.264 -o::h264 test_out.264 -hw
Multi Transcoding Sample Version 6.0.16043175.175

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
Pipeline surfaces number: 21
MFX HARDWARE Session 0 API ver 1.16 parameters:
Input  video: AVC
Output video: AVC

Session 0 was NOT joined with other sessions

Transcoding started
.
Return on error: error code -17,    /home/lab_msdk/buildAgentDir/buildAgent_MediaSDK3/git/mdp_msdk-samples/samples/sample_multi_transcode/src/pipeline_transcode.cpp    1084


Return on error: error code -17,    /home/lab_msdk/buildAgentDir/buildAgent_MediaSDK3/git/mdp_msdk-samples/samples/sample_multi_transcode/src/pipeline_transcode.cpp    1051


Transcoding finished

Common transcoding time is  0.01 sec
MFX session 0 transcoding FAILED:
Processing time: 0.01 sec
Number of processed frames: 1

The test FAILED

Return on error: error code 1,    /home/lab_msdk/buildAgentDir/buildAgent_MediaSDK3/git/mdp_msdk-samples/samples/sample_multi_transcode/src/sample_multi_transcode.cpp    513

-------------------------------------------------------------

I have two questions:

1) What does the error code -17 mean, and what might be the cause for the error?

2) Where can I find the information about all the error codes?

I also tried to play the file, content/test_stream.264, with the VLC player, but couldn't. How do I verify that the file is not corrupted?

Thanks again,

-Robby

0 Kudos
Shaojuan_Z_Intel
Employee
464 Views

Hi Robby,

After reading again, I noticed that you copied the content folder already. Sorry I missed it earlier. Regarding to your questions, error code -17 means device failure. You can find more information about the error codes in mfxdefs.h under /opt/intel/mediasdk/include. The file test_stream.264 is a short test video, it is unlikely that it is corrupted. If you want, you can play it with ffplay too.

I looked through your comment, and noticed that the kernel after reboot seems not right. After reboot, when you type uname -r, you should see something with "MSSrN" in the ID (where N is the release number). Please ensure you reboot to the correct kernel. If not, the installation was not successful. Also, when you run the samples as a regular user, please make sure the user is added to video group already, otherwise, please run the samples as root. Thanks!

0 Kudos
Robby_S
New Contributor I
463 Views

Hi Shaojuan,

You nailed it! It was indeed the kernel.

Back when I ran the command `rpm -Uvh kernel-3.10.*.rpm` as root, the kernel was not updated due to the following warning:

-------------------------------------------------------------
    package kernel-3.10.0-229.7.2.el7.x86_64 (which is newer than kernel-3.10.0-229.1.2.39163.MSSr4.el7.centos.x86_64) is already installed

-------------------------------------------------------------

Somehow I missed that warning. The section "Verifying correct installation" in MSSGSG talks about `uname -r`, but does not specify exactly what to look for.

This time, I ran the command `rpm -Uvh --oldpackage kernel-3.10.*.rpm` to force a kernel update, and then rebooted.

Now the sample code ran successfully:

-------------------------------------------------------------

$ ./sample_multi_transcode_drm -i::h264 content/test_stream.264 -o::h264 test_out.264 -hw
Multi Transcoding Sample Version 6.0.16043175.175

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
Pipeline surfaces number: 21
MFX HARDWARE Session 0 API ver 1.16 parameters:
Input  video: AVC
Output video: AVC

Session 0 was NOT joined with other sessions

Transcoding started
..
Transcoding finished

Common transcoding time is  0.08 sec
MFX session 0 transcoding PASSED:
Processing time: 0.08 sec
Number of processed frames: 101

The test PASSED

-------------------------------------------------------------
 

Thanks a lot for your help!

Cheers,

-Robby

0 Kudos
Shaojuan_Z_Intel
Employee
463 Views

Hi Robby,

Glad you got it working, and thank you for updating!

0 Kudos
Reply