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.

Partial Acceleration on Hevc Encode under Ubuntu

NAves
Novice
270 Views

Hi

Running HEVC plugin on Ubuntu 14.04, with i7-4760HQ, and 3.8 kernel, is very slow compare to avc encode: (I’ve played around with vaapi option, but it didn’t make a difference):

AVC:
# time ./sample_encode_drm h264 -i ~/Videos/BasketballDrive_1920x1080_50.yuv -o ~/Videos/BasketballDrive_1920x1080_50.h264 -w 1920 -h 1080 -hw -vaapi
libva info: VA-API version 0.34.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_0_32
libva info: va_openDriver() returns 0
Intel(R) Media SDK Encoding Sample Version 5.0.1603344.93446

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
Target usage    balanced
Memory type    d3d
Media SDK impl        hw
Media SDK version    1.10

Processing started
Frame number: 501
Processing finished

real    0m2.326s
user    0m1.104s
sys    0m0.440s

HEVC:

# time ./sample_encode_drm h265 -i ~/Videos/BasketballDrive_1920x1080_50.yuv -o ~/Videos/BasketballDrive_1920x1080_50.h265 -w 1920 -h 1080 -hw -vaapi -b 3757
info: plugin 'Intel (R) Media SDK plugin for HEVC ENCODE' loaded successfully
libva info: VA-API version 0.34.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_0_32
libva info: va_openDriver() returns 0
WARNING: partial acceleration
Intel(R) Media SDK Encoding Sample Version 5.0.1603344.93446

Input file format    YUV420
Output video        HEVC
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
Target usage    balanced
Memory type    d3d
Media SDK impl        hw
Media SDK version    1.10

Processing started
Frame number: 501
Processing finished

real    2m1.247s
user    15m59.160s
sys    0m0.492s

The large difference between user and real times is indicative of major blocking during execution. Any comment or help is appreciated.
Cheers,

 

0 Kudos
4 Replies
Sravanthi_K_Intel
270 Views

Hello there - thanks for reporting out the HEVC numbers. The current performance of HEVC is surely not at the mark of AVC (by an order of magnitude), but there is a lot of effort being put into improving this. Stay tuned for the latest updates!

Regarding your experiments with HEVC, there are a certain knobs that can really bump up your performance (fps I mean). Here they are:"-u 7 -async N", where N is >5.

"-u 7" -> target usage speed

"-async N" -> depth of asyn pipeline (think number of parallel async operations). default is 1 here.

Hope this helps. Let me know if you have more questions.

 

0 Kudos
NAves
Novice
270 Views

Hi

Thank you for your prompt reply. It seems that I can't give any argument to -async:

# time ./sample_encode_drm h265 -i ~/Videos/Parkjoy_1080p50_1920x1080.yuv -o ~/Videos/Parkjoy_1080p50_1920x1080_lAcc.h265 -w 1920 -h 1080 -hw  -b 3500  -u 7 -async 6
Intel(R) Media SDK Decoding Sample Version 5.0.1603344.93446

Error: Unknown options


....

However, I can run it without any argument to -async:

# time ./sample_encode_drm h265 -i ~/Videos/Parkjoy_1080p50_1920x1080.yuv -o ~/Videos/Parkjoy_1080p50_1920x1080_lAcc.h265 -w 1920 -h 1080 -hw  -b 3500  -u 7 –async
info: plugin 'Intel (R) Media SDK plugin for HEVC ENCODE' loaded successfully
libva info: VA-API version 0.34.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_0_32
libva info: va_openDriver() returns 0
WARNING: partial acceleration
Intel(R) Media SDK Encoding Sample Version 5.0.1603344.93446

Input file format    YUV420
Output video        HEVC
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)    3500
Target usage    balanced
Memory type    system
Media SDK impl        hw
Media SDK version    1.10

Processing started
Frame number: 500
Processing finished

real    1m34.959s
user    12m33.156s
sys    0m0.412s


Unfortunately, as noted above, the user time to real time ratio is still high.

To be clear then, the warning "WARNING: partial acceleration" is expected?

Cheers,

 

0 Kudos
Sravanthi_K_Intel
270 Views

Hello there - We just got back after multiple day meetings, and I will get back to you today. I have not seen this issue before, but looking at the error - there seems to be some weird parsing issue. Too soon to tell - let me get back to you if I can reproduce.

0 Kudos
Sravanthi_K_Intel
270 Views

Hello there - I think I know what went wrong here. In the 5.0.1603344.93446 version of the samples, -async parameter is not being parsed by the sample_encode.cpp. This parameter is being parsed in the latest preview version ().

So, you can easily add that parameter in the pipeline_encode.cpp file in structure m_mfxEncParams, and/or modify the sample_encode.cpp to accept -async as a parameter. Hope this helps.

The partial acceleration warning is alright - it does not have anything to do with the error you are seeing.

0 Kudos
Reply