Giter Club home page Giter Club logo

mediasdk's People

Contributors

alariono avatar alexelizarov avatar andreyor avatar aobolensk avatar chuanli1 avatar daleksan avatar denwolf avatar dmitrybrazhkin avatar dmitryermilov avatar dvrogozh avatar egorovdanil avatar eistarov avatar eshiryae avatar fzhar avatar intel-mediadev avatar ivan-losev avatar lakulako avatar mgonchar avatar ogolikov avatar pgribov avatar rkazants avatar romka0017 avatar semelianova avatar shawnli2 avatar spossos avatar vmaksimo avatar vshampor avatar wangyan42164 avatar xhaihao avatar yskuridi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mediasdk's Issues

Wrong path for VTune support

Setting ITT_PATH recommendations seem to be wrong for VTune.
Should be '$ITT_PATH/lib64/libittnotify.a', not '$ITT_PATH/libittnotify64.a'
'$ITT_PATH/include/ittnotify.h' is OK.

Allow flexibility in dmabuf-import use case

Currently, MediaSDK requires to pre-allocate all the surfaces in a pool during MFXXXX_Init().
For dmabuf use case there are two possible options:

  1. dmabuf-export from MediaSDK components
  2. dmabuf-import in MediaSDK components.

The dmabuf-export(1) works fine since MediaSDK application is creating all surfaces.

But in case of dmabuf-import(2), the Media-SDK application might not be able to preallocate all the dmabuf based memory/surfaces because the original memory has been already created by some other driver (Eg: V4l2) and the msdk-application only get the memory FD of a single buffer just before processing.
Is there any way to bypass the requirement to have to preallocate all required buffers during MFXXXX_Init()?

Note: I'm not saying that it is "impossible" to get all buffer-id before MFX_XXX_Init() within the application, but it would be better to handle the stuff in the other way around (possibility to accept dmabuf based buffers as the input of Encode and VPP as it comes even if it didn't belong to a pre-allocated buffer pool)

[Question] HEVC 10bit decode support

The open source LibVA from 01.org does not support HEVC 10bit HW decode on SKL. Does the Media SDK provide that support for SKL? I was able to get 8bit fixed function HEVC decode going with the 2017 SDK. Want to understand what is supported for the 10bit decode. Is it Software only or is it a hybrid implementation?

What about KBL support for 10bit fixed function HEVC decode in the latest SDK?

Vertical mirroring mode does not work on Apollo Lake Linux with sample_vpp

When specifying horizontal mirroring assuming NV12 to NV12 output as shown below, it seems to work perfectly:

ishmael@ishmael-desktop ~ $ /opt/intel/mediasdk/samples/sample_vpp -sw 640 -sh 360 -scc nv12 -dw 640 -dh 360 -dcc nv12 -iopattern d3d_to_d3d -mirror 1 -i /home/ishmael/Videos/nv12_640x360.yuv -o /home/ishmael/Videos/nv12_640x360_lr.yuv 
libva info: VA-API version 1.0.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_0
libva info: va_openDriver() returns 0
Input format	NV12
Resolution	640x368
Crop X,Y,W,H	0,0,640,360
Frame rate	30.00
PicStruct	progressive
Output format	NV12
Resolution	640x368
Crop X,Y,W,H	0,0,640,360
Frame rate	30.00
PicStruct	progressive

Video Enhancement Algorithms
Deinterlace	OFF
Signal info	OFF
Scaling		OFF
Denoise		OFF
ProcAmp		OFF
DetailEnh	OFF
GamutMapping 	OFF
ColorSaturation	OFF
ContrastEnh  	OFF
SkinToneEnh  	OFF
MVC mode    	OFF
ImgStab    	OFF

IOpattern type               	d3d_to_d3d
Number of asynchronious tasks	1
Time stamps checking         	OFF
ROI checking                 	OFF

MediaSDK impl	hw
HW accelaration is enabled
MediaSDK ver	1.25
VPP started
Frame number: 809
VPP finished

Total frames 809 
Total time 18.61 sec 
Frames per second 43.462 fps 

However, when specifying vertical mirroring, I get the following segfault:

ishmael@ishmael-desktop ~ $ /opt/intel/mediasdk/samples/sample_vpp -sw 640 -sh 360 -scc nv12 -dw 640 -dh 360 -dcc nv12 -iopattern d3d_to_d3d -mirror 2 -i /home/ishmael/Videos/nv12_640x360.yuv -o /home/ishmael/Videos/nv12_640x360_tb.yuv 
libva info: VA-API version 1.0.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_0
libva info: va_openDriver() returns 0

[ERROR], sts=MFX_ERR_UNSUPPORTED(-3), InitMemoryAllocator, pProcessor->pmfxVPP->Query failed at /home/ishmael/msdk/MediaSDK/samples/sample_vpp/src/sample_vpp_utils.cpp:614
Segmentation fault (core dumped)

Is this behaviour specific only to Apollo Lake platforms? How about Skylake, Broadwell, etc.?

Deinterlacing output framerate: Clarification needed

If I understood correctly BOB and Advanced deinterlace should double the framerate and weave should just keep the same framerate.
Q1) Is that the expected output for MediaSDK deinterlace?
Q2) Does the user-space suppose to provide "mfxExtVPPFrameRateConversion" in order to double the framerate after deinterlacing?

MediaSDK performance lower than MediaServerStudioProfessionalEvaluation2017R3

Hi,
I test the performance between MediaSDK and MediaServerStudioProfessionalEvaluation2017R3:

result

  MediaSDK MSS2017R3
enc 0m29.179s 0m21.813s
dec fps: 516.188 fps: 676.469
with ffmpeg fps=218 fps=262

enc (run multi times to avoid I/O limit)

MediaSDK

time __cmake/intel64.make.release/__bin/release/sample_encode h264 -i ~/samples/assassin_st4_1080p30fps.flv.yuv -o out.264 -w 1920 -h 1080 -hw
libva info: VA-API version 1.1.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_1
libva info: va_openDriver() returns 0
Encoding Sample Version 8.2.25.

Input file format YUV420
Output video AVC
Source picture:
Resolution 1920x1088
Crop X,Y,W,H 0,0,1920,1080
Destination picture:
Resolution 1920x1088
Crop X,Y,W,H 0,0,1920,1080
Frame rate 30.00
Bit rate(Kbps) 3757
Gop size 0
Ref dist 0
Ref number 0
Idr Interval 0
Target usage balanced
Memory type system
Media SDK impl hw
Media SDK version 1.25

Processing started
Frame number: 5797

Processing finished

real 0m29.179s
user 0m20.372s
sys 0m9.306s

MediaServerStudioProfessionalEvaluation2017R3

time ./__cmake/intel64.make.release/__bin/release/sample_encode h264 -i ~/samples/assassin_st4_1080p30fps.yuv -o out.264 -w 1920 -h 1080 -hw
libva info: VA-API version 0.99.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 1920x1088
Crop X,Y,W,H 0,0,1920,1080
Destination picture:
Resolution 1920x1088
Crop X,Y,W,H 0,0,1920,1080
Frame rate 30.00
Bit rate(Kbps) 3757
Gop size 0
Ref dist 0
Ref number 0
Idr Interval 0
Target usage balanced
Memory type system
Media SDK impl hw
Media SDK version 1.23

Processing started
Frame number: 5797

Processing finished

real 0m21.813s
user 0m10.992s
sys 0m4.827s

dec

MediaSDK

pretending that aspect ratio is 1:1
libva info: VA-API version 1.1.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_1
libva info: va_openDriver() returns 0
Decoding Sample Version 8.2.25.

Input video AVC
Output format NV12
Input:
Resolution 1920x1088
Crop X,Y,W,H 0,0,0,0
Output:
Resolution 1920x1088
Frame rate 30.00
Memory type system
MediaSDK impl hw
MediaSDK version 1.25

Decoding started
Frame number: 5797, fps: 516.188, fread_fps: 0.000, fwrite_fps: 0.000
Decoding finished

MediaServerStudioProfessionalEvaluation2017R3

pretending that aspect ratio is 1:1
libva info: VA-API version 0.99.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 NV12
Input:
Resolution 1920x1088
Crop X,Y,W,H 0,0,0,0
Output:
Resolution 1920x1088
Frame rate 30.00
Memory type system
MediaSDK impl hw
MediaSDK version 1.23

Decoding started
Frame number: 5797, fps: 676.469, fread_fps: 0.000, fwrite_fps: 0.000
Decoding finished

transcode with ffmpeg

https://github.com/Intel-FFmpeg-Plugin/Intel_FFmpeg_plugins.git
branch intel_plugins-3.3.1
command ./ffmpeg -hwaccel qsv -c:v h264_qsv -i 1080p30fps.flv -c:v h264_qsv -profile:v high -preset medium -b:v 3000k -maxrate:v 6000k -bufsize:v 6000k -look_ahead 1 -look_ahead_depth 20 -g 50 -an -f null -

MediaSDK

frame= 5797 fps=218

MediaServerStudioProfessionalEvaluation2017R3

frame= 5797 fps=262

Build failures with GCC 6

The code fails to build with modern g++-6/gcc-6 releases. I had to revert to gcc-5/g++5 to make progress.

Reset of VPP composition falsely outputs picture in picture

Steps to reproduce:
1: Composite an OSD on a video through VPP
2: Call MFXVideoVPP_Reset without composition params (to remove OSD)
3: Keep running the video through the VPP block. By doing this there will be a PiP at the output where the OSD previously was located.

Calling MFXVideoVPP_Reset again with new composition params will remove the PiP.

Replacing MFXVideoVPP_Reset with MFXVideoVPP_Close + MFXVideoVPP_Init will work as expected. However this solution leaks memory as reported in Issue #105.

Additional info:
Video memory is used through vaapi.
Tested on Apollolake with embedded Linux and Intel Media SDK version 1.26

Can't build mediasdk library with specified API version

With the config command:
perl tools/builder/build_mfx.pl --cmake=intel64.make.release --api=1.25
I should be able to build mediasdk library which will correspond to API=1.25. The problem is that -DMFX_VERSION=1025 is passed only to the few targets like samples, and few msdk targets.

compilation error: sample_hevc_fei

The following compilation error occurs (I'm using GCC 7.2.1):

[ 94%] Building CXX object samples/sample_hevc_fei/CMakeFiles/sample_hevc_fei.dir/src/pipeline_hevc_fei.cpp.o
cd /home/uaeoff/Work/workspace/media/build/msdk/__cmake/intel64.make.release/samples/sample_hevc_fei && /usr/bin/c++  -DLINUX -DLINUX32 -DLINUX64 -DLINUX_TARGET_PLATFORM -DLINUX_TARGET_PLATFORM_BDW -DMFX_FILE_VERSION=\"0.18.1.26\" -DMFX_PRODUCT_VERSION=\"0.0.000.0000\" -DMSDK_BUILD=\"\" -DUNIX -D_FILE_OFFSET_BITS=64 -D__USE_LARGEFILE64 -I/home/uaeoff/Work/workspace/media/build/msdk/api/mediasdk_structures -I/home/uaeoff/Work/workspace/media/build/msdk/api/include -I/home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/../sample_common/include -I/home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/include  -msse4.2 -std=c++11 -m64 -g -pipe -fPIC -O2 -D_FORTIFY_SOURCE=2 -fstack-protector -Wall -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-unused  -Wformat -Wformat-security -DNDEBUG   -I/usr/include/libdrm -I/home/uaeoff/Work/workspace/media/install/include -I/home/uaeoff/Work/workspace/media/install/include -I/home/uaeoff/Work/workspace/media/install/include  -DMFX_VA -DLIBVA_SUPPORT -DLIBVA_DRM_SUPPORT -DLIBVA_X11_SUPPORT   -I/home/uaeoff/Work/workspace/media/install/include -I/usr/include/libdrm   -DLIBVA_SUPPORT -DLIBVA_DRM_SUPPORT -DLIBVA_X11_SUPPORT   -Werror  -o CMakeFiles/sample_hevc_fei.dir/src/pipeline_hevc_fei.cpp.o -c /home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/src/pipeline_hevc_fei.cpp
/home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/src/pipeline_hevc_fei.cpp: In member function ‘void CEncodingPipeline::PrintInfo()’:
/home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/src/pipeline_hevc_fei.cpp:122:6: error: ‘__builtin___snprintf_chk’ output may be truncated before the last format character [-Werror=format-truncation=]
 void CEncodingPipeline::PrintInfo()
      ^~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:862:0,
                 from /usr/include/c++/7/cstdio:42,
                 from /usr/include/c++/7/ext/string_conversions.h:43,
                 from /usr/include/c++/7/bits/basic_string.h:6347,
                 from /usr/include/c++/7/string:52,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/../sample_common/include/sample_defs.h:24,
                 from /home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/include/sample_hevc_fei_defs.h:24,
                 from /home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/include/pipeline_hevc_fei.h:22,
                 from /home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/src/pipeline_hevc_fei.cpp:20:
/usr/include/bits/stdio2.h:65:44: note: ‘__builtin___snprintf_chk’ output between 2 and 6 bytes into a destination of size 5
        __bos (__s), __fmt, __va_arg_pack ());
                                            ^
cc1plus: all warnings being treated as errors
make[2]: *** [samples/sample_hevc_fei/CMakeFiles/sample_hevc_fei.dir/build.make:186: samples/sample_hevc_fei/CMakeFiles/sample_hevc_fei.dir/src/pipeline_hevc_fei.cpp.o] Error 1
make[2]: Leaving directory '/home/uaeoff/Work/workspace/media/build/msdk/__cmake/intel64.make.release'
make[1]: *** [CMakeFiles/Makefile2:1959: samples/sample_hevc_fei/CMakeFiles/sample_hevc_fei.dir/all] Error 2
make[1]: Leaving directory '/home/uaeoff/Work/workspace/media/build/msdk/__cmake/intel64.make.release'
make: *** [Makefile:133: all] Error 2
make: Leaving directory '/home/uaeoff/Work/workspace/media/build/msdk/__cmake/intel64.make.release'

The samples/sample_hevc_fei/CMakeLists.txt file hard-codes -Werror in compiler flags. Instead of hard-coding, we should let WARNING_FLAGS determine whether to use -Werror or not.

compile error: call of overloaded ‘abs(unsigned int)’ is ambiguous

After applying fix for #49, still getting compilation errors in sample_hevc_fei.

Compiler version is GCC 7.2.1.
Configure command is perl tools/builder/build_mfx.pl --no-warn-as-error --prefix=$HOME/Work/workspace/media/install --cmake=intel64.make.release

[ 95%] Building CXX object samples/sample_hevc_fei/CMakeFiles/sample_hevc_fei.dir/src/ref_list_manager.cpp.o
cd /home/uaeoff/Work/workspace/media/build/msdk/__cmake/intel64.make.release/samples/sample_hevc_fei && /usr/bin/c++  -DLINUX -DLINUX32 -DLINUX64 -DLINUX_TARGET_PLATFORM -DLINUX_TARGET_PLATFORM_BDW -DMFX_FILE_VERSION=\"0.18.1.26\" -DMFX_PRODUCT_VERSION=\"0.0.000.0000\" -DMSDK_BUILD=\"\" -DUNIX -D_FILE_OFFSET_BITS=64 -D__USE_LARGEFILE64 -I/home/uaeoff/Work/workspace/media/build/msdk/api/mediasdk_structures -I/home/uaeoff/Work/workspace/media/build/msdk/api/include -I/home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/../sample_common/include -I/home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/include  -msse4.2 -std=c++11 -m64 -g -pipe -fPIC -O2 -D_FORTIFY_SOURCE=2 -fstack-protector -Wall -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-unused  -Wformat -Wformat-security -DNDEBUG   -I/usr/include/libdrm -I/home/uaeoff/Work/workspace/media/install/include -I/home/uaeoff/Work/workspace/media/install/include -I/home/uaeoff/Work/workspace/media/install/include  -DMFX_VA -DLIBVA_SUPPORT -DLIBVA_DRM_SUPPORT -DLIBVA_X11_SUPPORT   -I/home/uaeoff/Work/workspace/media/install/include -I/usr/include/libdrm   -DLIBVA_SUPPORT -DLIBVA_DRM_SUPPORT -DLIBVA_X11_SUPPORT    -o CMakeFiles/sample_hevc_fei.dir/src/ref_list_manager.cpp.o -c /home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/src/ref_list_manager.cpp
/home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/src/ref_list_manager.cpp: In member function ‘bool HevcRplUtils::PocDistanceIsLess::operator()(size_t, size_t) const’:
/home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/src/ref_list_manager.cpp:51:49: error: call of overloaded 'abs(unsigned int)' is ambiguous
                 (std::abs(m_dpb[l].m_poc - m_poc)) <
                                                 ^
In file included from /usr/include/c++/7/cstdlib:77:0,
                 from /home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/src/ref_list_manager.cpp:20:
/usr/include/c++/7/bits/std_abs.h:78:3: note: candidate: constexpr long double std::abs(long double)
   abs(long double __x)
   ^~~
/usr/include/c++/7/bits/std_abs.h:74:3: note: candidate: constexpr float std::abs(float)
   abs(float __x)
   ^~~
/usr/include/c++/7/bits/std_abs.h:70:3: note: candidate: constexpr double std::abs(double)
   abs(double __x)
   ^~~
/usr/include/c++/7/bits/std_abs.h:61:3: note: candidate: long long int std::abs(long long int)
   abs(long long __x) { return __builtin_llabs (__x); }
   ^~~
/usr/include/c++/7/bits/std_abs.h:56:3: note: candidate: long int std::abs(long int)
   abs(long __i) { return __builtin_labs(__i); }
   ^~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/src/ref_list_manager.cpp:20:
/usr/include/stdlib.h:722:12: note: candidate: int abs(int)
 extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
            ^~~
/home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/src/ref_list_manager.cpp:52:49: error: call of overloaded 'abs(unsigned int)' is ambiguous
                 (std::abs(m_dpb[r].m_poc - m_poc));
                                                 ^
In file included from /usr/include/c++/7/cstdlib:77:0,
                 from /home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/src/ref_list_manager.cpp:20:
/usr/include/c++/7/bits/std_abs.h:78:3: note: candidate: constexpr long double std::abs(long double)
   abs(long double __x)
   ^~~
/usr/include/c++/7/bits/std_abs.h:74:3: note: candidate: constexpr float std::abs(float)
   abs(float __x)
   ^~~
/usr/include/c++/7/bits/std_abs.h:70:3: note: candidate: constexpr double std::abs(double)
   abs(double __x)
   ^~~
/usr/include/c++/7/bits/std_abs.h:61:3: note: candidate: long long int std::abs(long long int)
   abs(long long __x) { return __builtin_llabs (__x); }
   ^~~
/usr/include/c++/7/bits/std_abs.h:56:3: note: candidate: long int std::abs(long int)
   abs(long __i) { return __builtin_labs(__i); }
   ^~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/src/ref_list_manager.cpp:20:
/usr/include/stdlib.h:722:12: note: candidate: int abs(int)
 extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
            ^~~
/home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/src/ref_list_manager.cpp: In member function ‘bool HevcRplUtils::PocDistanceIsGreater::operator()(size_t, size_t) const’:
/home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/src/ref_list_manager.cpp:68:49: error: call of overloaded ‘abs(unsigned int)’ is ambiguous
                 (std::abs(m_dpb[l].m_poc - m_poc)) >
                                                 ^
In file included from /usr/include/c++/7/cstdlib:77:0,
                 from /home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/src/ref_list_manager.cpp:20:
/usr/include/c++/7/bits/std_abs.h:78:3: note: candidate: constexpr long double std::abs(long double)
   abs(long double __x)
   ^~~
/usr/include/c++/7/bits/std_abs.h:74:3: note: candidate: constexpr float std::abs(float)
   abs(float __x)
   ^~~
/usr/include/c++/7/bits/std_abs.h:70:3: note: candidate: constexpr double std::abs(double)
   abs(double __x)
   ^~~
/usr/include/c++/7/bits/std_abs.h:61:3: note: candidate: long long int std::abs(long long int)
   abs(long long __x) { return __builtin_llabs (__x); }
   ^~~
/usr/include/c++/7/bits/std_abs.h:56:3: note: candidate: long int std::abs(long int)
   abs(long __i) { return __builtin_labs(__i); }
   ^~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/src/ref_list_manager.cpp:20:
/usr/include/stdlib.h:722:12: note: candidate: int abs(int)
 extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
            ^~~
/home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/src/ref_list_manager.cpp:69:49: error: call of overloaded 'abs(unsigned int)' is ambiguous
                 (std::abs(m_dpb[r].m_poc - m_poc));
                                                 ^
In file included from /usr/include/c++/7/cstdlib:77:0,
                 from /home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/src/ref_list_manager.cpp:20:
/usr/include/c++/7/bits/std_abs.h:78:3: note: candidate: constexpr long double std::abs(long double)
   abs(long double __x)
   ^~~
/usr/include/c++/7/bits/std_abs.h:74:3: note: candidate: constexpr float std::abs(float)
   abs(float __x)
   ^~~
/usr/include/c++/7/bits/std_abs.h:70:3: note: candidate: constexpr double std::abs(double)
   abs(double __x)
   ^~~
/usr/include/c++/7/bits/std_abs.h:61:3: note: candidate: long long int std::abs(long long int)
   abs(long long __x) { return __builtin_llabs (__x); }
   ^~~
/usr/include/c++/7/bits/std_abs.h:56:3: note: candidate: long int std::abs(long int)
   abs(long __i) { return __builtin_labs(__i); }
   ^~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /home/uaeoff/Work/workspace/media/build/msdk/samples/sample_hevc_fei/src/ref_list_manager.cpp:20:
/usr/include/stdlib.h:722:12: note: candidate: int abs(int)
 extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
            ^~~
make[2]: *** [samples/sample_hevc_fei/CMakeFiles/sample_hevc_fei.dir/build.make:210: samples/sample_hevc_fei/CMakeFiles/sample_hevc_fei.dir/src/ref_list_manager.cpp.o] Error 1
make[2]: Leaving directory '/home/uaeoff/Work/workspace/media/build/msdk/__cmake/intel64.make.release'
make[1]: *** [CMakeFiles/Makefile2:1959: samples/sample_hevc_fei/CMakeFiles/sample_hevc_fei.dir/all] Error 2
make[1]: Leaving directory '/home/uaeoff/Work/workspace/media/build/msdk/__cmake/intel64.make.release'
make: *** [Makefile:133: all] Error 2
make: Leaving directory '/home/uaeoff/Work/workspace/media/build/msdk/__cmake/intel64.make.release'

Add support for h264 Frame Packing Arrangement SEI in encoder

This allows to provide metadata about stereoscopic streams, e.g. if they're left-right, top-bottom, row-interleaved or whatever else.

While this can be implemented at the layer on top of MediaSDK too, the correct place for this would be in the MediaSDK as it's part of the h264 bitstream.

Note: This is independent of h264 MVC, it's just some metadata and the frames are encoded normally.

See https://bugzilla.gnome.org/show_bug.cgi?id=774920 for a downstream request of support being added.

[help wanted] Errors while running sample_decode

Hi,
I have build the application in Ubuntu 16.04 after removing -Werror flag (it caused deprecated auto_ptr error).
Now when I run __cmake/intel64.make.release/__bin/release/sample_decode, I get this error:
[ERROR], sts=MFX_ERR_NOT_FOUND(-9), Init, m_mfxSession.Init failed at msdk/samples/sample_decode/src/pipeline_decode.cpp:285
After checking the code i understood that there are no libraries in /opt/intel
How do I install these libraries?

The second method that i tried was by patching the kernel in Ubuntu 16.04 as given in:
http://docs.unified-streaming.com/documentation/capture/media-sdk.html

But when I tried to build the sample application in MediaSamples_Linux_2017R2.tar.gz, I got:
CMake Error at /usr/share/cmake-3.5/Modules/FindPkgConfig.cmake:367 (message):
A required package was not found

Can you please tell me where the mistakes are in both the methods?

Request: remove the need of va_ext.h (from proprietary Media Server Studio) for building

Currently, MediaSDK needs CL/va_ext.h in order to build (details here).

As far as I could gather, this header file is provided only by the proprietary Media Server Studio (MSS). It means that MSS is still needed for building.

Since MediaSDK is opensource, it would be good if there was a way to completely remove the necessity of dealing with the proprietary MSS, specially now that proprietary libva from MSS is not needed any more. Also, MSS is a huge download for just a single header file.

Can this be implemented? Thanks.

Feature request: Remove dependency on proprietary libVA fork

According to the readme:
"Intel Media SDK depends on a special version of LibVA which comes with Intel Media Server Studio installation and is not in upstream, so this version is not compatible with the LibVA/driver available at 01org."

So building this open source project is not yet possible with a purely open source environment (public upstream VA-API). It would be very helpful to desktop Linux distributions if future versions of MSDK could build without any proprietary downloads from intel.com. Just depend on upstream libVA, at least as an option.

Open-source Intel Media SDK stack doesn't work with Apollo Lake platform Intel Celeron J3455

I built and installed Intel Media SDK (MSDK) on an Intel Celeron J3455 system (https://ark.intel.com/products/95594/Intel-Celeron-Processor-J3455-2M-Cache-up-to-2_3-GHz) which is based on the Apollo Lake platform. I followed the build instructions according to the following link:

https://software.intel.com/en-us/articles/build-and-debug-open-source-media-stack

When building and testing the Intel media driver, everything looks fine.

ishmael@ishmael-desktop /opt/intel/mediasdk/samples $ vainfo
libva info: VA-API version 1.0.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_0
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.0 (libva 2.0.1.pre1)
vainfo: Driver version: Intel iHD driver - 2.0.0
vainfo: Supported profile and entrypoints
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileNone                   :	VAEntrypointStats
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointFEI
      VAProfileH264Main               :	VAEntrypointEncSliceLP
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointFEI
      VAProfileH264High               :	VAEntrypointEncSliceLP
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointFEI
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointFEI
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointVLD

However, after installing the open-source stack and testing with the sample_decode application I get the following:

ishmael@ishmael-desktop /opt/intel/mediasdk/samples $ ./sample_decode h264 -i /home/ishmael/Videos/bbb.h264

[ERROR], sts=MFX_ERR_UNSUPPORTED(-3), Init, m_mfxSession.Init failed at /home/ishmael/msdk/MediaSDK/samples/sample_decode/src/pipeline_decode.cpp:293

[ERROR], sts=MFX_ERR_UNSUPPORTED(-3), main, Pipeline.Init failed at /home/ishmael/msdk/MediaSDK/samples/sample_decode/src/sample_decode.cpp:674

I made sure that the I built the open-source MSDK stack by specifying --target=BXT in the Perl build command as specified by the guide given on the link I provided. I am using the 4.14.16 Linux kernel version with the BXT firmware included as recommended by the mentioned guide. I am providing the processor details as follows:

ishmael@ishmael-desktop /opt/intel/mediasdk/samples $ cat /proc/cpuinfo processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 92
model name	: Intel(R) Celeron(R) CPU J3455 @ 1.50GHz
stepping	: 9
microcode	: 0x20
cpu MHz		: 1390.211
cache size	: 1024 KB
physical id	: 0
siblings	: 4
core id		: 0
cpu cores	: 4
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 21
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch cpuid_fault cat_l2 pti retpoline tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdt_a rdseed smap clflushopt intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts
bugs		: monitor cpu_meltdown spectre_v1 spectre_v2
bogomips	: 2995.20
clflush size	: 64
cache_alignment	: 64
address sizes	: 39 bits physical, 48 bits virtual
power management:

processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 92
model name	: Intel(R) Celeron(R) CPU J3455 @ 1.50GHz
stepping	: 9
microcode	: 0x20
cpu MHz		: 1299.581
cache size	: 1024 KB
physical id	: 0
siblings	: 4
core id		: 1
cpu cores	: 4
apicid		: 2
initial apicid	: 2
fpu		: yes
fpu_exception	: yes
cpuid level	: 21
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch cpuid_fault cat_l2 pti retpoline tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdt_a rdseed smap clflushopt intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts
bugs		: monitor cpu_meltdown spectre_v1 spectre_v2
bogomips	: 2995.20
clflush size	: 64
cache_alignment	: 64
address sizes	: 39 bits physical, 48 bits virtual
power management:

processor	: 2
vendor_id	: GenuineIntel
cpu family	: 6
model		: 92
model name	: Intel(R) Celeron(R) CPU J3455 @ 1.50GHz
stepping	: 9
microcode	: 0x20
cpu MHz		: 1356.676
cache size	: 1024 KB
physical id	: 0
siblings	: 4
core id		: 2
cpu cores	: 4
apicid		: 4
initial apicid	: 4
fpu		: yes
fpu_exception	: yes
cpuid level	: 21
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch cpuid_fault cat_l2 pti retpoline tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdt_a rdseed smap clflushopt intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts
bugs		: monitor cpu_meltdown spectre_v1 spectre_v2
bogomips	: 2995.20
clflush size	: 64
cache_alignment	: 64
address sizes	: 39 bits physical, 48 bits virtual
power management:

processor	: 3
vendor_id	: GenuineIntel
cpu family	: 6
model		: 92
model name	: Intel(R) Celeron(R) CPU J3455 @ 1.50GHz
stepping	: 9
microcode	: 0x20
cpu MHz		: 1425.584
cache size	: 1024 KB
physical id	: 0
siblings	: 4
core id		: 3
cpu cores	: 4
apicid		: 6
initial apicid	: 6
fpu		: yes
fpu_exception	: yes
cpuid level	: 21
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch cpuid_fault cat_l2 pti retpoline tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdt_a rdseed smap clflushopt intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts
bugs		: monitor cpu_meltdown spectre_v1 spectre_v2
bogomips	: 2995.20
clflush size	: 64
cache_alignment	: 64
address sizes	: 39 bits physical, 48 bits virtual
power management:

The system configuration is based from this product:

https://www.amazon.com/Compact-Channel-Bluetooth-Pre-Assembled-ITX/dp/B0755KPNYR

I tried the latest media driver, libva, gmmlib versions from the master branch, as well as the specific commits as given by the guide, and all give the same result as described. What did I miss?

Decoder render failed

Both H264/H265 sample_decode render failed, but output to yuv file is ok.

machine:

Linux ubuntu 4.10.0-28-generic #32~16.04.2-Ubuntu SMP Thu Jul 20 10:19:48 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
intel i7 6700

Output:

Decoding started
Frame number:    0, fps: 0.000, fread_fps: 0.000, fwrite_fps: 0.000
DeliverOutput return error = -1
Frame number:    1, fps: 0.527, fread_fps: 0.000, fwrite_fps: 1526.718

After debug, I have fould render frame return 18(invalid params)

Maybe API changed?

dec/enc failed on centos 7

Hi,
I try to build msdk and run samples on CentOS 7, encode sample and decode sample both failed:

  • encode failed
    `sample_encode h264 -i ~/assassin_st4_1080p30fps.flv.yuv -o out.264 -w 1920 -h 1080 -hw
    [ERROR], sts=MFX_ERR_UNSUPPORTED(-3), Init, m_mfxSession.InitEx failed at /home/web_server/weiyabo/msdk/samples/sample_encode/src/pipeline_encode.cpp:1242

[ERROR], sts=MFX_ERR_UNSUPPORTED(-3), main, pPipeline->Init failed at /home/web_server/weiyabo/msdk/samples/sample_encode/src/sample_encode.cpp:1174`

  • decode failed
    `sample_decode h264 -i ~/assassin_st4_1080p30fps.264 -hw
    [ERROR], sts=MFX_ERR_UNSUPPORTED(-3), Init, m_mfxSession.Init failed at /home/web_server/weiyabo/msdk/samples/sample_decode/src/pipeline_decode.cpp:293

[ERROR], sts=MFX_ERR_UNSUPPORTED(-3), main, Pipeline.Init failed at /home/web_server/weiyabo/msdk/samples/sample_decode/src/sample_decode.cpp:667`

environment:
CPU:E3-1585 v5
OS:CentOS 7.4
kernel:upgrade to 4.15.7-1.el7.elrepo.x86_64

VPP + VPP composite generates stuttering output video

My setup:
In->(Decode->VPP)->(VPPcomp)->Out

(Decode->VPP) is running in one session and (VPPcomp) is running in another joined session. VPP uses the normal filters, as resizing, and VPPcomp composites the VPP output and an OSD input. The output is furthermore rendered to HDMI.

Issue:
Using the above setup makes the output video stutter. An output surface of VPPcomp is expected to only depend on the current input surface(s), i.e. the current VPPcomp input surface and the OSD surface. However this doesn't seem to be the case. It seems like the VPPcomp output depends on other surfaces from the VPPComp input surface pool. The effect is that the output regularly displays an old frame that is stored somewhere in the surface pool, making the video stutter.

I have not found a good work around for this. Trying to sync between VPP and VPPcomp didn't help.

Additional info:
Video memory is used through vaapi.
Tested on Apollolake with embedded Linux and Intel Media SDK version 1.24
The frames are processed asynchronously with sync at last step.
More info about the issue can be found here:

https://software.intel.com/en-us/forums/intel-media-sdk/topic/562583

https://software.intel.com/en-us/forums/intel-media-sdk/topic/734639

[Clarification] Supported input / output combinations for VPP colorspace conversion

YUY2 output format support using VPP CSC (colorspace conversion) works on Intel media drivers (Windows and Linux) which I tested to comply with MSDK version 1.22+, but this support is not very well documented in the manual. The MSDK reference manual clearly specifies that NV12 and RGB32 output formats are only supported for color space conversion. I believe the manual needs to be updated to reflect the new YUY2 output format support, and any other supported input / output CSC combinations.
So for now, I would like to ask until such information is documented: what is the minimum MSDK version support that should be advertised by the media driver to know for sure that YUY2 output format is definitely supported for CSC?

sample_decode failed when decoding hevc clips.

H264 decoder can work well, but hevc failed seems it can't find the plugin.

To reproduce: sample_decode h265 -i ~/fate-suite/hevc-conformance/MVEDGE_A_qualcomm_3.bit -o test.yuv

plugin_loader.h :168 [ERROR] Failed to load plugin from GUID, sts=-9: { 0x33, 0xa6, 0x1c, 0x0b, 0x4c, 0x27, 0x45, 0x4c, 0xa8, 0xd8, 0x5d, 0xde, 0x75, 0x7c, 0x6f, 0x8e } (Intel (R) Media SDK HW plugin for HEVC DECODE)
Default plugin cannot be loaded (possibly you have to define plugin explicitly)

[ERROR], sts=MFX_ERR_UNSUPPORTED(-3), Init, Plugin load failed at /root/lizhong/opensource/MediaSDK/samples/sample_decode/src/pipeline_decode.cpp:379

[ERROR], sts=MFX_ERR_UNSUPPORTED(-3), main, Pipeline.Init failed at /root/lizhong/opensource/MediaSDK/samples/sample_decode/src/sample_decode.cpp:661

build fails with g++ 7.2/7.3 when using the default options

The code fails to build with g++ 7.2/7.3 when using the default options

/MediaSDK/api/opensource/mfx_dispatch/src/main.cpp: In function ‘mfxStatus disp_MFXVideoUSER_Load(mfxSession, const mfxPluginUID*, mfxU32)’:
/MediaSDK/api/opensource/mfx_dispatch/src/main.cpp:563:11: error: the compiler can assume that the address of ‘pHandle’ will never be NULL [-Werror=address]
if (!&pHandle)
^~~~~~~

User may work around this issue by using --no-warn-as-error

About 25% slower than windows

CPU: i7 6700

command:
sample_multi_transcode -i::h264 a.h264 -o::h264 b.h264
Ubuntu16.04.3 X64
*** session 0 PASSED (MFX_ERR_NONE) 554.268 sec, 92583 frames
Win7 X64
*** session 0 PASSED (MFX_ERR_NONE) 450.646 sec, 92583 frames

Should I change some parameters?

Compile error: undefined reference to __cpu_model

Linking fails with both release and debug compilation...

Configure/Compile:

perl tools/builder/build_mfx.pl --no-warn-as-error --cmake=intel64.make.debug
make -C __cmake/intel64.make.debug

Output:

I am going to execute:
  cmake --no-warn-unused-cli -Wno-dev -G "Unix Makefiles" -D__GENERATOR:STRING=make -DCMAKE_CONFIGURATION_TYPES:STRING="release;debug" -DCMAKE_BUILD_TYPE:STRING=debug -D__ARCH:STRING=intel64 -D__CONFIG:STRING=debug -D__IPP:STRING=e9 -D__TARGET_PLATFORM:STRING=BDW /home/uaeoff/Work/workspace/media/src/msdk
[ cmd ]: cmake --no-warn-unused-cli -Wno-dev -G "Unix Makefiles" -D__GENERATOR:STRING=make -DCMAKE_CONFIGURATION_TYPES:STRING="release;debug" -DCMAKE_BUILD_TYPE:STRING=debug -D__ARCH:STRING=intel64 -D__CONFIG:STRING=debug -D__IPP:STRING=e9 -D__TARGET_PLATFORM:STRING=BDW /home/uaeoff/Work/workspace/media/src/msdk
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 7.2.1
-- The CXX compiler identification is GNU 7.2.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- OpenCL was found here: /usr/lib64 and /usr/include
-- CMAKE_INSTALL_PREFIX=/opt/intel/mediasdk
-- Intel(R) Media SDK was found here /home/uaeoff/Work/workspace/media/src/msdk
-- Enabling API 1.25 feature set with flags 
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.3.12") 
-- Checking for module 'libva>=0.33'
--   Found libva, version 1.0.0
-- Checking for module 'libdrm'
--   Found libdrm, version 2.4.89
-- Checking for module 'libva-drm>=0.33'
--   Found libva-drm, version 1.0.0
-- Checking for module 'x11'
--   Found x11, version 1.6.5
-- Checking for module 'libva-x11>=0.33'
--   Found libva-x11, version 1.0.0
-- Global Configuration of Targets
-- Target Architecture to compile: sse4.2
-- CMAKE_INSTALL_PREFIX=/opt/intel/mediasdk
-- MFX_PLUGINS_DIR=/opt/intel/mediasdk/plugins
-- MFX_MODULES_DIR=/opt/intel/mediasdk/lib64
-- OpenCL was found here: /usr/lib64 and /usr/include
-- Configuring done
-- Generating done
-- Build files have been written to: /home/uaeoff/Work/workspace/media/src/msdk/__cmake/intel64.make.debug

...

[ 66%] Linking CXX shared library ../../__bin/debug/libmfxhw64_d.so
cd /home/uaeoff/Work/workspace/media/src/msdk/__cmake/intel64.make.debug/_studio/mfx_lib && /usr/bin/cmake -E cmake_link_script CMakeFiles/mfxhw64_d.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -msse4.2 -std=c++11 -m64 -g -pipe -fPIC -O0 -Wall -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-unused  -Wformat -Wformat-security -g -D_DEBUG -L/home/uaeoff/Work/workspace/media/install/lib -Wl,--no-undefined,-z,relro,-z,now,-z,noexecstack -Wl,--default-symver -Wl,--version-script=/home/uaeoff/Work/workspace/media/src/msdk/_studio/mfx_lib/libmfx.map -fstack-protector   -Wl,--no-undefined,-z,relro,-z,now,-z,noexecstack -fstack-protector  -L/home/uaeoff/Work/workspace/media/install/lib -shared -Wl,-soname,libmfxhw64_d.so -o ../../__bin/debug/libmfxhw64_d.so CMakeFiles/mfxhw64_d.dir/scheduler/src/mfx_scheduler_core.cpp.o CMakeFiles/mfxhw64_d.dir/scheduler/src/mfx_scheduler_core_ischeduler.cpp.o CMakeFiles/mfxhw64_d.dir/scheduler/src/mfx_scheduler_core_iunknown.cpp.o CMakeFiles/mfxhw64_d.dir/scheduler/src/mfx_scheduler_core_task.cpp.o CMakeFiles/mfxhw64_d.dir/scheduler/src/mfx_scheduler_core_task_management.cpp.o CMakeFiles/mfxhw64_d.dir/scheduler/src/mfx_scheduler_core_thread.cpp.o CMakeFiles/mfxhw64_d.dir/shared/src/libmfxsw.cpp.o CMakeFiles/mfxhw64_d.dir/shared/src/libmfxsw_async.cpp.o CMakeFiles/mfxhw64_d.dir/shared/src/libmfxsw_decode.cpp.o CMakeFiles/mfxhw64_d.dir/shared/src/libmfxsw_enc.cpp.o CMakeFiles/mfxhw64_d.dir/shared/src/libmfxsw_encode.cpp.o CMakeFiles/mfxhw64_d.dir/shared/src/libmfxsw_pak.cpp.o CMakeFiles/mfxhw64_d.dir/shared/src/libmfxsw_plugin.cpp.o CMakeFiles/mfxhw64_d.dir/shared/src/libmfxsw_query.cpp.o CMakeFiles/mfxhw64_d.dir/shared/src/libmfxsw_session.cpp.o CMakeFiles/mfxhw64_d.dir/shared/src/libmfxsw_vpp.cpp.o CMakeFiles/mfxhw64_d.dir/shared/src/mfx_session.cpp.o CMakeFiles/mfxhw64_d.dir/shared/src/mfx_user_plugin.cpp.o CMakeFiles/mfxhw64_d.dir/shared/src/mfx_brc_common.cpp.o CMakeFiles/mfxhw64_d.dir/shared/src/mfx_mpeg2_dec_common.cpp.o CMakeFiles/mfxhw64_d.dir/shared/src/mfx_vc1_dec_common.cpp.o CMakeFiles/mfxhw64_d.dir/__/shared/src/cm_mem_copy.cpp.o CMakeFiles/mfxhw64_d.dir/__/shared/src/mfx_vpp_vaapi.cpp.o CMakeFiles/mfxhw64_d.dir/__/shared/src/libmfx_allocator.cpp.o CMakeFiles/mfxhw64_d.dir/__/shared/src/libmfx_allocator_vaapi.cpp.o CMakeFiles/mfxhw64_d.dir/__/shared/src/libmfx_core.cpp.o CMakeFiles/mfxhw64_d.dir/__/shared/src/libmfx_core_factory.cpp.o CMakeFiles/mfxhw64_d.dir/__/shared/src/libmfx_core_vaapi.cpp.o CMakeFiles/mfxhw64_d.dir/__/shared/src/mfx_umc_alloc_wrapper.cpp.o CMakeFiles/mfxhw64_d.dir/__/shared/src/mfx_static_assert_structs.cpp.o CMakeFiles/mfxhw64_d.dir/__/shared/src/mfx_mfe_adapter.cpp.o -Xlinker --start-group ../../__lib/debug/libmfx_trace_hw.a ../../__lib/debug/libbitrate_control.a ../../__lib/debug/libh264_dec_hw.a ../../__lib/debug/libjpeg_common.a ../../__lib/debug/libjpeg_dec_hw.a ../../__lib/debug/libmpeg2_dec_hw.a ../../__lib/debug/libumc.a ../../__lib/debug/libvm.a ../../__lib/debug/libvm_plus.a ../../__lib/debug/libumc_va_hw.a ../../__lib/debug/libcmrt_cross_platform_hw.a ../../__lib/debug/libdecode_hw.a ../../__lib/debug/libencode_hw.a ../../__lib/debug/libh264_la.a ../../__lib/debug/libgenx_h264_encode_embeded.a ../../__lib/debug/libmfx_common.a ../../__lib/debug/libmfx_common_hw.a ../../__lib/debug/libvpp_hw.a ../../__lib/debug/libh264_common.a ../../__lib/debug/libh264_preenc.a ../../__lib/debug/libh264_enc.a ../../__lib/debug/libh264_pak.a ../../__lib/debug/libvc1_common.a ../../__lib/debug/libvc1_dec_hw.a ../../__lib/debug/libmfx_trace.a -lpthread -ldl -lva ../../__lib/debug/libSafeString.a -Xlinker --end-group 
../../__lib/debug/libencode_hw.a(mfx_h264_scd.cpp.o): In function `MfxHwH264Encode::CpuFeature_SSE41()':
/home/uaeoff/Work/workspace/media/src/msdk/_studio/mfx_lib/encode_hw/h264/src/mfx_h264_scd.cpp:578: undefined reference to `__cpu_model'
../../__lib/debug/libencode_hw.a(mfx_h264_scd.cpp.o): In function `MfxHwH264Encode::CpuFeature_AVX2()':
/home/uaeoff/Work/workspace/media/src/msdk/_studio/mfx_lib/encode_hw/h264/src/mfx_h264_scd.cpp:582: undefined reference to `__cpu_model'
../../__lib/debug/libvpp_hw.a(mfx_scd.cpp.o): In function `SceneChangeDetector::Init(int, int, int, unsigned int, CmDevice*)':
/home/uaeoff/Work/workspace/media/src/msdk/_studio/shared/src/mfx_scd.cpp:12008: undefined reference to `__cpu_model'
collect2: error: ld returned 1 exit status
make[2]: *** [_studio/mfx_lib/CMakeFiles/mfxhw64_d.dir/build.make:904: __bin/debug/libmfxhw64_d.so] Error 1
make[2]: Leaving directory '/home/uaeoff/Work/workspace/media/src/msdk/__cmake/intel64.make.debug'
make[1]: *** [CMakeFiles/Makefile2:519: _studio/mfx_lib/CMakeFiles/mfxhw64_d.dir/all] Error 2
make[1]: Leaving directory '/home/uaeoff/Work/workspace/media/src/msdk/__cmake/intel64.make.debug'
make: *** [Makefile:133: all] Error 2
make: Leaving directory '/home/uaeoff/Work/workspace/media/src/msdk/__cmake/intel64.make.debug'

Environment:

libva (master) heads/master-0-gfbed1dbb5bfc 
gmmlib (master) heads/master-0-g0154744f9c2d
intel-media-driver (master) heads/master-0-g87b133062dee
msdk (master) heads/master-0-gfce107957ad4

gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)

SKL Intel(R) Core(TM) i7-6770HQ CPU @ 2.60GHz

MFX_ERR_INVALID_VIDEO_PARAM handling

it actually would be good to have an implementation sample for handling of MFX_ERR_INVALID_VIDEO_PARAM
via compare options been marked off and report this out.

H264 encoder crash

H264 decoder, H265 encoder/decoder work well, only H264 encoder crash.


machine:

Linux ubuntu 4.10.0-28-generic #32~16.04.2-Ubuntu SMP Thu Jul 20 10:19:48 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
intel i7 6700

below is the call stack:

Starting program: /opt/intel/mediasdk/samples/sample_encode h264 -nv12 -i a.yuv -o b.h264 -w 1920 -h 1080 -b 2000
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff64f7700 (LWP 7792)]
[New Thread 0x7ffff5cf6700 (LWP 7793)]
[New Thread 0x7ffff54f5700 (LWP 7794)]
[New Thread 0x7ffff4cf4700 (LWP 7795)]
[New Thread 0x7ffff44f3700 (LWP 7796)]
[New Thread 0x7ffff3cf2700 (LWP 7797)]
[New Thread 0x7ffff34f1700 (LWP 7798)]
[New Thread 0x7ffff2cf0700 (LWP 7799)]
libva info: VA-API version 1.0.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /usr/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_0
libva info: va_openDriver() returns 0

Thread 1 "sample_encode" received signal SIGSEGV, Segmentation fault.
0x00007ffff0cf6d33 in GmmLib::GmmResourceInfoCommon::Create (this=this@entry=0x7957d0, CreateParams=...)
    at /home/dev/code/intel/driver/gmmlib/Source/GmmLib/Resource/GmmResourceInfoCommon.cpp:96
96          GET_GMM_CLIENT_TYPE(pClientContext, ClientType);
(gdb) bt
#0  0x00007ffff0cf6d33 in GmmLib::GmmResourceInfoCommon::Create (this=this@entry=0x7957d0, CreateParams=...)
    at /home/dev/code/intel/driver/gmmlib/Source/GmmLib/Resource/GmmResourceInfoCommon.cpp:96
#1  0x00007ffff0cff315 in GmmLib::GmmClientContext::CreateResInfoObject (this=0x3100000004, pCreateParams=pCreateParams@entry=0x7fffffff25e0)
    at /home/dev/code/intel/driver/gmmlib/Source/GmmLib/GlobalInfo/GmmClientContext.cpp:379
#2  0x00007ffff0ce2acc in GraphicsResourceSpecific::Allocate (this=0x7956d0, osContextPtr=0x764380, params=...)
    at /home/dev/code/intel/driver/media-driver/media_driver/linux/common/os/mos_graphicsresource_specific.cpp:209
#3  0x00007ffff0ce508e in Mos_Specific_AllocateResource (pOsInterface=0x7614c0, pParams=0x7fffffff2900, pOsResource=0x7955f0)
    at /home/dev/code/intel/driver/media-driver/media_driver/linux/common/os/mos_os_specific.c:1649
#4  0x00007ffff0b66db1 in Heap::Allocate (this=this@entry=0x7955a0, heapSize=heapSize@entry=532480, keepLocked=<optimized out>)
    at /home/dev/code/intel/driver/media-driver/media_driver/agnostic/common/heap_manager/heap.cpp:89
#5  0x00007ffff0b6a069 in MemoryBlockManager::RegisterHeap (this=this@entry=0x766e30, heapId=<optimized out>, size=size@entry=532480)
    at /home/dev/code/intel/driver/media-driver/media_driver/agnostic/common/heap_manager/memory_block_manager.cpp:238
#6  0x00007ffff0b6732d in HeapManager::AllocateHeap (size=<optimized out>, this=0x766e28)
    at /home/dev/code/intel/driver/media-driver/media_driver/agnostic/common/heap_manager/heap_manager.cpp:192
#7  HeapManager::AcquireSpace (this=this@entry=0x766e28, params=..., blocks=std::vector of length 0, capacity 0, spaceNeeded=@0x7fffffff2a5c: 32767)
    at /home/dev/code/intel/driver/media-driver/media_driver/agnostic/common/heap_manager/heap_manager.cpp:48
#8  0x00007ffff0b71cca in XMHW_STATE_HEAP_INTERFACE::AssignSpaceInStateHeap (bZeroAssignedMem=<optimized out>, bStatic=<optimized out>,
    dwSpaceRequested=<optimized out>, pKernelState=<optimized out>, StateHeapType=<optimized out>, this=<optimized out>)
    at /home/dev/code/intel/driver/media-driver/media_driver/agnostic/common/hw/mhw_state_heap.c:1184
#9  Mhw_StateHeapInterface_AssignSpaceInStateHeap (pCommonStateHeapInterface=<optimized out>, StateHeapType=<optimized out>,
    pKernelState=<optimized out>, dwSpaceRequested=<optimized out>, bStatic=<optimized out>, bZeroAssignedMem=<optimized out>)
    at /home/dev/code/intel/driver/media-driver/media_driver/agnostic/common/hw/mhw_state_heap.c:146
#10 0x00007ffff0ad2aaa in CodechalHwInterface::MhwInitISH (stateHeapInterface=<optimized out>, kernelState=kernelState@entry=0x76ed60)
    at /home/dev/code/intel/driver/media-driver/media_driver/agnostic/common/codec/hal/codechal_hw.cpp:1202
#11 0x00007ffff0b1762d in CodechalEncodeAvcEnc::InitKernelStateMe (this=0x769360)
    at /home/dev/code/intel/driver/media-driver/media_driver/agnostic/common/codec/hal/codechal_encode_avc.cpp:8108
#12 0x00007ffff0b2289c in CodechalEncodeAvcEnc::Initialize (this=0x769360, settings=<optimized out>)
    at /home/dev/code/intel/driver/media-driver/media_driver/agnostic/common/codec/hal/codechal_encode_avc.cpp:1668
#13 0x00007ffff0b138ac in CodechalEncoderState::Allocate (this=0x769360, codecHalSettings=0x752310)
    at /home/dev/code/intel/driver/media-driver/media_driver/agnostic/common/codec/hal/codechal_encoder_base.cpp:483
#14 0x00007ffff0ca024c in DdiEncode_CreateContext (ctx=<optimized out>, config_id=<optimized out>, picture_width=1920,
    picture_height=<optimized out>, flag=<optimized out>, render_targets=0x6f6670, num_render_targets=4, context=0x742988)
    at /home/dev/code/intel/driver/media-driver/media_driver/linux/common/codec/ddi/media_libva_encoder.cpp:352
#15 0x00007ffff64fd262 in vaCreateContext (dpy=0x6cb060, config_id=1032, picture_width=1920, picture_height=1088, flag=flag@entry=1,
    render_targets=0x6f6670, num_render_targets=4, context=0x742988) at va.c:1175
#16 0x00007ffff6851fa7 in MfxHwH264Encode::VAAPIEncoder::CreateAccelerationService (this=0x73aa70, par=...)
    at /home/dev/code/intel/MediaSDK/_studio/mfx_lib/shared/src/mfx_h264_encode_vaapi.cpp:1584
#17 0x00007ffff685011b in MfxHwH264Encode::VAAPIEncoder::Register (this=0x73aa70, response=..., type=842094158)
    at /home/dev/code/intel/MediaSDK/_studio/mfx_lib/shared/src/mfx_h264_encode_vaapi.cpp:1900
#18 0x00007ffff67c3798 in MfxHwH264Encode::ImplementationAvc::Init (this=this@entry=0x723300, par=par@entry=0x6c3d10)
    at /home/dev/code/intel/MediaSDK/_studio/mfx_lib/encode_hw/h264/src/mfx_h264_encode_hw.cpp:947
#19 0x00007ffff67c4a39 in MFXHWVideoENCODEH264::Init (this=0x702780, par=0x6c3d10)
    at /home/dev/code/intel/MediaSDK/_studio/mfx_lib/encode_hw/h264/src/mfx_h264_encode_hw.cpp:193
#20 0x00007ffff673a319 in MFXVideoENCODE_Init (session=0x6c5028, par=0x6c3d10)
    at /home/dev/code/intel/MediaSDK/_studio/mfx_lib/shared/src/libmfxsw_encode.cpp:391
#21 0x000000000042ed91 in MFXVideoENCODE::Init (par=0x6c3d10, this=<optimized out>) at /home/dev/code/intel/MediaSDK/api/include/mfxvideo++.h:81
#22 CEncodingPipeline::ResetMFXComponents (this=0x6c3c80, pParams=0x7fffffffd4f0)
    at /home/dev/code/intel/MediaSDK/samples/sample_encode/src/pipeline_encode.cpp:1601
#23 0x00000000004352a6 in CEncodingPipeline::Init (this=0x6c3c80, pParams=0x7fffffffd4f0)
    at /home/dev/code/intel/MediaSDK/samples/sample_encode/src/pipeline_encode.cpp:1392
#24 0x0000000000418159 in main (argc=<optimized out>, argv=<optimized out>)
    at /home/dev/code/intel/MediaSDK/samples/sample_encode/src/sample_encode.cpp:1173

test result:

python3.5 ted.py --gold
Intel(R) Media SDK Open Source TEst Driver
Copyright (c) Intel Corporation

Setting up test environment...
Disovering tests...
  h265e_func - 2 cases
  vpp_resize - 2 cases
  h264e_func_la - 18 cases
  vpp_denoise - 6 cases
  vpp_fourcc - 4 cases
  h264d_conf - 4 cases
  h264d_to_many - 1 cases
  h264e_func - 12 cases
  vpp_deinterlace - 8 cases
  h265d_conf - 4 cases

Collecting gold results for 10 tests...
  h265e_func
    0001 - ok
    0002 - ok
  vpp_resize
    0001 - ok
    0002 - ok
  h264e_func_la
    0001 - ok
    0002 - FAIL
    0003 - ok
    0004 - FAIL
    0005 - ok
    0006 - FAIL
    0007 - ok
    0008 - FAIL
    0009 - ok
    0010 - FAIL
    0011 - ok
    0012 - FAIL
    0013 - ok
    0014 - FAIL
    0015 - ok
    0016 - FAIL
    0017 - ok
    0018 - FAIL
  vpp_denoise
    0001 - ok
    0002 - ok
    0003 - ok
    0004 - ok
    0005 - ok
    0006 - ok
  vpp_fourcc
    0001 - ok
    0002 - ok
    0003 - ok
    0004 - ok
  h264d_conf
    0001 - FAIL
    0002 - FAIL
    0003 - FAIL
    0004 - FAIL
  h264d_to_many
    0001 - FAIL
  h264e_func
    0001 - ok
    0002 - FAIL
    0003 - ok
    0004 - FAIL
    0005 - ok
    0006 - FAIL
    0007 - ok
    0008 - FAIL
    0009 - ok
    0010 - FAIL
    0011 - ok
    0012 - FAIL
  vpp_deinterlace
    0001 - ok
    0002 - ok
    0003 - ok
    0004 - ok
    0005 - ok
    0006 - ok
    0007 - ok
    0008 - ok
  h265d_conf
    0001 - FAIL
    0002 - FAIL
    0003 - FAIL
    0004 - FAIL

37 of 61 cases passed

Apparently no way to determine if there are GPU resources available for Media SDK applications

Intel provides the Intel Media SDK (MFX / QuickSync) SDK, that allows applications to accelerate H.264 encoding. (This is great!)

However, each Intel GPU provides a limited number of GPU resources (which very depending on which GPU is on the system) that are used to do this, so only a limited number of video files can be encoded in parallel.

Unfortunately Intel does not seem to offer any way to determine how much of the GPU resources are currently being used, so there is no way to know when a server is "fully loaded".

This seems like a pretty major over-sight to me. How do users determine if any more Media SDK applications can be run in parallel???

"Failed to define max_display_attributes" error with FFmpeg

Hi,

I use the latest gits and libva with the recommended tag.
I followed the full compiling procedure and I end up with the following error in ffmpeg:

[AVHWDeviceContext @ 0x22b8860] Cannot open X11 display .
[AVHWDeviceContext @ 0x22b8860] Opened VA display via DRM device /dev/dri/renderD128.
[AVHWDeviceContext @ 0x22b8860] libva: VA-API version 1.0.0
[AVHWDeviceContext @ 0x22b8860] libva: va_getDriverName() returns 0
[AVHWDeviceContext @ 0x22b8860] libva: User requested driver 'iHD'
[AVHWDeviceContext @ 0x22b8860] libva: Trying to open /usr/local/lib/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x22b8860] libva: Found init function __vaDriverInit_1_0
[AVHWDeviceContext @ 0x22b8860] libva: Failed to define max_display_attributes in init
[AVHWDeviceContext @ 0x22b8860] libva: /usr/local/lib/dri/iHD_drv_video.so init failed
[AVHWDeviceContext @ 0x22b8860] libva: va_openDriver() returns -1
[AVHWDeviceContext @ 0x22b8860] Failed to initialise VAAPI connection: -1 (unknown libva error).

Is it a known issue ?

Thanks

Dual GPU system on Ubuntu - Intel and Nvidia

Hi all,
I would like to use Intel Media SDK to decode JPEGs and in same time use Nvidia Cuda for other applications. Is this possible on Linux operating system(Ubuntu 16.04)?
I found info that this SDK supports all HW 5th Generation and higher, please correct me if I'm wrong.
Thank you.

FindOpenCL.cmake will not find the right intel opencl driver

I change the cmake to

find_path( OPENCL_INCLUDE CL/opencl.h PATHS /opt/intel/opencl/include /usr/include NO_DEFAULT_PATH)
find_library( OPENCL_LIBRARY libOpenCL.so PATHS /opt/intel/opencl/ /usr/lib NO_DEFAULT_PATH)

it's ok now. since opencl.h and libopencl.so also exist in /usr folder

compiler error: ‘MFX_EXTBUFF_VPP_COLOR_CONVERSION’ was not declared in this scope

I failed to compile on ubuntu 16.04 with below error:
/home/ocl/projects/MediaSDK/_studio/mfx_lib/vpp/src/mfx_vpp_hw.cpp:4717:26: error: ‘MFX_EXTBUFF_VPP_COLOR_CONVERSION’ was not declared in this scope
else if (MFX_EXTBUFF_VPP_COLOR_CONVERSION == bufferId)
^
/home/ocl/projects/MediaSDK/_studio/mfx_lib/vpp/src/mfx_vpp_hw.cpp:4719:50: error: ‘MFX_CHROMA_SITING_UNKNOWN’ was not declared in this scope
executeParams.chromaSiting = MFX_CHROMA_SITING_UNKNOWN;
^
_studio/mfx_lib/vpp/CMakeFiles/vpp_hw.dir/build.make:89: recipe for target '_studio/mfx_lib/vpp/CMakeFiles/vpp_hw.dir/src/mfx_vpp_hw.cpp.o' failed

How to use Hevc FEI

Hello,
I have a question.
I have installed MediaServerStudioEssentials2017R3 to cpu 6500u Linux.
can i use this MediaSDK hevc fei encoder on it ?

Compiler error: undefined reference to dlopen, dlsym and dlclose

Linking fails on Ubuntu Trusty (14.04 LTS) with gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4

[100%] Linking CXX shared library ../../__bin/release/libmfxhw64.so
cd /opt/media/build/msdk/build/_studio/mfx_lib && /usr/bin/cmake -E cmake_link_script CMakeFiles/mfxhw64.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC -msse4.2 -std=c++11 -m64 -g -pipe -fPIC -O2 -D_FORTIFY_SOURCE=2 -fstack-protector -Wall -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-unused  -Wformat -Wformat-security -DNDEBUG -L/opt/media/install/lib -Wl,--no-undefined,-z,relro,-z,now,-z,noexecstack -Wl,--default-symver -Wl,--version-script=/opt/media/build/msdk/_studio/mfx_lib/libmfx.map -fstack-protector   -Wl,--no-undefined,-z,relro,-z,now,-z,noexecstack -fstack-protector   -L/opt/media/install/lib -shared -Wl,-soname,libmfxhw64.so -o ../../__bin/release/libmfxhw64.so CMakeFiles/mfxhw64.dir/scheduler/src/mfx_scheduler_core_iunknown.cpp.o CMakeFiles/mfxhw64.dir/scheduler/src/mfx_scheduler_core_task.cpp.o CMakeFiles/mfxhw64.dir/scheduler/src/mfx_scheduler_core.cpp.o CMakeFiles/mfxhw64.dir/scheduler/src/mfx_scheduler_core_ischeduler.cpp.o CMakeFiles/mfxhw64.dir/scheduler/src/mfx_scheduler_core_task_management.cpp.o CMakeFiles/mfxhw64.dir/scheduler/src/mfx_scheduler_core_thread.cpp.o CMakeFiles/mfxhw64.dir/shared/src/libmfxsw.cpp.o CMakeFiles/mfxhw64.dir/shared/src/libmfxsw_async.cpp.o CMakeFiles/mfxhw64.dir/shared/src/libmfxsw_decode.cpp.o CMakeFiles/mfxhw64.dir/shared/src/libmfxsw_enc.cpp.o CMakeFiles/mfxhw64.dir/shared/src/libmfxsw_encode.cpp.o CMakeFiles/mfxhw64.dir/shared/src/libmfxsw_pak.cpp.o CMakeFiles/mfxhw64.dir/shared/src/libmfxsw_plugin.cpp.o CMakeFiles/mfxhw64.dir/shared/src/libmfxsw_query.cpp.o CMakeFiles/mfxhw64.dir/shared/src/libmfxsw_session.cpp.o CMakeFiles/mfxhw64.dir/shared/src/libmfxsw_vpp.cpp.o CMakeFiles/mfxhw64.dir/shared/src/mfx_session.cpp.o CMakeFiles/mfxhw64.dir/shared/src/mfx_user_plugin.cpp.o CMakeFiles/mfxhw64.dir/shared/src/mfx_brc_common.cpp.o CMakeFiles/mfxhw64.dir/shared/src/mfx_mpeg2_dec_common.cpp.o CMakeFiles/mfxhw64.dir/shared/src/mfx_vc1_dec_common.cpp.o CMakeFiles/mfxhw64.dir/__/shared/src/cm_mem_copy.cpp.o CMakeFiles/mfxhw64.dir/__/shared/src/mfx_vpp_vaapi.cpp.o CMakeFiles/mfxhw64.dir/__/shared/src/libmfx_allocator.cpp.o CMakeFiles/mfxhw64.dir/__/shared/src/libmfx_allocator_vaapi.cpp.o CMakeFiles/mfxhw64.dir/__/shared/src/libmfx_core.cpp.o CMakeFiles/mfxhw64.dir/__/shared/src/libmfx_core_factory.cpp.o CMakeFiles/mfxhw64.dir/__/shared/src/libmfx_core_vaapi.cpp.o CMakeFiles/mfxhw64.dir/__/shared/src/mfx_umc_alloc_wrapper.cpp.o CMakeFiles/mfxhw64.dir/__/shared/src/mfx_static_assert_structs.cpp.o CMakeFiles/mfxhw64.dir/__/shared/src/mfx_mfe_adapter.cpp.o -Xlinker --start-group ../../__lib/release/libmfx_trace_hw.a ../../__lib/release/libbitrate_control.a ../../__lib/release/libh264_dec_hw.a ../../__lib/release/libjpeg_common.a ../../__lib/release/libjpeg_dec_hw.a ../../__lib/release/libmpeg2_dec_hw.a ../../__lib/release/libumc.a ../../__lib/release/libvm.a ../../__lib/release/libvm_plus.a ../../__lib/release/libumc_va_hw.a ../../__lib/release/libcmrt_cross_platform_hw.a ../../__lib/release/libdecode_hw.a ../../__lib/release/libencode_hw.a ../../__lib/release/libh264_la.a ../../__lib/release/libgenx_h264_encode_embeded.a ../../__lib/release/libmfx_common.a ../../__lib/release/libmfx_common_hw.a ../../__lib/release/libvpp_hw.a ../../__lib/release/libh264_common.a ../../__lib/release/libh264_preenc.a ../../__lib/release/libh264_enc.a ../../__lib/release/libh264_pak.a ../../__lib/release/libvc1_common.a ../../__lib/release/libvc1_dec_hw.a ../../__lib/release/libmfx_trace.a -lpthread -ldl -lva ../../__lib/release/libSafeString.a -Xlinker --end-group
../../__lib/release/libvm.a(vm_shared_object_linux32.c.o): In function `vm_so_load':
/opt/media/build/msdk/_studio/shared/umc/core/vm/src/vm_shared_object_linux32.c:34: undefined reference to `dlopen'
../../__lib/release/libvm.a(vm_shared_object_linux32.c.o): In function `vm_so_get_addr':
/opt/media/build/msdk/_studio/shared/umc/core/vm/src/vm_shared_object_linux32.c:48: undefined reference to `dlsym'
../../__lib/release/libvm.a(vm_shared_object_linux32.c.o): In function `vm_so_free':
/opt/media/build/msdk/_studio/shared/umc/core/vm/src/vm_shared_object_linux32.c:60: undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
make[2]: *** [__bin/release/libmfxhw64.so] Error 1
make[2]: Leaving directory `/opt/media/build/msdk/build'
make[1]: *** [_studio/mfx_lib/CMakeFiles/mfxhw64.dir/all] Error 2
make[1]: Leaving directory `/opt/media/build/msdk/build'
make: *** [all] Error 2

Environment:

libva (master) heads/master-0-gfbed1dbb5bfc 
gmmlib (master) heads/master-0-g0154744f9c2d
intel-media-driver (master) heads/master-0-g87b133062dee
msdk (master) heads/master-0-gfce107957ad4

gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4

SKL Intel(R) Core(TM) i7-6770HQ CPU @ 2.60GHz

Add a default if MFX_HOME is not set

MFX_HOME should not be required since it usually just points to the same directory as is being configured by cmake (i.e. the top of source tree). Consider setting the default to CMAKE_HOME_DIRECTORY when MFX_HOME is not defined in the environment.

How to monitor Intel GPU resources used by MediaSDK...

My company has asked me to create an application that can monitor Intel GPU resources that are used by the Intel Media SDK / MFX / QuickSync. We run Intel QuickSync based transcoding software on our Intel E3 servers, and need to monitor how much of the system resources are currently being used on each server.

I have looked in the Media SDK for an API to get this information, but couldn't find one. I then came across the Intel PAL / Intel Metrics Framework, and that seemed to have what I need. I developed a metrics framework based application that monitored all of the "metrics" that seem to be related to MFX/QuickSync, and when I ran it on Windows 10, it seemed to work fine. Unfortunately, when I ran it on one of our Intel E3 servers (which run Windows 2012 Server OS), it said that none of the "metrics" related to QuickSync were detected.

NOTE: I used to work at Intel, and sometimes interfaced with the Media SDK dev team. I know that what I am trying to do is possible, because I saw one of the Media SDK developers running something like what I'm developing.

Anyone have any idea where I can go for help with this? My company is willing to pay for support.

MFXVideoVPP_Close + MFXVideoVPP_Init leaks resources

Setup:
Frames are generated live at 25 fps and composited with an OSD input. For each new frame (every 40 ms) the VPP block is closed and re-inited before composition.

By doing this the cpu usage is continuously increasing. If I replace close + init with MFXVideoVPP_Reset the cpu usage stays the same.

Additional info:
Video memory is used through vaapi.
Tested on Apollolake with embedded Linux and Intel Media SDK version 1.24

Can't cross compile

In the cmake files, CMAKE_C_FLAGS are being overwritten.

set(CMAKE_C_FLAGS "-pipe -fPIC")

My cross compile sets up these values for cmake using a toolchain.cmake file.

set( CMAKE_SYSTEM_NAME Linux )
set( CMAKE_SYSTEM_PROCESSOR x86_64 )
set( CMAKE_C_COMPILER x86_64-poky-linux-gcc )
set( CMAKE_CXX_COMPILER x86_64-poky-linux-g++ )
set( CMAKE_ASM_COMPILER x86_64-poky-linux-gcc )
set( CMAKE_AR x86_64-poky-linux-ar CACHE FILEPATH "Archiver" )
set( CMAKE_C_FLAGS " -m64 -march=corei7 -mtune=corei7 -mfpmath=sse -msse4.2  --sysroot=/home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0=/usr/src/debug/msdk/git-r0 -fdebug-prefix-map=/home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0/recipe-sysroot-native= -fdebug-prefix-map=/home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0/recipe-sysroot=   -m64 -march=corei7 -mtune=corei7 -mfpmath=sse -msse4.2  --sysroot=/home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0/recipe-sysroot" CACHE STRING "CFLAGS" )
set( CMAKE_CXX_FLAGS " -m64 -march=corei7 -mtune=corei7 -mfpmath=sse -msse4.2  --sysroot=/home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0=/usr/src/debug/msdk/git-r0 -fdebug-prefix-map=/home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0/recipe-sysroot-native= -fdebug-prefix-map=/home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0/recipe-sysroot=  -fvisibility-inlines-hidden  -m64 -march=corei7 -mtune=corei7 -mfpmath=sse -msse4.2  --sysroot=/home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0/recipe-sysroot" CACHE STRING "CXXFLAGS" )
set( CMAKE_ASM_FLAGS " -m64 -march=corei7 -mtune=corei7 -mfpmath=sse -msse4.2  --sysroot=/home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0=/usr/src/debug/msdk/git-r0 -fdebug-prefix-map=/home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0/recipe-sysroot-native= -fdebug-prefix-map=/home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0/recipe-sysroot=   -m64 -march=corei7 -mtune=corei7 -mfpmath=sse -msse4.2  --sysroot=/home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0/recipe-sysroot" CACHE STRING "ASM FLAGS" )
set( CMAKE_C_FLAGS_RELEASE "-DNDEBUG" CACHE STRING "Additional CFLAGS for release" )
set( CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG" CACHE STRING "Additional CXXFLAGS for release" )
set( CMAKE_ASM_FLAGS_RELEASE "-DNDEBUG" CACHE STRING "Additional ASM FLAGS for release" )
set( CMAKE_C_LINK_FLAGS " -m64 -march=corei7 -mtune=corei7 -mfpmath=sse -msse4.2  --sysroot=/home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0/recipe-sysroot  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed" CACHE STRING "LDFLAGS" )
set( CMAKE_CXX_LINK_FLAGS " -m64 -march=corei7 -mtune=corei7 -mfpmath=sse -msse4.2  --sysroot=/home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0=/usr/src/debug/msdk/git-r0 -fdebug-prefix-map=/home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0/recipe-sysroot-native= -fdebug-prefix-map=/home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0/recipe-sysroot=  -fvisibility-inlines-hidden  -m64 -march=corei7 -mtune=corei7 -mfpmath=sse -msse4.2  --sysroot=/home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed" CACHE STRING "LDFLAGS" )

# only search in the paths provided so cmake doesnt pick
# up libraries and tools from the native build machine
set( CMAKE_FIND_ROOT_PATH /home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0/recipe-sysroot /home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0/recipe-sysroot-native  /home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0/recipe-sysroot-native/usr/bin/perl-native  /home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0/git )
set( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY )
set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )

# Use qt.conf settings
set( ENV{QT_CONF_PATH} /home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0/qt.conf )

# We need to set the rpath to the correct directory as cmake does not provide any
# directory as rpath by default
set( CMAKE_INSTALL_RPATH  )

# Use native cmake modules
list(APPEND CMAKE_MODULE_PATH "/home/pknopf/git/x3/abrarecipes/build/tmp/work/corei7-64-poky-linux/msdk/git-r0/recipe-sysroot/usr/share/cmake/Modules/")

# add for non /usr/lib libdir, e.g. /usr/lib64
set( CMAKE_LIBRARY_PATH /usr/lib /lib)

I pass --cross=toolchain.cmake to the build_mfx.pl script.

What is the purpose of providing the toolchain.cmake file if the values just get overwritten?

VPP reset with composition params silently resizes frames

Found issue in following test case:

  • Run VPP frames with one input stream
  • Sync all output surfaces
  • Reset VPP with composition params and two input streams
  • The VPP output frames will now appear corrupted (The height of the first input stream is falsely resized on the output frame).

Additional info:
The input and output is interlaced.
Resetting VPP before running/syncing any frames will work as expected.
No errors or warnings are returned from reset or RunFrameVPPAsync.
Video memory is used through vaapi.
Tested on Apollolake with embedded Linux and Intel Media SDK version 1.24

Workaround:
Use Close+Init instead of Reset.

VP9 decode plugin doesn't get built for Intel Media SDK with Apollo Lake platforms

Even though the Intel media driver (https://github.com/intel/media-driver) specifies VP9 Profile 0 decode support for BXT / APL, the VP9 decode plugin for MSDK doesn't seem to get included when building MSDK. Intel MSDK 2017 for Embedded Linux seems to have VP9 decode support (https://software.intel.com/sites/default/files/managed/9b/7b/mediasdkembedded_release_notes.pdf), so I would assume the open-source MSDK stack would have VP9 decode support as well ever since BXT / APL support was introduced. Did I miss a flag to enable this feature apart from --target=BXT when building MSDK?

Build fault, GCC 5.4 (ubuntu 16.10/16.04)

After this commit, i get problem with virtual destructor in class 26c8e5e

/mnt/train/build_iHD/testmsdk3/MediaSDK/_studio/mfx_lib/cmrt_cross_platform/src/cmrt_cross_platform.cpp:63:7: error: base class ‘class CmDevice’ has accessible non-virtual destructor [-Werror=non-virtual-dtor]
 class CmDeviceImpl : public CmDevice
       ^

After revert this commit, it is fine build.
Also question, it is possible to build Media SDK with GCC 6.2 ? or newer version? I get same problem, like in issue 84

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.