[Cin] HEVC hw encoding on AMD Polaris cards

Andrew Randrianasulu randrianasulu at gmail.com
Tue May 14 00:14:03 CEST 2019


В сообщении от Monday 13 May 2019 23:34:47 Спицын Андрей написал(а):
> Hi Andrew,
> 

Hi!

> Here the quick test results.
> I used 4k sample video on my PC with RX550 and outdated CPU (ten
> years-old double-core Pentium)
> 
> The variable CIN_HW_DEV affects only on ability to play videos.
> My test video with vaapi device plays at full speed with around 50% CPU
> load.
> The use of 'none' device results in unplayable video (more like slide
> show).
> But in both cases I can successfully encode video with hevc_vaapi
> and h264_vaapi (profile=main) encoders  with about 100% CPU load.
> The hevc encoder produce smaller file size with a shorter encoding time
> (that's surprise me).
> Ten seconds video encodes about 3 minutes (my hardware is really old for
> 4k:( )
> 
> Software encoding lasts forever, so I not tested it.
> 
> And last test I used ffmpeg from deb-multimedia and created proxy file
> for my 4k video sample. Hevc_vaapi decode and h264 vaapi encode with
> vaapi downscale to 640x360 took around 30 seconds for 10 second
> video!!!
> If I use cinelerra's to manually create proxy files (not by menu), just
> add scale_vaapi filter, then I get following results.
> The hevc and h262 vaapi encoders uses around 1 min 20 sec (hevc) and 1
> minute 45 seconds (h262 main). 
> In case of proxy creation with a menu button, rendering estimates around
> 42 minutes for 30 seconds video. But I not tested it.
> 
> So my conclusion that vaapi decoding is extremely useful for playing
> videos and create proxy files in separate script.


Good to see it worked for you! You probably have slowest CPU here, and fastest/newest GPU.

I was looking at bug/feature database, and I think
0000129 - Support for HEVC decode and/or encode hardware acceleration
and
0000090 - Allow optional hardware-supported encoding during rendering

can be at least updated now, if not closed (some files probably will not play correctly yet? Both h264 and h265 apparently huge and complex and not all features were implemented in hw decoders, especially slightly older ones).

> 
> @GG how can I use custom script for proxy files creation inside
> Cinelerra? Or use ffmpeg's scale_vaapi filter if vaapi used.
> 
> 
> $vainfo 
> libva info: VA-API version 0.39.4
> libva info: va_getDriverName() returns -1
> libva info: User requested driver 'radeonsi'
> libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
> libva info: Found init function __vaDriverInit_0_39
> libva info: va_openDriver() returns 0
> vainfo: VA-API version: 0.39 (libva 1.7.3)
> vainfo: Driver version: Mesa Gallium driver 18.2.8 for Radeon RX 550 Series (POLARIS12, DRM 3.27.0, 4.19.0-0.bpo.4-amd64, LLVM 6.0.0)
> vainfo: Supported profile and entrypoints
>       VAProfileMPEG2Simple            :	VAEntrypointVLD
>       VAProfileMPEG2Main              :	VAEntrypointVLD
>       VAProfileVC1Simple              :	VAEntrypointVLD
>       VAProfileVC1Main                :	VAEntrypointVLD
>       VAProfileVC1Advanced            :	VAEntrypointVLD
>       VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
>       VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
>       VAProfileH264Main               :	VAEntrypointVLD
>       VAProfileH264Main               :	VAEntrypointEncSlice
>       VAProfileH264High               :	VAEntrypointVLD
>       VAProfileH264High               :	VAEntrypointEncSlice
>       VAProfileHEVCMain               :	VAEntrypointVLD
>       VAProfileHEVCMain               :	VAEntrypointEncSlice
>       VAProfileHEVCMain10             :	VAEntrypointVLD
>       VAProfileJPEGBaseline           :	VAEntrypointVLD
>       VAProfileNone                   :	VAEntrypointVideoProc
> 
> $cat /proc/cpuinfo 
> processor	: 0
> vendor_id	: GenuineIntel
> cpu family	: 6
> model		: 23
> model name	: Pentium(R) Dual-Core  CPU      E5300  @ 2.60GHz
> stepping	: 10
> microcode	: 0xa0b
> cpu MHz		: 1905.714
> cache size	: 2048 KB
> physical id	: 0
> siblings	: 2
> core id		: 0
> cpu cores	: 2
> apicid		: 0
> initial apicid	: 0
> fpu		: yes
> fpu_exception	: yes
> cpuid level	: 13
> 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 lm constant_tsc arch_perfmon pebs bts rep_good nopl cpuid aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm xsave lahf_lm pti tpr_shadow vnmi flexpriority dtherm
> bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
> bogomips	: 5200.12
> clflush size	: 64
> cache_alignment	: 64
> address sizes	: 36 bits physical, 48 bits virtual
> power management:
> 
> processor	: 1
> vendor_id	: GenuineIntel
> cpu family	: 6
> model		: 23
> model name	: Pentium(R) Dual-Core  CPU      E5300  @ 2.60GHz
> stepping	: 10
> microcode	: 0xa0b
> cpu MHz		: 1833.296
> cache size	: 2048 KB
> physical id	: 0
> siblings	: 2
> core id		: 1
> cpu cores	: 2
> apicid		: 1
> initial apicid	: 1
> fpu		: yes
> fpu_exception	: yes
> cpuid level	: 13
> 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 lm constant_tsc arch_perfmon pebs bts rep_good nopl cpuid aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm xsave lahf_lm pti tpr_shadow vnmi flexpriority dtherm
> bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
> bogomips	: 5200.12
> clflush size	: 64
> cache_alignment	: 64
> address sizes	: 36 bits physical, 48 bits virtual
> power management:
> 
> 




More information about the Cin mailing list