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.

FFMPEG Git with Intel HEVC Software Encoder

Celio_A_
Beginner
5,757 Views

Hi

I'm trying to encode with ffmpeg using the load_plugin hevc_sw that loads 2fca99749fdb49aeb121a5b63ef568f7 hevc software plugin but can't manage to get it working in 10 bit hevc encoding

Here my cmd line options

ffmpeg -hide_banner -v verbose -hwaccel qsv -c:v h264_qsv -i [INPUT] -c:v hevc_qsv -load_plugin hevc_sw -pix_fmt p010le -profile:v main10 -preset:v veryslow -gpb 0 -g 240 -refs:v 4 [OUTPUT].hevc

I tryed to contact ffmpeg developers but they always said that have no problem and its working with hardware encoding but i want to use Intel HEVC software encoder plugin with ffmpeg

Can someone resolve this problem? If i use sample_multi_transcode it works but with ffmpeg the final output are a green screen, i'm about 2 years with this weird problem that needs to be fixed, i heard that about frame shift when using 10 bit but i dont know how to add this to ffmpeg so i can use ffmpeg for encoding with intel software hevc encoder

Currently i'm using Intel Core i7 7700 processor

Windows 10 Pro x64

Regards

thx4ever

 

 

 

 

0 Kudos
15 Replies
ArunJ_Intel
Moderator
5,707 Views

Hi 

 

Could you please share your input video. So we could reproduce this.

 

Have you tried out the hardware encoding with ffmpeg, does that work fine for you as well. DOes that work just changing load_plugin in command line, If possible please share commandline you are using for hardware encoding. Also sharing the sample_multi_transcode command line options that worked for you  would give us a clear picture on what you are trying to achieve here.

 

 

Thanks

Arun

 

0 Kudos
Celio_A_
Beginner
5,692 Views

OK here is my command line options and i have attached the sample video

ENCODED with Intel HEVC GACC with ffmpeg

ffmpeg -hide_banner -v verbose -i "C:\Users\thx4ever\Downloads\Trailer.264" -c:v hevc_qsv -pix_fmt p010le -load_plugin none -load_plugins e5400a06c74d41f5b12d430bbaa23d0b -profile:v main10 -preset:v medium -g 240 -vframes 500 -b:v 1.5M -gpb 0 C:\Users\thx4ever\Downloads\TrailerQSV_GACC.hevc

ENCODED with Intel HEVC Software with ffmpeg

ffmpeg -hide_banner -v verbose -i "C:\Users\thx4ever\Downloads\Trailer.264" -c:v hevc_qsv -pix_fmt p010le -load_plugin hevc_sw -profile:v main10 -preset:v veryslow -g 240 -vframes 500 -b:v 1.5M -gpb 0 C:\Users\thx4ever\Downloads\TrailerQSV_SW.hevc

ENCODED with Intel HEVC HW QSV with ffmpeg

ffmpeg -hide_banner -v verbose -i "C:\Users\thx4ever\Downloads\Trailer.264 -c:v hevc_qsv -pix_fmt p010le -load_plugin hevc_hw -profile:v main10 -preset:v veryslow -g 240  -vframes 500 -b:v 1.5M -gpb 0 C:\Users\thx4ever\Downloads\TrailerQSV_HW.hevc

ENCODED with sample_multi_transcode Media Sofware SDK 2020 R1

sample_multi_transcode -i::h264 "C:\Users\thx4ever\Documents\Intel(R) Media SDK 2020 R1 - Media Samples 8.4.32.0\_bin\x64\Trailer.264" -o::h265 TrailerSMT_SW.hevc -ec::p010 -dc::nv12 

ENCODED with sample_multi_transcode Media SDK 2020 R1 GACC Plugin

sample_multi_transcode -i::h264 "C:\Users\thx4ever\Documents\Intel(R) Media SDK 2020 R1 - Media Samples 8.4.32.0\_bin\x64\Trailer.264" -o::h265 TrailerSMT_GACC.hevc -ec::p010 -dc::nv12 -vpp::sys

 

Files Description

Trailer.7z = Original AVC sample OK

TrailerQSV_GACC= Encoded with Intel HEVC Gacc plugin using ffmpeg FAILED

TrailerQSV_SW = Encoded with Intel HEVC Sofware plugin using ffmpeg FAILED

TrailerQSV_HW = Encoded with HEVC HW plugin using ffmpeg OK

Trailer_SW_SMT = Encoded with HEVC SW plugin using sample_multi_transcode from Media SDK 2020 R1 OK

Trailer_SMT_GACC = Encoded with HEVC GACC plugin using sample_multi_transcode from Media SDK 2020 R1 OK

 

 

0 Kudos
ArunJ_Intel
Moderator
5,599 Views

Hi 

 

Seems like you are using encode plugin with ffmpeg in your first command, I tried your command with decode plugin available with media sdk. I was able to get hevc output without any issues(I use MSDK 2020) . Could you please try with the decode plugin instead of encode.

 

You would be able to find plugins as directory names in the below path with MSDK installation.

 

"C:\Program Files (x86)\IntelSWTools\Intel(R) Media SDK 2020 R1\HEVC Decoder & Encoder\Plugin"

 

Here is the command I tried and worked

 

 

ffmpeg -hide_banner -v verbose -i "Trailer.264" -c:v hevc_qsv -pix_fmt p010le -load_plugin hevc_sw -load_plugins 15dd936825ad475ea34e35f3f54217a6 -profile:v main10 -preset:v medium -g 240 -vframes 500 -b:v 1.5M -gpb 0 TrailerQSV_GACC.hevc

 

 

 

Thanks

Arun

 

0 Kudos
ArunJ_Intel
Moderator
5,546 Views

Hi @Celio_A_


Have you tried out the solution provided. Does that solve your issue.


Thanks

Arun Jose


0 Kudos
Celio_A_
Beginner
5,543 Views

No Arun this does not work for me. Can u upload your current ffmpeg executable that are working for you for me to try it here?

Regards

thx4ever

 

0 Kudos
ArunJ_Intel
Moderator
5,539 Views

Hi

 

I am using ffmpeg version N-100563-g66deab3a26 Copyright (c) 2000-2021 the FFmpeg developers. You could download this from ffmpeg official website.

 

I also have 2020 R1 version of media sdk installed on my machine.

 

Thanks

Arun

 

0 Kudos
Celio_A_
Beginner
5,526 Views

[h264 @ 0000022ccf795fc0] Reinit context to 1920x1088, pix_fmt: yuv420p
[graph 0 input from stream 0:0 @ 0000022ccf7950c0] w:1920 h:1080 pixfmt:yuv420p tb:1/1000 fr:24000/1001 sar:1/1
[auto_scaler_0 @ 0000022ccfddc0c0] w:iw h:ih flags:'bicubic' interl:0
[format @ 0000022cd002ef00] auto-inserting filter 'auto_scaler_0' between the filter 'Parsed_null_0' and the filter 'format'
[auto_scaler_0 @ 0000022ccfddc0c0] w:1920 h:1080 fmt:yuv420p sar:1/1 -> w:1920 h:1080 fmt:p010le sar:1/1 flags:0x4
[hevc_qsv @ 0000022ccf795200] load_plugins is not empty, but load_plugin is not set to 'none'.The load_plugin value will be ignored.
[hevc_qsv @ 0000022ccf795200] Could not load the requested plugin '15dd936825ad475ea34e35f3f54217a6': specified object was not found (-9)
[hevc_qsv @ 0000022ccf795200] Error loading plugins
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[AVIOContext @ 0000022ccf7debc0] Statistics: 0 seeks, 0 writeouts
[AVIOContext @ 0000022ccf7672c0] Statistics: 329646 bytes read, 2 seeks
Conversion failed!

Your plugins command line is wrongh, you are trying to load hevc decoder plugin to encode hevc file

This 15dd936825ad475ea34e35f3f54217a6 are hevc decoder plugin software, i think your final encoded file are 8 bit hevc, that works for me too but not 10 bit

Regards

thx4ever

 

0 Kudos
ArunJ_Intel
Moderator
5,456 Views

Hi @Celio_A,

 

The error in your log is because the plugin 15dd936825ad475ea34e35f3f54217a6 is not being found on your machine. Could you please post a screenshot of this directory "C:\Program Files (x86)\IntelSWTools\Intel(R) Media SDK 2020 R1\HEVC Decoder & Encoder\Plugin" so we could verify if this has the plugins directory "15dd936825ad475ea34e35f3f54217a6"(I am able to reproduce your error if this folder is absent).

 

With the decoder plugin I am able to generate 10 bit hevc stream. I verified this in Mediainfo application and could see the bit depth was 10 bit. I have attached a screenshot of the mediaInfo log of the output hevc stream.

 

 

 

Hope this helps

Arun Jose

 

0 Kudos
Celio_A_
Beginner
5,446 Views

The plugin is in current ffmpeg directory and in Intel Media SDK 2020R1, i did see your image of the video in 10 bit but also i see that description component, it was encoded using hardware acceleration

Regards

thx4ever

U need to encode in this form

ffmpeg -hide_banner -v verbose -i "Trailer.264" -c:v hevc_qsv -pix_fmt p010le -load_plugin hevc_sw  -profile:v main10 -preset:v medium -g 240 -vframes 500 -b:v 1.5M -gpb 0 TrailerQSV_GACC.hevc

0 Kudos
ArunJ_Intel
Moderator
5,401 Views

Hi


We will check this internally and get back to you.


Thanks

Arun Jose.


0 Kudos
Mark_L_Intel1
Moderator
5,354 Views

Hi Celio,


I have contact the develop team and very apologized that we need a strong reason to push the fix.


The reason is, the Media SDK software encoder is deprecated. The HEVC codec was a temporary solution when our hardware codec was not ready several years ago. Since most of our processor has the hardware HEVC codec, we decided to deprecate it, we might remove it any follow up releases.


Since you are using FFmpeg to enable this feature and the analysis shows likely ffmpeg QSV plugin issue, I contact the ffmpeg plugin team and they have the same response. They will need a strong reason in order to look at it.


On the other hand, as my understanding FFmpeg is a rich supported platform, it should have a good software encode for you.


So did you tried this one?

ffmpeg -hwaccel qsv -c:v h264_qsv -I $input.264 -vf hwdownload,format=nv12 -c:v libx265 test.265


Mark


0 Kudos
Celio_A_
Beginner
5,089 Views

Hi, i found again the hevc software encoder released in Intel Media SDK 2021 R1 and the bug continues... Please can you fix this? I'm tired of this bug in media sdk encoder, you said they dont release this plugin again because is deprecated but its released again and the bug dont have fixed 

I hope this bug can be fixed soon.

When i try to use this -init_hw_device qsv=MFX_IMPL_sw now the libmfxsw64.dll show a error in ffmpeg Invalid handle -6 

x265 at veryslow are very slow... 1fps and with Media SDK 2021 R1 hevc software 8 bits i get 5+ fps

Please fix this bug that i cannot encode 10 bits HEVC in ffmpeg

 

Regards

 

thx4ever

 

0 Kudos
Mark_L_Intel1
Moderator
5,073 Views

Hi Ceilo,


It seem like there is a bug at "veryslow" mode for msdk sw plugin with hevc 10bit; and you should have a solution with x265. As you mentioned, x265 is very slow on HEVC 10bit. If this is a back up solution if the hardware codec is not available, I think it should be acceptable because this case should not happen quite often. If you are using Media SDK software codec as the main solution for HEVC 10 bit, that was not the goal of our product.


As you can see, with the current situation, it is very hard for me to convince dev team to fix it.


The other possibility is to use SVT, this is the other Intel software codec. I recommend it since it only support HEVC and AV1 encoder which covers your case, you can check this website for more information:

https://01.org/svt/welcome-documents-page/ffmpeg-and-gstremer-plugins


Mark


0 Kudos
Mark_L_Intel1
Moderator
4,938 Views

Hi Celio,


Did you check SVT plugin for HEVC 10bit for your solution?


As I mentioned before, if your application is to use Media SDK plugin, we require hardware codec as the primary codec function while software codec as a backup path. If you are using software codec as the primary codec path, you can check SVT or other solutions in the market.


Mark


0 Kudos
Mark_L_Intel1
Moderator
4,839 Views

Hi Celio,


I will stop monitoring this request, it is not closed but if you want to get immediate attention, you'd better to a new post for continue.


Mark Liu


0 Kudos
Reply