Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HEVC decoding problem with newer FFmpeg #73

Open
Mr-Z-2697 opened this issue Sep 30, 2024 · 7 comments
Open

HEVC decoding problem with newer FFmpeg #73

Mr-Z-2697 opened this issue Sep 30, 2024 · 7 comments

Comments

@Mr-Z-2697
Copy link

Mr-Z-2697 commented Sep 30, 2024

Software HEVC decoder sometimes (quite often actually) returns corrupted frames after FFmpeg commit FFmpeg/FFmpeg@4b9adb3, with or without custom patches.
Seemingly after encountering next IDR frame after initial one or after seek. (CRAs seem like no problem)

FFMS2 doesn't have this problem.

Untitled vpy-277-0

@Mr-Z-2697
Copy link
Author

Mr-Z-2697 commented Sep 30, 2024

Some log:

Click to expand
[file @ 000001903cfeccc0] Setting default whitelist 'file,crypto,data'
Probing matroska,webm score:100 size:2048
[matroska,webm @ 000001903f067100] Format matroska,webm probed with size=2048 and score=100
[matroska,webm @ 000001903f067100] Unknown entry 0x22B59D at pos. 4334
[matroska,webm @ 000001903f067100] Unknown entry 0x22B59D at pos. 15203
st:0 removing common factor 1000000 from timebase
st:1 removing common factor 1000000 from timebase
[matroska,webm @ 000001903f067100] Before avformat_find_stream_info() pos: 16440 bytes read:33445 seeks:2 nb_streams:2
[hevc @ 000001903d018140] nal_unit_type: 32(VPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d018140] Decoding VPS
[hevc @ 000001903d018140] Main 10 profile bitstream
[hevc @ 000001903d018140] nal_unit_type: 33(SPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d018140] Decoding SPS
[hevc @ 000001903d018140] Main 10 profile bitstream
[hevc @ 000001903d018140] Decoding VUI
[hevc @ 000001903d018140] nal_unit_type: 34(PPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d018140] Decoding PPS
[hevc @ 000001903d018140] nal_unit_type: 39(SEI_PREFIX), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d018140] Decoding SEI
[matroska,webm @ 000001903f067100] All info found
[matroska,webm @ 000001903f067100] stream 0: start_time: 0 duration: NOPTS
[matroska,webm @ 000001903f067100] stream 1: start_time: 0 duration: NOPTS
[matroska,webm @ 000001903f067100] format: start_time: 0 duration: 1422.09 (estimate from stream) bitrate=4210 kb/s
[matroska,webm @ 000001903f067100] After avformat_find_stream_info() pos: 41029 bytes read:66213 seeks:2 frames:11
[hevc @ 000001903d019300] nal_unit_type: 32(VPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Decoding VPS
[hevc @ 000001903d019300] Main 10 profile bitstream
[hevc @ 000001903d019300] nal_unit_type: 33(SPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Decoding SPS
[hevc @ 000001903d019300] Main 10 profile bitstream
[hevc @ 000001903d019300] Decoding VUI
[hevc @ 000001903d019300] nal_unit_type: 34(PPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Decoding PPS
[hevc @ 000001903d019300] nal_unit_type: 39(SEI_PREFIX), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Decoding SEI
[hevc @ 000001903d019300] nal_unit_type: 32(VPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] nal_unit_type: 33(SPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] nal_unit_type: 34(PPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] nal_unit_type: 39(SEI_PREFIX), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] nal_unit_type: 20(IDR_N_LP), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Decoding SPS
[hevc @ 000001903d019300] Main 10 profile bitstream
[hevc @ 000001903d019300] Decoding VUI
[hevc @ 000001903d019300] Decoding PPS
[hevc @ 000001903d019300] Decoding SEI
[hevc @ 000001903d019300] Format yuv420p10le chosen by get_format().
[hevc @ 000001903d019300] Decoded frame with POC 0/0.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Decoded frame with POC 0/9.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/0.
[hevc @ 000001903d019300] Decoded frame with POC 0/5.
Script evaluation done in 0.12 seconds
[hevc @ 000001903d019300] nal_unit_type: 32(VPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] nal_unit_type: 33(SPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] nal_unit_type: 34(PPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] nal_unit_type: 39(SEI_PREFIX), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] nal_unit_type: 20(IDR_N_LP), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Decoding SPS
[hevc @ 000001903d019300] Main 10 profile bitstream
[hevc @ 000001903d019300] Decoding VUI
[hevc @ 000001903d019300] Decoding PPS
[hevc @ 000001903d019300] Decoding SEI
[hevc @ 000001903d019300] Decoded frame with POC 0/0.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Decoded frame with POC 0/9.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/0.
[hevc @ 000001903d019300] Decoded frame with POC 0/5.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/1.
[hevc @ 000001903d019300] Decoded frame with POC 0/1.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/2.
[hevc @ 000001903d019300] Decoded frame with POC 0/2.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/3.
[hevc @ 000001903d019300] Decoded frame with POC 0/3.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/4.
[hevc @ 000001903d019300] Decoded frame with POC 0/4.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/5.
[hevc @ 000001903d019300] Decoded frame with POC 0/6.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/6.
[hevc @ 000001903d019300] Decoded frame with POC 0/7.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/7.
[hevc @ 000001903d019300] Decoded frame with POC 0/8.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/8.
[hevc @ 000001903d019300] Decoded frame with POC 0/18.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/9.
[hevc @ 000001903d019300] Decoded frame with POC 0/14.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/10.
[hevc @ 000001903d019300] Decoded frame with POC 0/10.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/11.
[hevc @ 000001903d019300] Decoded frame with POC 0/11.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/12.
[hevc @ 000001903d019300] Decoded frame with POC 0/12.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/13.
[hevc @ 000001903d019300] Decoded frame with POC 0/13.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/14.
[hevc @ 000001903d019300] Decoded frame with POC 0/15.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/15.
[hevc @ 000001903d019300] Decoded frame with POC 0/16.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/16.
[hevc @ 000001903d019300] Decoded frame with POC 0/17.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/17.
[hevc @ 000001903d019300] Decoded frame with POC 0/21.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/18.
[hevc @ 000001903d019300] Decoded frame with POC 0/20.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/19.
[hevc @ 000001903d019300] Decoded frame with POC 0/19.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/20.
[hevc @ 000001903d019300] Decoded frame with POC 0/23.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/21.
[hevc @ 000001903d019300] Decoded frame with POC 0/22.
[hevc @ 000001903d019300] nal_unit_type: 32(VPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] nal_unit_type: 33(SPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] nal_unit_type: 34(PPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] nal_unit_type: 20(IDR_N_LP), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Decoding SPS
[hevc @ 000001903d019300] Main 10 profile bitstream
[hevc @ 000001903d019300] Decoding VUI
[hevc @ 000001903d019300] Decoding PPS
[hevc @ 000001903d019300] Output frame with POC 0/22.
[hevc @ 000001903d019300] Output frame with POC 0/23.
[hevc @ 000001903d019300] Decoded frame with POC 0/0.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Decoded frame with POC 0/4.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Could not find ref with POC 2
[hevc @ 000001903d019300] Output frame with POC 0/0.
[hevc @ 000001903d019300] Decoded frame with POC 0/1.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Could not find ref with POC 2
[hevc @ 000001903d019300] Output frame with POC 0/1.
[hevc @ 000001903d019300] Decoded frame with POC 0/3.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Could not find ref with POC 2
[hevc @ 000001903d019300] Output frame with POC 0/3.
[hevc @ 000001903d019300] Decoded frame with POC 0/13.
[hevc @ 000001903d019300] nal_unit_type: 32(VPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] nal_unit_type: 33(SPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] nal_unit_type: 34(PPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] nal_unit_type: 39(SEI_PREFIX), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] nal_unit_type: 20(IDR_N_LP), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Decoding SPS
[hevc @ 000001903d019300] Main 10 profile bitstream
[hevc @ 000001903d019300] Decoding VUI
[hevc @ 000001903d019300] Decoding PPS
[hevc @ 000001903d019300] Decoding SEI
[hevc @ 000001903d019300] Decoded frame with POC 0/0.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Decoded frame with POC 0/9.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/0.
[hevc @ 000001903d019300] Decoded frame with POC 0/5.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/1.
[hevc @ 000001903d019300] Decoded frame with POC 0/1.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/2.
[hevc @ 000001903d019300] Decoded frame with POC 0/2.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/3.
[hevc @ 000001903d019300] Decoded frame with POC 0/3.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/4.
[hevc @ 000001903d019300] Decoded frame with POC 0/4.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/5.
[hevc @ 000001903d019300] Decoded frame with POC 0/6.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/6.
[hevc @ 000001903d019300] Decoded frame with POC 0/7.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/7.
[hevc @ 000001903d019300] Decoded frame with POC 0/8.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/8.
[hevc @ 000001903d019300] Decoded frame with POC 0/18.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/9.
[hevc @ 000001903d019300] Decoded frame with POC 0/14.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/10.
[hevc @ 000001903d019300] Decoded frame with POC 0/10.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/11.
[hevc @ 000001903d019300] Decoded frame with POC 0/11.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/12.
[hevc @ 000001903d019300] Decoded frame with POC 0/12.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/13.
[hevc @ 000001903d019300] Decoded frame with POC 0/13.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/14.
[hevc @ 000001903d019300] Decoded frame with POC 0/15.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/15.
[hevc @ 000001903d019300] Decoded frame with POC 0/16.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/16.
[hevc @ 000001903d019300] Decoded frame with POC 0/17.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/17.
[hevc @ 000001903d019300] Decoded frame with POC 0/21.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/18.
[hevc @ 000001903d019300] Decoded frame with POC 0/20.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/19.
[hevc @ 000001903d019300] Decoded frame with POC 0/19.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/20.
[hevc @ 000001903d019300] Decoded frame with POC 0/23.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/21.
[hevc @ 000001903d019300] Decoded frame with POC 0/22.
[hevc @ 000001903d019300] nal_unit_type: 32(VPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] nal_unit_type: 33(SPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] nal_unit_type: 34(PPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] nal_unit_type: 20(IDR_N_LP), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Decoding SPS
[hevc @ 000001903d019300] Main 10 profile bitstream
[hevc @ 000001903d019300] Decoding VUI
[hevc @ 000001903d019300] Decoding PPS
[hevc @ 000001903d019300] Output frame with POC 0/22.
[hevc @ 000001903d019300] Output frame with POC 0/23.
[hevc @ 000001903d019300] Decoded frame with POC 0/0.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Decoded frame with POC 0/4.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Could not find ref with POC 2
[hevc @ 000001903d019300] Output frame with POC 0/0.
[hevc @ 000001903d019300] Decoded frame with POC 0/1.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Could not find ref with POC 2
[hevc @ 000001903d019300] Output frame with POC 0/1.
[hevc @ 000001903d019300] Decoded frame with POC 0/3.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Could not find ref with POC 2
[hevc @ 000001903d019300] Output frame with POC 0/3.
[hevc @ 000001903d019300] Decoded frame with POC 0/13.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Could not find ref with POC 2
[hevc @ 000001903d019300] Output frame with POC 0/4.
[hevc @ 000001903d019300] Decoded frame with POC 0/9.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Could not find ref with POC 2
[hevc @ 000001903d019300] Output frame with POC 0/5.
[hevc @ 000001903d019300] Decoded frame with POC 0/5.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Could not find ref with POC 2
[hevc @ 000001903d019300] Output frame with POC 0/6.
[hevc @ 000001903d019300] Decoded frame with POC 0/6.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Could not find ref with POC 2
[hevc @ 000001903d019300] Output frame with POC 0/7.
[hevc @ 000001903d019300] Decoded frame with POC 0/7.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Could not find ref with POC 2
[hevc @ 000001903d019300] Output frame with POC 0/8.
[hevc @ 000001903d019300] Decoded frame with POC 0/8.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Could not find ref with POC 2
[hevc @ 000001903d019300] Output frame with POC 0/9.
[hevc @ 000001903d019300] Decoded frame with POC 0/10.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Could not find ref with POC 2
[hevc @ 000001903d019300] Output frame with POC 0/10.
[hevc @ 000001903d019300] Decoded frame with POC 0/11.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Could not find ref with POC 2
[hevc @ 000001903d019300] Output frame with POC 0/11.
[hevc @ 000001903d019300] Decoded frame with POC 0/12.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Could not find ref with POC 2
[hevc @ 000001903d019300] Output frame with POC 0/12.
[hevc @ 000001903d019300] Decoded frame with POC 0/20.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Could not find ref with POC 2
[hevc @ 000001903d019300] Output frame with POC 0/13.
[hevc @ 000001903d019300] Decoded frame with POC 0/17.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/14.
[hevc @ 000001903d019300] Decoded frame with POC 0/14.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/15.
[hevc @ 000001903d019300] Decoded frame with POC 0/15.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/16.
[hevc @ 000001903d019300] Decoded frame with POC 0/16.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/17.
[hevc @ 000001903d019300] Decoded frame with POC 0/18.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/18.
[hevc @ 000001903d019300] Decoded frame with POC 0/19.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/19.
[hevc @ 000001903d019300] Decoded frame with POC 0/22.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/20.
[hevc @ 000001903d019300] Decoded frame with POC 0/21.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/21.
[hevc @ 000001903d019300] Decoded frame with POC 0/29.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/22.
[hevc @ 000001903d019300] Decoded frame with POC 0/26.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/23.
[hevc @ 000001903d019300] Decoded frame with POC 0/23.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/24.
[hevc @ 000001903d019300] Decoded frame with POC 0/24.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/25.
[hevc @ 000001903d019300] Decoded frame with POC 0/25.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/26.
[hevc @ 000001903d019300] Decoded frame with POC 0/27.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/27.
[hevc @ 000001903d019300] Decoded frame with POC 0/28.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/28.
[hevc @ 000001903d019300] Decoded frame with POC 0/36.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/29.
[hevc @ 000001903d019300] Decoded frame with POC 0/33.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/30.
[hevc @ 000001903d019300] Decoded frame with POC 0/30.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/31.
[hevc @ 000001903d019300] Decoded frame with POC 0/31.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/32.
[hevc @ 000001903d019300] Decoded frame with POC 0/32.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/33.
[hevc @ 000001903d019300] Decoded frame with POC 0/34.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/34.
[hevc @ 000001903d019300] Decoded frame with POC 0/35.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/35.
[hevc @ 000001903d019300] Decoded frame with POC 0/43.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/36.
[hevc @ 000001903d019300] Decoded frame with POC 0/40.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/37.
[hevc @ 000001903d019300] Decoded frame with POC 0/37.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/38.
[hevc @ 000001903d019300] Decoded frame with POC 0/38.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/39.
[hevc @ 000001903d019300] Decoded frame with POC 0/39.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/40.
[hevc @ 000001903d019300] Decoded frame with POC 0/41.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/41.
[hevc @ 000001903d019300] Decoded frame with POC 0/42.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/42.
[hevc @ 000001903d019300] Decoded frame with POC 0/50.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/43.
[hevc @ 000001903d019300] Decoded frame with POC 0/47.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/44.
[hevc @ 000001903d019300] Decoded frame with POC 0/44.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/45.
[hevc @ 000001903d019300] Decoded frame with POC 0/45.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/46.
[hevc @ 000001903d019300] Decoded frame with POC 0/46.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/47.
[hevc @ 000001903d019300] Decoded frame with POC 0/48.
[hevc @ 000001903d019300] nal_unit_type: 0(TRAIL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 000001903d019300] Output frame with POC 0/48.
[hevc @ 000001903d019300] Decoded frame with POC 0/49.
[hevc @ 000001903d019300] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0.

@Mr-Z-2697
Copy link
Author

I think we need to implement some measure to deal with AVERROR( EAGAIN ) in packet sending instead of just ignore it (if I understand it correctly)

ret = avcodec_send_packet( ctx, pkt );
if( ret < 0
&& ret != AVERROR_EOF /* No more packets can be sent if true. */
&& ret != AVERROR( EAGAIN ) ) /* Must receive output frames before sending new packets if true. */
return ret;
}

@Mr-Z-2697
Copy link
Author

Mr-Z-2697 commented Oct 5, 2024

Note: these builds are VapourSynth only

Can someone test this LSMASHSource-f-around.7z.gz (it's actually a 7z archive)

Codebase: (ideally you should build it yourself)
Mr-Z-2697@0bc64e9
https://github.com/Mr-Z-2697/FFmpeg/tree/LW120241005-test
Additional component:
dav1d
vpx
libjxl
xevd
libvpl
libxml2
vvdec
ffnvcodec

Here's the problematic build, the current main branch code of this repo with all the same libraries.
LSMASHSource.7z.gz

@Asd-g
Copy link
Contributor

Asd-g commented Dec 15, 2024

Can you test the attached version?

LSMASHSource_ffmpeg_b164dea.zip

@Mr-Z-2697
Copy link
Author

Mr-Z-2697 commented Dec 15, 2024

Can you test the attached version?

LSMASHSource_ffmpeg_b164dea.zip

It has the problem.

What's your thought about my "finding"?

@Asd-g
Copy link
Contributor

Asd-g commented Dec 17, 2024

Thanks for the testing.

I had time to look at the things. The issue is this commit and the related.

If by "finding" you mean this change, yes, it's main part of the issue. Unfortunately it's not so simple to handle it and this fix doesn't work - download these samples, open CANON.MXF file, frames 63 and 64 are same (with your fix) but they shouldn't be.

@Mr-Z-2697
Copy link
Author

Thanks for the testing.

I had time to look at the things. The issue is this commit and the related.

If by "finding" you mean this change, yes, it's main part of the issue. Unfortunately it's not so simple to handle it and this fix doesn't work - download these samples, open CANON.MXF file, frames 63 and 64 are same (with your fix) but they shouldn't be.

It seems to happen only when temporal layers are used.
I have no idea why it's happening and how to fix it.

The "EAGAIN loop" should better be protected by a codec id check, by the way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants