AMF icon indicating copy to clipboard operation
AMF copied to clipboard

[Question]: <is ~2s audio delay normal when using QP_I + QP_P + QP_B?>

Open Benman2785 opened this issue 1 year ago • 7 comments
trafficstars

Hi,

i use OBS AMFenc FFmpeg:

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 QPI=21 QPP=18 QPB=14 CABACEnable=true

with this settings i get around 2s =2000ms audio delay :/ without QPI=21 QPP=18 QPB=14 it does work fine

Benman2785 avatar Dec 24 '23 00:12 Benman2785

3x 500ms render delay + -485ms (audio delay) and audio is now a little to early (will tinker around with it)

http://benmanshafen.de/streamdl/1080p60_amf-1703378621.flv

quality is way better - as i suspect that AMF uses same QP for p and b as from last i frame - but quality improves if they use a lower qp

Benman2785 avatar Dec 24 '23 00:12 Benman2785

ok - was just a different system bug - now today everything is fine :)

Benman2785 avatar Dec 24 '23 12:12 Benman2785

yet: quality is way better - as i suspect that AMF uses same QP for p and b as from last i frame - but quality improves if they use a lower qp

Benman2785 avatar Dec 24 '23 14:12 Benman2785

ProfileLevel=42 MaxNumRefFrames=3 RateControlPreanalysisEnable=1 RateControlSkipFrameEnable=false EnforceHRD=1 FillerDataEnable=true VBVBufferSize=2304000 InitialVBVBufferFullness=64 PeakBitrate=6000000 MinQP=21 MaxQP=46 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 QPI=21 QPP=16 QPB=14 CABACEnable=true

creates: http://benmanshafen.de/streamdl/1080p60_amf-1703455199.flv

Benman2785 avatar Dec 24 '23 22:12 Benman2785

Let's separate issues:

  • Seems AV sync is resolved
  • Regarding QPI, QPP, QPB: setting them only matters for CQP rate control mode. In the clip above QP varies from MinQP to MaxQP as they should (21-46). Am I missing something?
  • Limiting MinQP and MaxQP increases quality but may not allow to get target bitrate

MikhailAMD avatar Dec 25 '23 17:12 MikhailAMD

AV sync sporadicly is out of sync - but my windows is pretty messy - yet still could be driver related // or OBS

would be nice to use QPI=XX QPP=XX QPB=XX in CBR especially because lower QP for P and B would benefit quality.

so: set MaxQP and use minQPI minQPP minQPB = we can increase quality (as p and b frames with lower QP provide better quality while still "stay" within bitrate - as minQPI=21 take like 2x more bitrate as minQPP=16 or 3x more bitrate than minQPB=14 per frame

Benman2785 avatar Dec 25 '23 23:12 Benman2785

the audio delay was caused by "use device timestamps" in OBS

Benman2785 avatar Jan 02 '24 14:01 Benman2785