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.

how to enable h264_qsv in ffmpeg

chengzhuo_g_
Beginner
5,084 Views

Hi all,

I have intsalled the MSS R6 in Ubuntu14.04(i7-4790k) yet.And the sample test for hw transcoding is passed.Now I wanted to enable the h264_qsv(hw accelerated) with ffmpeg(version 2.8.4) like this: ./configure --enable-libmfx --enable-encoder=h264_qsv --enable-decoder=h264_qsv ....... But it's always failed when I "make" ffmpeg.Here is the part of the error logs : MFXVideoUSER_Load undefinded reference; collect2: error: ld returned 1 exit status (I know it's link error of libmfxhw64.so)........I have created the libmfx.pc for libfmx yet.Can you tell me  how to link libmfxhw64.so for ffmpeg or the steps to enable qsv with ffmpeg in Ubuntu correctly ?

Thanks.

0 Kudos
8 Replies
Jeffrey_M_Intel1
Employee
5,084 Views

Steps to configure FFmpeg are here: 

https://software.intel.com/en-us/articles/accessing-intel-media-server-studio-for-linux-codecs-with-ffmpeg

I've validated on several Linux distros, including Ubuntu.  

From the error, I suspect that the 'libdir' specification in libmfx.pc isn't pointing to the directory with libmfx.a.  This has the function interfaces, functions themselves are loaded at runtime based on how the session is initialized.

You may have more than one libmfx.pc file on your system.  You can be sure to point to the right one by setting PKG_CONFIG_PATH before configure. You can also check that the output of pkg_config is correct:

$ pkg-config --cflags --libs libmfx        
-I/opt/intel/mediasdk/include -I/usr/include/libdrm  
-L/opt/intel/mediasdk/lib/lin_x64 -lmfx -lva -lstdc++ -ldl -lva-drm -ldrm

Regards, Jeff

0 Kudos
chengzhuo_g_
Beginner
5,084 Views

Hi Jeff,

Thank you very much.I have solved this problem.The transcoding of h264_qsv is working.

Now I have another issue:when I enable the hevc_qsv codec to transcode the video,it is always failed at 40 seconds of video.The error log is below:

libva info: VA-API version 0.35.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_0_32
libva info: va_openDriver() returns 0
Output #0, mpegts, to 'jilu60s-hw-d-2000k.ts':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf56.40.101
    Stream #0:0(und): Video: hevc (hevc_qsv), nv12, 3840x2160, q=2-31, 2000 kb/s, 25 fps, 90k tbn, 25 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc56.60.100 hevc_qsv
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, 160 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> hevc (hevc_qsv))
  Stream #0:1 -> #0:1 (copy)
Press to stop, [?] for help
[hevc_qsv @ 0x2214c80] EncodeFrameAsync returned -160:47.78 bitrate=1681.4kbits/s    
Video encoding failed
Conversion failed!

This MSS pro edition is trial version.My command line:

ffmpeg -y -i input.mp4 -vcodec hevc_qsv -load_plugins e5400a06c74d41f5b12d430bbaa23d0b -preset slow -b:v 2000k -acodec copy -f mpegts output.ts

And I have test three different videos by hevc_qsv codec,they are both failed at about 40 seconds of video.Can you help me to analysis this issue?

Thanks.

0 Kudos
Jeffrey_M_Intel1
Employee
5,084 Views

The trial edition of the HEVC encoders is limited to 1000 frames, which is 40 seconds at 25 FPS.   We hope this is enough to evaluate performance and quality.  If your evaluation requires going beyond this trial version limitation we will be glad to set up a direct conversation with you to determine how we can meet your needs.

Thanks, Jeff

 

0 Kudos
chengzhuo_g_
Beginner
5,084 Views

I got it.Thank you!

0 Kudos
Milan_C_
Beginner
5,084 Views

Hello Jeffrey.
What license is required for reducing the limit that you described for HEVC encoding?
We don't need any intel SW (use ffmpeg), so I don't know which type of license is needed - Essentials / Professional or individual? What is the price for "unlimited" HEVC encoding via ffmpeg? Thank you.

0 Kudos
Mark_L_Intel1
Moderator
5,084 Views

Hi Milan,

I think you need to get the license of the Media Server Studio Professional Edition, but if you are using the HW accelerated HEVC, you might try the Community/Essentials Edition which is free and should not have limitation.

This page shows the difference between the Community and the Professional Editions:

https://software.intel.com/en-us/intel-media-server-studio/try-buy

Mark

0 Kudos
zhao_q_
Beginner
5,084 Views

i want to know that using the MSS Community editon, how much fps can reach when transcoding 1080x720p to 640x480p? my cpuinfo show blow:

Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz(4 cores)

the instruction " ffmpeg -y -i VID_20161224_172717.mp4 -vcodec h264_qsv -acodec copy -s 640x480 out.mp4" show the 240 fps.

 

0 Kudos
zhao_q_
Beginner
5,084 Views

i want to know that using the MSS Community editon, how much fps can reach when transcoding 1080x720p to 640x480p? my cpuinfo show blow:

Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz(4 cores)

the instruction " ffmpeg -y -i VID_20161224_172717.mp4 -vcodec h264_qsv -acodec copy -s 640x480 out.mp4" show the 240 fps.

0 Kudos
Reply