AMF icon indicating copy to clipboard operation
AMF copied to clipboard

[Bug]: <Filler Data is not working correcly in dark scenes on h264 streaming>

Open Benman2785 opened this issue 1 year ago • 9 comments

Describe the bug filler data enabled does NOT work when encoding mostly dark video instead of pushing to 6000kbps it goes down under 1000kbps - what results in huge peaks

To Reproduce Steps to reproduce the behavior:

  1. filler data enabled
  2. stream a very dark scene (like loading screen)

Setup (please complete the following information):

  • OS: Win11 latest
  • Driver Version 23.12.1
  • GPU RX 7700XT Pulse (but same problem even on RX5000 and up
  • Which component has the issue: Encoder

Debug Log (please upload or paste):

not needed

Expected behavior bitrate stays at 6000kbps

Screenshots AMD_AMF_FillerData_Bug

Additional context download http://benmanshafen.de/streamdl/1080p60_amf-1703189298.flv - after i die by a cheater (several times) the bitrate goes down and peaks like crazy (shown in the screenshot)

Benman2785 avatar Dec 21 '23 20:12 Benman2785

OBS AMF FFmpeg CBR // 6000kbps // 2s // Quality // high // b-frames 3 AMF/FFmpeg: Quality=quality Profile=high ProfileLevel=42 MaxNumRefFrames=3 RateControlPreanalysisEnable=1 EnforceHRD=0 FillerDataEnable=true VBVBufferSize=2304000 InitialVBVBufferFullness=64 PeakBitrate=6500000 MinQP=21 MaxQP=48 MaxConsecutiveBPictures=3 BPicturesPattern=2 AdaptiveMiniGOP=true BReferenceEnable=true DeBlockingFilter=true EnableVBAQ=true HighMotionQualityBoostEnable=true HalfPixel=true QuarterPixel=true EnablePreAnalysis=true PASceneChangeDetectionEnable=false PAFrameSadEnable=true PALookAheadBufferDepth=0 PAPerceptualAQMode=1 PATemporalAQMode=2 PAHighMotionQualityBoostMode=1 PACAQStrength=2

Benman2785 avatar Dec 21 '23 20:12 Benman2785

I will show this to rate control folks after holidays. Meanwhile, for experiment could you please try three different runs:

  • EnforceHRD=1
  • RateControlPreanalysisEnable=0 AdaptiveMiniGOP=false and all PA features to false
  • EnablePreAnalysis=false // this parameter works with AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD_PEAK_CONSTRAINED_VBR only

Thanks

MikhailAMD avatar Dec 22 '23 18:12 MikhailAMD

thank you - this "fixes" the bug - but some of those settings would benefit the quality

merry christmas btw :)

Benman2785 avatar Dec 22 '23 19:12 Benman2785

I still want to investigate. Which change does fix the issue?

MikhailAMD avatar Dec 22 '23 20:12 MikhailAMD

i only have to enable HRD - than it works fine ;)

ProfileLevel=42 MaxNumRefFrames=3 RateControlPreanalysisEnable=1 EnforceHRD=1 FillerDataEnable=true VBVBufferSize=2304000 InitialVBVBufferFullness=64 PeakBitrate=6000000 MinQP=21 MaxQP=48 MaxConsecutiveBPictures=3 BPicturesPattern=2 AdaptiveMiniGOP=true BReferenceEnable=true DeBlockingFilter=true EnableVBAQ=true HighMotionQualityBoostEnable=true HalfPixel=true QuarterPixel=true EnablePreAnalysis=true PASceneChangeDetectionEnable=false PAFrameSadEnable=true PALookAheadBufferDepth=0 PAPerceptualAQMode=1 PATemporalAQMode=2 PAHighMotionQualityBoostMode=1 PACAQStrength=2

Benman2785 avatar Dec 23 '23 13:12 Benman2785

resulting in: http://benmanshafen.de/streamdl/1080p60_amf-1703336085.flv

but i forget to use RateControlSkipFrameEnable=false will test with it again now :)

Benman2785 avatar Dec 23 '23 13:12 Benman2785

works fine with HRD enabled - and quality is pretty fine for 1080p60@6000kbps via AMF now we have this: http://benmanshafen.de/streamdl/1080p60_amf-1703337020.flv

with: ProfileLevel=42 MaxNumRefFrames=3 RateControlPreanalysisEnable=1 RateControlSkipFrameEnable=false EnforceHRD=1 FillerDataEnable=true VBVBufferSize=2304000 InitialVBVBufferFullness=64 PeakBitrate=6000000 MinQP=21 MaxQP=48 MaxConsecutiveBPictures=3 BPicturesPattern=2 AdaptiveMiniGOP=true BReferenceEnable=true DeBlockingFilter=true EnableVBAQ=true HighMotionQualityBoostEnable=true HalfPixel=true QuarterPixel=true EnablePreAnalysis=true PASceneChangeDetectionEnable=false PAFrameSadEnable=true PALookAheadBufferDepth=0 PAPerceptualAQMode=1 PATemporalAQMode=2 PAHighMotionQualityBoostMode=1 PACAQStrength=2

Benman2785 avatar Dec 23 '23 14:12 Benman2785

OK, thanks, it seems explicit set EnforceHRD=0 also disables filler data. The fix will be provided in the future drivers.

MikhailAMD avatar Dec 25 '23 16:12 MikhailAMD