Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two AMD (ROCm/AMF) fixes, both found on an RX 9070 XT:
1.
'NoneType' object has no attribute 'numerator'during AMF decode (jasna/media/video_decoder.py)Cause: For videos with an undeclared sample aspect ratio (codecpar SAR
0/1— common in MKV files), PyAV 18 returnsNonefromsample_aspect_ratio._setup_amf_decoder()copied thatNoneonto the AMF decoder context, and PyAV's setter crashed readingNone.numerator.AttributeErrorwas also not caught by the software-decode fallback, so the job died. NVIDIA is unaffected (NVDEC path never copies the SAR).Fix: Fall back to square pixels when the source SAR is unknown, and catch
AttributeErrorin the fallback:SAR-less videos now decode normally through AMF hardware decoding, and any future setup error still degrades to software decoding as designed.
2. Smart rendering fails on H.264 sources with more than 3 consecutive B-frames (
jasna/pipeline.py)Cause: Smart rendering must match the source's encoding parameters in re-rendered segments. AMF's H.264 encoder caps at 3 consecutive B-frames (NVENC accepts more), so sources using 4+ (e.g. stock x264
bframes=4encodes) raisedSmartRenderCompatibilityError: AMF H.264 smart rendering supports at most 3 consecutive B-framesand the job failed.Fix: In
_run_smart(), detect the case (AMD device + H.264 +max_b_frames > 3from the keyframe index) and fall back to_run_full()— a normal full re-encode — instead of failing:The original error in
_amf_h264_settings()is kept as a safety net; the NVIDIA path and all other smart-render validations are unchanged.