Bug 5128

Summary: no cpu capabilities in ffmpeg-3.4.5-1.el7 RPM for x86_64 => encoding very slow
Product: Fedora EPEL Reporter: Jean <je.ma>
Component: x265Assignee: Nicolas Chauvet <kwizart>
Status: RESOLVED FIXED    
Severity: major CC: leigh123linux
Priority: P1    
Version: 7   
Hardware: x86_64   
OS: GNU/Linux   
namespace:

Description Jean 2018-12-29 14:03:58 CET
Hi,

Sorry for my poor english and to disturb you.

I'm using ffmpeg on CentOS 7.6 (x86_64). Previous version distributed by rpmfusion was 2.8.x and was old. So thanks for this 3.4.5.
But I've some issue : encoding is now very slow for x265. I'm thinking this is because of not using cpu capabilities :


  Stream #0:1 -> #0:1 (h264 (native) -> hevc (libx265))
x265 [info]: HEVC encoder version 2.9
x265 [info]: build info [Linux][GCC 4.8.5][64 bit][noasm] 8bit
x265 [info]: using cpu capabilities: none!
x265 [info]: Main profile, Level-4 (Main tier)

I'm using a cpu with avx2 and sse 4.2 :

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 6
model           : 60
model name      : Intel(R) Xeon(R) CPU E3-1225 v3 @ 3.20GHz
stepping        : 3
microcode       : 0x25
cpu MHz         : 3399.804
cache size      : 8192 KB
physical id     : 0
siblings        : 4
core id         : 3
cpu cores       : 4
apicid          : 6
initial apicid  : 6
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 pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts spec_ctrl intel_stibp flush_l1d
bogomips        : 6384.88
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:
Comment 1 Jean 2018-12-30 14:21:31 CET
I've tried to rebuild x265-libs on my CentOS 7.6.
It compiles but I saw this issue :
-- Nasm version 2.10.07 is too old. 2.13.0 or later required

So it must be why no asm acceleration.
Comment 2 Jean 2018-12-30 15:57:50 CET
I've compiled nasm 2.13 from nasm-2.13.03-2.fc29.src.rpm (rpmbuild --rebuild nasm-2.13.03-2.fc29.src.rpm, few deps, not tricky)

And then x265-2.9-2.el7.src.rpm :
rpmbuild --rebuild x265-2.9-2.el7.src.rpm

It fixes the issue with ffmpeg:
x265 [info]: HEVC encoder version 2.9
x265 [info]: build info [Linux][GCC 4.8.5][64 bit] 8bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main profile, Level-4 (Main tier)
x265 [info]: Thread pool created using 4 threads


Encoding to x265 is now at least 30x faster.
Comment 3 leigh scott 2018-12-30 21:30:02 CET
Created x265 component for el7 and reassigned.
Comment 4 leigh scott 2018-12-31 09:23:53 CET
Fixed in x265-2.9-3.el7

https://koji.rpmfusion.org/koji/buildinfo?buildID=9822
Comment 5 Jean 2018-12-31 13:26:18 CET
(In reply to leigh scott from comment #4)
> Fixed in x265-2.9-3.el7
> 
> https://koji.rpmfusion.org/koji/buildinfo?buildID=9822

Ok, I confirm : x265-libs-2.9-3.el7.x86_64.rpm fixes Bug #5128
Thanks.