Closed spartazhc closed 3 years ago
Hi @spartazhc , -lad 0 -rc 1
is not recommended. Please read related discussion:
https://github.com/OpenVisualCloud/SVT-HEVC/issues/588#issuecomment-827332741
If you use -lad 0
to get lower encoding delay, try -lad 1
, number of frames queued is reduced and performance of rate control is much better.
Thanks for your reply!
-lad 0 -hierarchical-levels 0 -rc 1
works. -lad 0 -hierarchical-levels 3 -rc1
fail. But my use case requires low encoding delay (-lad 0
) and high throughout (-hierarchical-levels 3
).
I have read some code in InitialRateControlProcess and RateControlProcess, it is difficult for me to understand the idea behind code. Is there any meterial about the rate control algorithm used in SVT? And, If I want to fix this problem, do you have any advice?
Thanks a lot.
Hi @spartazhc , for low latency use case, we've been suggesting to use -lad 1
to other users also. SVT-HEVC is not designed for ultra low latency or real time use case. To support that, the estimated engineering effort will cost at least a quarter for SVT algorithm team.
Could you try -lad 1
and check if the delay is within your target? I understand the lower the better. But as you found out, the rate control is not performing with -lad 0
.
Thanks Jun, I understand the difficulty of this problem.
When I try -lad 1
, there will be a floating point exception caused by trying to divide by zero.
No problem. Can I have your command line to reproduce?
SvtHevcEncApp -w 1920 -h 1080 -i test.yuv -b out.hevc -pred-struct 0 -lad 1 -hierarchical-levels 3 -encMode 10 -bit-depth 8 -rc 1 -tbr 3000000
-------------------------------------------
SVT-HEVC Encoder
SVT [version]: SVT-HEVC Encoder Lib v1.5.1
SVT [build] : GCC 9.3.0 64 bit
LIB Build date: Jun 18 2021 13:26:18
-------------------------------------------
Number of logical cores available: 72
Number of PPCS 91
-------------------------------------------
SVT [config]: Main Profile Tier (auto) Level (auto)
SVT [config]: EncoderMode / Tune : 10 / 1
SVT [config]: EncoderBitDepth / CompressedTenBitFormat / EncoderColorFormat : 8 / 0 / 1
SVT [config]: SourceWidth / SourceHeight / InterlacedVideo : 1920 / 1080 / 0
SVT [config]: FrameRate / Gop Size : 60 / 64
SVT [config]: HierarchicalLevels / BaseLayerSwitchMode / PredStructure : 3 / 0 / 0
SVT [config]: RCMode / TargetBitrate / LAD / SceneChange / QP Range [10 ~ 48] : VBR / 3000000 / 1 / 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
-------------------------------------------
SVT [WARNING] Elevated privileges required to run with real-time policies! Check Linux Best Known Configuration in User Guide to run application in real-time without elevated privileges!
Encoding zsh: floating point exception (core dumped)
Hi @spartazhc, I tried with several test clips. I didn't reproduce what you saw. Could you try other input yuv files? Does the crash show with other yuv files or just this one?
That is strange, I tried all VVC B class sequences, and several C class sequences, all failed.
> Bin/Release/SvtHevcEncApp -w 1920 -h 1080 -i /mnt/hdd0/VVCSeq/B/RitualDance_1920x1080_60fps_10bit_420.yuv -b /tmp/out.hevc -pred-struct 0 -lad 1 -hierarchical-levels 3 -encMode 10 -bit-depth 8 -rc 1 -tbr 3000000
-------------------------------------------
SVT-HEVC Encoder
SVT [version]: SVT-HEVC Encoder Lib v1.5.1
SVT [build] : GCC 9.3.0 64 bit
LIB Build date: Jun 22 2021 08:43:14
-------------------------------------------
Number of logical cores available: 72
Number of PPCS 91
-------------------------------------------
SVT [config]: Main Profile Tier (auto) Level (auto)
SVT [config]: EncoderMode / Tune : 10 / 1
SVT [config]: EncoderBitDepth / CompressedTenBitFormat / EncoderColorFormat : 8 / 0 / 1
SVT [config]: SourceWidth / SourceHeight / InterlacedVideo : 1920 / 1080 / 0
SVT [config]: FrameRate / Gop Size : 60 / 64
SVT [config]: HierarchicalLevels / BaseLayerSwitchMode / PredStructure: 3 / 0 / 0
SVT [config]: RCMode / TargetBitrate / LAD / SceneChange / QP Range [10 ~ 48] : VBR / 3000000 / 1 / 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
-------------------------------------------
SVT [WARNING] Elevated privileges required to run with real-time policies! Check Linux Best Known Configuration in User Guide to run application in real-time without elevated privileges!
Encoding zsh: floating point exception (core dumped) Bin/Release/SvtHevcEncApp -w 1920 -h 1080 -i -b /tmp/out.hevc -pred-struct 0
> Bin/Release/SvtHevcEncApp -w 832 -h 480 -i /mnt/hdd0/VVCSeq/C/BasketballDrill_832x480_50.yuv -b /tmp/out.hevc -pred-struct 0 -lad 1 -hierarchical-levels 3 -encMode 9 -bit-depth 8 -rc 1 -tbr 3000000
-------------------------------------------
SVT-HEVC Encoder
SVT [version]: SVT-HEVC Encoder Lib v1.5.1
SVT [build] : GCC 9.3.0 64 bit
LIB Build date: Jun 22 2021 08:43:14
-------------------------------------------
Number of logical cores available: 72
Number of PPCS 91
-------------------------------------------
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 : 832 / 480 / 0
SVT [config]: FrameRate / Gop Size : 60 / 64
SVT [config]: HierarchicalLevels / BaseLayerSwitchMode / PredStructure : 3 / 0 / 0
SVT [config]: RCMode / TargetBitrate / LAD / SceneChange / QP Range [10 ~ 48] : VBR / 3000000 / 1 / 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
-------------------------------------------
SVT [WARNING] Elevated privileges required to run with real-time policies! Check Linux Best Known Configuration in User Guide to run application in real-time without elevated privileges!
Encoding zsh: floating point exception (core dumped) Bin/Release/SvtHevcEncApp -w 832 -h 480 -i -b /tmp/out.hevc -pred-struct 0
I can encode BasketballDrill_832x480_50 with no issue. Let's try something:
Hi @spartazhc, I reproduced it with gcc-10, but it works OK with gcc-8. It maybe a variable initiation issue. Will work on fixing. Thank you for reporting the issue.
If this issue block you, please revert gcc to 8 before I fix it. Using this method, you can switch gcc versions: https://askubuntu.com/a/26502
Make sure to delete the CMake build folder in Build/linux
before you build.
Hi @spartazhc , the exception is fixed. Let me know if you have other questions.
No other questions for now, thanks a lot for your help
When enable rate control and both
-lad 0 -hierarchical-levels 3
, there will have problem on QP assignment:Command I use:
-lad 0 -hierarchical-levels 3
result:-lad 4 -hierarchical-levels 3
result, normal:Any response would be appreciated!