OpenVisualCloud / SVT-HEVC

SVT HEVC encoder. Scalable Video Technology (SVT) is a software-based video coding technology that is highly optimized for Intel® Xeon® processors. Using the open source SVT-HEVC encoder, it is possible to spread video encoding processing across multiple Intel® Xeon® processors to achieve a real advantage of processing efficiency.
Other
519 stars 169 forks source link

when encoding with codeVpsSpsPps enabled, encoded packets are not output #305

Closed Yeongjin-Jeong closed 5 years ago

Yeongjin-Jeong commented 5 years ago

I used the gstreamer svthevcenc plugin with the latest SVT-HEVC, and found that the encoded packets are not output from the encoder.

After initializing the encoder with codeVpsSpsPps enabled, It seems to be caused by using the EbH265EncStreamHeader API before receiving encoded packets. And the same happens with the ffmpeg plugin or SvtHevcEncApp, if codeVpsSpsPps is enabled.

This occurs after patch https://github.com/OpenVisualCloud/SVT-HEVC/pull/155 is merged. Has the usage of EbH265EncStreamHeader API or codeVpsSpsPps flag changed? Or is there something wrong in my build environment?

Here is the lscpu output:

Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                16
On-line CPU(s) list:   0-15
Thread(s) per core:    2
Core(s) per socket:    8
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 63
Model name:            Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz
Stepping:              2
CPU MHz:               1394.019
CPU max MHz:           3200.0000
CPU min MHz:           1200.0000
BogoMIPS:              4788.65
Virtualisation:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              20480K
NUMA node0 CPU(s):     0-15
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 cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti intel_ppin ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm xsaveopt cqm_llc cqm_occup_llc dtherm ida arat pln pts md_clear flush_l1d
tianjunwork commented 5 years ago

Hi @Yeongjin-Jeong, I am trying to reproduce what you saw. Could you share the command line you use with SvtHevcEncApp? codeVpsSpsPps is always 1 in SvtHevcEncApp(EbAppContext.c).

Yeongjin-Jeong commented 5 years ago

Hi @Yeongjin-Jeong, I am trying to reproduce what you saw. Could you share the command line you use with SvtHevcEncApp? codeVpsSpsPps is always 1 in SvtHevcEncApp(EbAppContext.c).

Hi @tianjunwork, Thanks to ping. To reproducing this issue, you need to add code to call the EbH265EncStreamHeader API between the line that encodes the packet and the line that initializes the encoder.

--- a/Source/App/EbAppContext.c
+++ b/Source/App/EbAppContext.c
@@ -628,6 +628,13 @@ EB_ERRORTYPE InitEncoder(
     ///************************* LIBRARY INIT [END] *********************///

     ///********************** APPLICATION INIT [START] ******************///
+    {
+        EB_BUFFERHEADERTYPE *headerPtr = NULL;
+        return_error = EbH265EncStreamHeader (callbackData->svtEncoderHandle, &headerPtr);
+        if (return_error != EB_ErrorNone) {
+            return return_error;
+        }
+    }

     // STEP 6: Allocate input buffers carrying the yuv frames in
     return_error = AllocateInputBuffers(

And here is my command line:

SvtHevcEncApp -i test.yuv -w 640 -h 480 -fps 30 -rc 1 -tbr 2000000 -scd 1 -intra-period 29 -bit-depth 8 -compressed-ten-bit-format 0 -b test.hevc
tianjunwork commented 5 years ago

Thanks @Yeongjin-Jeong fixing this issue👍