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.

Several issue about new update for linux

fei_y_
Beginner
529 Views

I've got the new linux sdk a few days ago, and I'm glad to see some new features be added such as lookahead ,interlaced and etc.

But when I used lookahead and interlaced, I found some problem

1) lookahead

I use lookahead in my project as follow:

...

m_CodingOption2.LookAheadDepth = 40;

m_mfxEncParams.mfx.RateControlMethod = MFX_RATECONTROL_LA;

....

when init encoder, the error code(-1) returned, did I make mistake?

2)about Interlaced stream

I modify the code of sample_encoder_drm to test interlaced encoding and I found some strange things.

I set the reference frame in param,

m_mfxEncParams.mfx.NumRefFrame = 4 ...

when test hd1080p encode, if ref frames<=4 , the interlaced is OK(I used mediainfo )


when ref frame >= 5, the interlaced is failed

(command is the same, only modify the ref frames)

Is this a bug ?


Ref frame=4
/root/intelsample/sample_encode_drm h264 -i /root/wdg/video/100frame.yuv -w 720 -h 576 -tff -hw -vaapi -f 25 -b 2000 -o /root/wdg/video/intel.hd.h264 -dstw 1920 -dsth 1080
root@unicoder2013:~/wdg/video# sh runhd.sh
libva info: VA-API version 0.34.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_0_32
libva info: va_openDriver() returns 0
Intel(R) Media SDK 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      1920x1088
        Crop X,Y,W,H    0,0,1920,1080
Frame rate      25.00
Bit rate(Kbps)  2000
Target usage    balanced
Memory type     d3d
Media SDK impl          hw
Media SDK version       1.8

Processing started
Frame number: 1009, fps:101.31, spend:0.88
Processing finished
root@unicoder2013:~/wdg/video# mediainfo intel.hd.h264
General
Complete name                            : intel.hd.h264
Format                                   : AVC
Format/Info                              : Advanced Video Codec
File size                                : 761 KiB
Duration                                 : 4s 0ms
Overall bit rate mode                    : Constant
Overall bit rate                         : 1 558 Kbps

Video
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.0
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Duration                                 : 4s 0ms
Bit rate mode                            : Constant
Bit rate                                 : 1 490 Kbps
Nominal bit rate                         : 2 000 Kbps
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 25.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan order                               : Top Field First
Bits/(Pixel*Frame)                       : 0.029
Stream size                              : 727 KiB (96%)

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

REF frame=5
/root/intelsample/sample_encode_drm h264 -i /root/wdg/video/100frame.yuv -w 720 -h 576 -tff -hw -vaapi -f 25 -b 2000 -o /root/wdg/video/intel.hd.h264 -dstw 1920 -dsth 1080
libva info: VA-API version 0.34.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_0_32
libva info: va_openDriver() returns 0
Intel(R) Media SDK 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      1920x1088
        Crop X,Y,W,H    0,0,1920,1080
Frame rate      25.00
Bit rate(Kbps)  2000
Target usage    balanced
Memory type     d3d
Media SDK impl          hw
Media SDK version       1.8

Processing started
Frame number: 1009, fps:132.18, spend:0.67
Processing finished

root@unicoder2013:~/wdg/video# mediainfo intel.hd.h264
General
Complete name                            : intel.hd.h264
Format                                   : AVC
Format/Info                              : Advanced Video Codec
File size                                : 885 KiB
Duration                                 : 4s 0ms
Overall bit rate mode                    : Constant
Overall bit rate                         : 1 813 Kbps

Video
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L5.0
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 5 frames
Duration                                 : 4s 0ms
Bit rate mode                            : Constant
Bit rate                                 : 1 734 Kbps
Nominal bit rate                         : 2 000 Kbps
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 25.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.033
Stream size                              : 847 KiB (96%)


OS: Ubuntu 1204 3.8.0-23-generic

CPU:Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz

0 Kudos
4 Replies
Jeffrey_M_Intel1
Employee
529 Views

Thanks for this report.  I'm looking into it and will get back to you soon.

0 Kudos
Jeffrey_M_Intel1
Employee
529 Views

Both of these issues have been replicated.  The lookahead issue is being processed as a bug.  For interlaced encodes with NumRefFrame>=5 this causes a MFX_WRN_INCOMPATIBLE_VIDEO_PARAM warning, indicating that this is exceeding a Media SDK limit.  I'll update as more details come in. 

0 Kudos
Jeffrey_M_Intel1
Employee
529 Views

I have some updates on both issues.

1) Lookahead:

In previous releases Media SDK for Linux Servers required separate compilation of libdrm >= 2.4.45.  Now a customized libdrm is part of Media SDK installation and any other versions of libdrm on your system must be removed first.  The install procedure has been updated in the release notes which can be downloaded from registrationcenter.intel.com.  A summary of the new install steps is below:

   Double check hardware, OS, and kernel level
   Remove any libdrm on the system
    $ sudo find /usr –name 'libdrm*' (check files to remove)
    $ sudo find /usr –name 'libdrm*' -exec rm –rf {} \;
   Run the install script
        $ sudo ./install_media.sh

In future releases we hope for better interoperability with the standard Linux stack so you will not always need to remove other versions of libdrm.  However, for now using the customized libdrm is necessary for lookahead.

2) Interlaced with >4 reference frames

This is a design limit for the current implementation.  Interlaced encode is supported at <=4 reference frames, above that is only available with progressive.  Implementation details like this can change between releases. Return status and query mechanisms are available to help determine specific capabilities at runtime.

0 Kudos
Bob_Kirnum
Beginner
529 Views

Has the libdrm issue been resolved yet?  Seems the R6 release still installs a specific libdrm.  This is a problem for us since it installs only a specific version for 64 bit.  We have other 32 bit applications which depend on the 32 bit version of libdrm.  Not providing both 32 bit and 64 bit libraries of the same version is an issue.

0 Kudos
Reply