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

Media SDK installation for Ubuntu and integrating with ffmpeg problem

Anas_S_
Beginner
906 Views

I am having an i7-4770k processor and I am very much interested to use intel Media SDK on my transcoding streams using ffmpeg.

I have ubuntu 12.04 and I tried to install media SDK firstly as described here: https://software.intel.com/en-us/forums/topic/472852 and installed the 4th generation requirements and started the media SDK installation using ./install_media.sh and I have choosed y to cofirm install KMD and tried to install kmd options 0 and 1 and for both get the following problems.

For option '0=kmd/source/xcode-ubuntu-12.04-k3.8-rel/kmd_patched_sources.tar.bz2' the error is:

/tmp/kmd/drivers/gpu/drm/i915/../drm_proc.c: In function ‘drm_proc_open’:
/tmp/kmd/drivers/gpu/drm/i915/../drm_proc.c:66:9: error: implicit declaration of function ‘PDE’ [-Werror=implicit-function-declaration]
/tmp/kmd/drivers/gpu/drm/i915/../drm_proc.c:66:41: error: invalid type argument of ‘->’ (have ‘int’)
/tmp/kmd/drivers/gpu/drm/i915/../drm_proc.c: In function ‘drm_proc_create_files’:
/tmp/kmd/drivers/gpu/drm/i915/../drm_proc.c:119:4: error: dereferencing pointer to incomplete type
cc1: some warnings being treated as errors
make[2]: *** [/tmp/kmd/drivers/gpu/drm/i915/../drm_proc.o] Error 1
make[1]: *** [_module_/tmp/kmd/drivers/gpu/drm/i915/..] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.11.0-19-generic'
make: *** [kmd] Error 2
Error... ERROR with "make -f makefile.i915 kmd KERNEL_DIR=/usr/src/linux-headers-3.11.0-19-generic", Return status 2.

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

and for option '1= kmd/source/xcode-ubuntu-12.04-k3.2-rel/kmd_patched_sources.tar.bz2' the error is:

 

/tmp/kmd/drivers/gpu/drm/i915/../drm_bufs.c: In function ‘drm_mapbufs’:
/tmp/kmd/drivers/gpu/drm/i915/../drm_bufs.c:1557:4: error: implicit declaration of function ‘do_mmap’ [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[2]: *** [/tmp/kmd/drivers/gpu/drm/i915/../drm_bufs.o] Error 1
make[1]: *** [_module_/tmp/kmd/drivers/gpu/drm/i915/..] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.11.0-19-generic'
make: *** [kmd] Error 2
Error... ERROR with "make -f makefile.i915 kmd KERNEL_DIR=/usr/src/linux-headers-3.11.0-19-generic", Return status 2.

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

I want also if possible a how to install and use the H/W accelerated decoding/encoding with ffmpeg on linux to do a transcoding process like this one and all done through the H/W acceleration:

ffmpeg -threads auto -i <input> -strict experimental -vcodec libx264 -threads auto -filter:v yadif -profile:v main -level 30 -coder 1 -bf 0 -g 125 -b:v 1400k -bufsize 600k -maxrate 2000k -acodec aac -b:a 128k -ar 44100 -ac 2 -f flv -y <output>

 

I would really apperiace you help and I look forward to hearing from you.

 

Regards,

 

 

0 Kudos
7 Replies
Anas_S_
Beginner
906 Views

Sorry forget to mention that for the transcoding process the input will be H264 or MPEG2Video for video codec and MPEG2AUDIO for audio codec and the output will be H264 for video and libfaac as mentiond or libmp3lame.

0 Kudos
Jeffrey_M_Intel1
Employee
906 Views

While the install process is improving, it still works best to start with the specific kernel version matching the pre-built i915 module.

What is your kernel version (as reported by uname -r)? 
Can you see a Haswell GPU with "lspci -nn | grep 'VGA'" ?

You may be interested in Media SDK's container capabilities as showcased in the full transcode sample.  Audio support is coming in the next release.  While many of these capabilities are based on ffmpeg, they are not integrated in ffmpeg.  For an example showing another way of using Media SDK and ffmpeg together please see the Media SDK tutorial. In this example the application uses ffmpeg and Media SDK APIs together to achieve a full pipeline with HW acceleration. Note: this version is Windows only but porting is not difficult.

0 Kudos
Anas_S_
Beginner
906 Views

 

Thanks for your reply Jeffrey.

1) Kernel version as showed on uname is: 3.8.0-23-generic

2) I have checked for Haswell GPU and nothing there for it and the only thing for VGA is:

00:02.0 VGA compatible controller [0300]: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller [8086:0412] (rev 06)


3) I am on ubunut 12.04.4 64 bit and still having the same errors with this configuration

Thanks for the ffmpeg sample as it covers everything and I look forward to complete the installation and start using it

I look forward to hearing from you.

Regards,

0 Kudos
Jeffrey_M_Intel1
Employee
906 Views

From the info you've sent you should be able to install. The processor/GPU PCIid should be supported.

The way the install works is:
1. Install all of the user mode components, samples, etc
2. Install kernel mode components
   a. If the version and config matches the supported configuration, use the prebuilt driver module
   b. If not, attempt to build a new module.  Pick 0 for Haswell/4th Generation Core, 1 for Ivybridge/3rd Generation Core.

The module build step is limited and not guaranteed.  It works best for kernel versions extremely close to the supported configuration (in this case 3.8.0-23-generic).  With Ubuntu 12.04.4 the default kernel jumps significantly forward from 3.8 to 3.11 so the build assist doesn't work.  

I tried an install with Ubuntu 12.04.4 and didn't see this problem.  However, the only reason why you should see the 0/1 options and rebuild is if there is a mismatch between the currently running kernel and the supported configuration.

Below are the steps that I used for 12.04.4.  Please let me know if this sequence of steps does not have an outcome like in step #3.

Good luck!  Jeff

 

1. Before starting install

    apt-get install linux-image-3.8.0-23-generic linux-headers-3.8.0-23-generic 
    
    Remove all other kernel images with apt-get remove, /usr/sbin/update-grub2  
    (NOT necessary, but it is much more convenient if 3.8.0-23 is the grub default.)

    reboot

2. Make sure 3.8.0-23-generic is loaded with uname -r

3. Run installer.  Output should look like below, with no 0/1 options for KMD: 
 

$ sudo ./install_media.sh
INFO... Install on Ubuntu ...
INFO... Installing New Driver...
INFO... MediaSDK installed successfully in /opt/intel/mediasdk!
INFO... Do you want to install KMD?
press 'y' to confirm, otherwise cancelled.y
INFO... Original i915.ko backuped in kmd_backup/i915.ko.2014-05-02_075508
INFO... Original drm.ko backuped in kmd_backup/drm.ko.2014-05-02_075508
INFO... Original drm_kms_helper.ko backuped in kmd_backup/drm_kms_helper.ko.2014-05-02_075508
INFO... Trying to install  kmd...
INFO... ./kmd/binary/xcode-ubuntu-12.04-k3.8-rel/i915.ko installed successufully.
INFO... ./kmd/binary/xcode-ubuntu-12.04-k3.8-rel/drm.ko installed successufully.
INFO... ./kmd/binary/xcode-ubuntu-12.04-k3.8-rel/drm_kms_helper.ko installed successufully.
INFO... After reboot, you can 'lsmod' to identify whether i915.ko drm.ko drm_kms_helper.ko loaded. if not, you have to rebuild kernel by yourself with patched files (kdm/source) in this package.
update-initramfs: Generating /boot/initrd.img-3.8.0-23-generic
INFO... Kernel module updated successfully!
INFO... Package installation Done.

0 Kudos
Anas_S_
Beginner
906 Views

Hi Jeff,

Thanks for your reply and the installation steps.

I have successfully installed media SDK on ubuntu 12.04 and lsmod shows that all kernel modules are loaded successfully without any problem and I have also integrated media SDK for H264 decoding/encoding and MPEG2 decoding for ffmpeg but when I tried to convert MPEG2 video from TS streams to H264 video, the process failed and ffmpeg returns with conversion failed and a warning saying no libmfxsw64.so but all functions related to libmfxhw64.so  loaded in ffmpeg functions so I don't think that this is libmfxsw64 problem.

I look forward to hearing from you.

Regards,

Anas

0 Kudos
Helmut_A_
Beginner
906 Views

Hello,

I encountered exactly the same problem (with the missing libmfxsw64.so). Is there anyone who is successfully using the MSDK with h264 qsv encoding under linux ?

0 Kudos
vinay_k_1
Beginner
906 Views

I also faced same issue. 
I have system with i5-2520-M , which has quick sync video support . 
I have installed Ubuntu-12.04 LTS with 3.11.0.15-generic kernel. My installation of mediasdk worked fine till intel media sdk and then KMD drivers installation gave same issues as quoted above in this forum.

I tried all the steps which Jeff had given, but no luck. I am still getting following errors:

 

/tmp/kmd/drivers/gpu/drm/i915/../drm_proc.c: In function ‘drm_proc_open’:
/tmp/kmd/drivers/gpu/drm/i915/../drm_proc.c:66:9: error: implicit declaration of function ‘PDE’ [-Werror=implicit-function-declaration]
/tmp/kmd/drivers/gpu/drm/i915/../drm_proc.c:66:41: error: invalid type argument of ‘->’ (have ‘int’)
/tmp/kmd/drivers/gpu/drm/i915/../drm_proc.c: In function ‘drm_proc_create_files’:
/tmp/kmd/drivers/gpu/drm/i915/../drm_proc.c:119:4: error: dereferencing pointer to incomplete type
cc1: some warnings being treated as errors
make[2]: *** [/tmp/kmd/drivers/gpu/drm/i915/../drm_proc.o] Error 1
make[1]: *** [_module_/tmp/kmd/drivers/gpu/drm/i915/..] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.11.0-15-generic'
make: *** [kmd] Error 2
Error... ERROR with "make -f makefile.i915 kmd KERNEL_DIR=/usr/src/linux-headers-3.11.0-15-generic", Return status 2.

 

Please help to resolve this issue.

 

0 Kudos
Reply