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
517 stars 171 forks source link

[SVT-HEVC]Encoding hang when set parameter "-hierarchical-levels" as 0 or 1 with 1080P 8bit input clip #490

Closed liweki closed 4 years ago

liweki commented 4 years ago

Tested parameters "-hierarchical-levels", "-base-layer-switch-mode" and "-pred-struct" with Master commit id c7aebec, if set parameter "-hierarchical-levels" as 0 or 1 and use 1080p 8bit YUV file as input, the encoding will hang at about 54 frame.

Try with below matrixs and clips, the result as following. Capture

Test command we used: SvtHevcEncApp -encMode 9 -w 1920 -h 1080 -i Fallout4_1920x1080_8bit_60Hz_P420.yuv -fps 60 -intra-period 55 -hierarchical-levels 0 -base-layer-switch-mode 0 -pred-struct 0 -b bitstreams/hevc-c7aebec_M9_Fallout4_1920x1080_8bit_60Hz_P420_Q32_55_0_0_0.bin -n 300 -bit-depth 8 -color-format 1 -q 32 -rc 0

tianjunwork commented 4 years ago

Hi @liweki , I tried on master, didn't reproduce it with the same command. Except I am using the big bunny video.

(master) $ ./SvtHevcEncApp -encMode 9 -w 1920 -h 1080 -i ../../../../yuv/bbb_1920x1080_420p.yuv -fps 60 -intra-period 55 -hierarchical-levels 0 -base-layer-switch-mode 0 -pred-struct 0 -b bitstreams/hevc-c7aebec_M9_Fallout4_1920x1080_8bit_60Hz_P420_Q32_55_0_0_0.bin -n 300 -bit-depth 8 -color-format 1 -q 32 -rc 0
-------------------------------------------
SVT-HEVC Encoder
SVT [version]:  SVT-HEVC Encoder Lib v1.4.3
SVT [build]  :  GCC 8.1.0        64 bit
LIB Build date: Mar  4 2020 15:54:19
-------------------------------------------
Number of logical cores available: 72
Number of PPCS 107
-------------------------------------------
SVT [config]: Main Profile      Tier (auto)     Level (auto)
SVT [config]: EncoderMode / Tune                                                        : 9 / 1
SVT [config]: EncoderBitDepth / CompressedTenBitFormat / EncoderColorFormat             : 8 / 0 / 1
SVT [config]: SourceWidth / SourceHeight / InterlacedVideo                              : 1920 / 1080 / 0
SVT [config]: FrameRate / Gop Size                                                      : 60 / 56
SVT [config]: HierarchicalLevels / BaseLayerSwitchMode / PredStructure                  : 0 / 0 / 0
SVT [config]: BRC Mode / QP / LookaheadDistance / SceneChange                           : CQP / 32 / 17 / 1
SVT [config]: BitRateReduction / ImproveSharpness                                       : 0 / 0
SVT [config]: tileColumnCount / tileRowCount / tileSliceMode / Constraint MV            : 1 / 1 / 0 / 0
SVT [config]: De-blocking Filter / SAO Filter                                           : 1 / 1
SVT [config]: HME / UseDefaultHME                                                       : 1 / 1
SVT [config]: MV Search Area Width / Height                                             : 16 / 7
SVT [config]: HRD / VBV MaxRate / BufSize / BufInit                                     : 0 / 0 / 0 / 90
-------------------------------------------
Encoding       300
SUMMARY --------------------------------- Channel 1  --------------------------------
Total Frames            Frame Rate              Byte Count              Bitrate
         300            60.00 fps                   947717              1516.35 kbps

Channel 1
Average Speed:          114.59 fps
Total Encoding Time:    2618 ms
Total Execution Time:   3107 ms
Average Latency:        894 ms
Max Latency:            1345 ms
Encoder finished
liweki commented 4 years ago

Hi, tianjunwork, I tried with the latest master code bde91e6, the issue is still reproduced, I tested with below 2 clips: GTAV_005_1920x1080_8bit_60Hz_P420.yuv Fallout4_1920x1080_8bit_60Hz_P420.yuv

Test log as following: Testlog

intelmark commented 4 years ago

@liweki -

Tried reproducing on a Xeon server here with the master code using your command line and a few 1080p videos (see below), but couldn't reproduce the hang, trying several time.

Presuming disk space and memory are not constraints.

Can you share these two clips and is the hang always reproducible with them?

Does process show any activity when it is hung?

Can you provide any details about your hardware?

Bin/Release/SvtHevcEncApp -encMode 9 -w 1920 -h 1080 -i /testfiles/GTAV_1920x1080_60p_8bit.yuv -fps 60 -intra-period 55 -hierarchical-levels 0 -base-layer-switch-mode 0 -pred-struct 0 -b test.bin -n 300 -bit-depth 8 -color-format 1 -q 32 -rc 0

Bin/Release/SvtHevcEncApp -encMode 9 -w 1920 -h 1080 -i /testfiles/benchmarking/Sunflower_1920x1080_25p_i420_8bit.y4m -fps 60 -intra-period 55 -hierarchical-levels 0 -base-layer-switch-mode 0 -pred-struct 0 -b test.bin -n 300 -bit-depth 8 -color-format 1 -q 32 -rc 0

Bin/Release/SvtHevcEncApp -encMode 9 -w 1920 -h 1080 -i /testfiles/benchmarking/CSGO_1920x1080_60p_i420_8bit.y4m -fps 60 -intra-period 55 -hierarchical-levels 0 -base-layer-switch-mode 0 -pred-struct 0 -b test.bin -n 300 -bit-depth 8 -color-format 1 -q 32 -rc 0

Bin/Release/SvtHevcEncApp -encMode 9 -w 1920 -h 1080 -i /testfiles/bbb_1920x1080_420p.yuv -fps 60 -intra-period 55 -hierarchical-levels 0 -base-layer-switch-mode 0 -pred-struct 0 -b test.bin -n 300 -bit-depth 8 -color-format 1 -q 32 -rc 0

tianjunwork commented 4 years ago

Hi @liweki I can reproduce hang with ./SvtHevcEncApp -i ../../../../yuv/bbb_1920x1080_420p.yuv -w 1920 -h 1080 -n 5000 -hierarchical-levels 0, but still not by your command line. The root cause is already targeted by @Austin-Hu. We will fix the hang issue first with my command. Please check your command later when we merge the fix. Thank you for reporting the issue.

liweki commented 4 years ago

Hi, tianjunwork, Ok, I will verify the issue after the fix merged. Thanks for your reply.

tianjunwork commented 4 years ago

Hi @liweki , #494 is merged. Could you verify your command? Thank you.