h264parse element hangs with some video streams
Describe your issue
Possible regression: the h264parse element can hang with some video streams that work with previous versions, such as 1.22.1. From the logs, it appears to get into an infinite loop reporting skipping 0
and reparsing the same data indefinitely. The attached debug logs for the element may be helpful.
Expected Behavior
The h264parse element should always proceed.
Observed Behavior
The h264parse element hangs without reporting any errors for some streams. A previous gstreamer version 1.22.1, reading the same streams at the same time, did not have any issues.
Setup
- Operating System: Ubuntu 20.04
- Device: Computer
- GStreamer Version: 1.24.1
- Command line:
Steps to reproduce the bug
For some streams, this will happen with any command line directly or indirectly using h264parse. I have not been able to determine the exact nature of video streams that reproduce this, but I was able to capture h264parse debug logs when the problem occurred.
How reproducible is the bug?
Intermittent
Screenshots if relevant
Solutions you have tried
Related non-duplicate issues
Additional Information
h264parse gsth264parse.c:1970:gst_h264_parse_handle_frame:<h264parse0> not a complete nal found at offset 59984
h264parse gsth264parse.c:1912:gst_h264_parse_handle_frame:<h264parse0> last parse position 59981
codecparsers_h264 gsth264parser.c:250:gst_h264_parse_nalu_header: Nal type 1, ref_idc 2
codecparsers_h264 gsth264parser.c:1577:gst_h264_parser_identify_nalu: Complete nal found. Off: 59984, Size: 28706
h264parse gsth264parse.c:1949:gst_h264_parse_handle_frame: complete nal (offset, size): (59984, 28706)
h264parse gsth264parse.c:1534:gst_h264_parse_update_backlog: vcl nal (1) added to backlog
codecparsers_h264 gsth264parser.c:2467:gst_h264_parser_parse_slice_hdr: parsing "Slice header", slice type 5
codecparsers_h264 gsth264parser.c:775:gst_h264_slice_parse_pred_weight_table: parsing "Prediction weight table"
codecparsers_h264 gsth264parser.c:709:gst_h264_slice_parse_dec_ref_pic_marking: parsing "Decoded reference picture marking"
h264parse gsth264parse.c:1058:gst_h264_parse_process_nal: processing nal of type 12 Filler Data, size 110
h264parse gsth264parse.c:2112:gst_h264_parse_handle_frame: skipping 59981
h264parse gsth264parse.c:250:gst_h264_parse_reset_frame: reset frame
h264parse gsth264parse.c:250:gst_h264_parse_reset_frame: reset frame
h264parse gsth264parse.c:1912:gst_h264_parse_handle_frame: last parse position 0
codecparsers_h264 gsth264parser.c:250:gst_h264_parse_nalu_header: Nal type 1, ref_idc 2
codecparsers_h264 gsth264parser.c:250:gst_h264_parse_nalu_header: Nal type 1, ref_idc 2
codecparsers_h264 gsth264parser.c:1577:gst_h264_parser_identify_nalu: Complete nal found. Off: 3, Size: 28706
h264parse gsth264parse.c:1949:gst_h264_parse_handle_frame: complete nal (offset, size): (3, 28706)
h264parse gsth264parse.c:1534:gst_h264_parse_update_backlog: vcl nal (1) added to backlog
codecparsers_h264 gsth264parser.c:2467:gst_h264_parser_parse_slice_hdr: parsing "Slice header", slice type 5
codecparsers_h264 gsth264parser.c:775:gst_h264_slice_parse_pred_weight_table: parsing "Prediction weight table"
codecparsers_h264 gsth264parser.c:709:gst_h264_slice_parse_dec_ref_pic_marking: parsing "Decoded reference picture marking"
h264parse gsth264parse.c:1058:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 28706
h264parse gsth264parse.c:2112:gst_h264_parse_handle_frame: skipping 0
Once the "skipping 0" happens, it seems to loop forever trying to parse the same thing, this exact pattern repeats forever
codecparsers_h264 gsth264parser.c:1577:gst_h264_parser_identify_nalu: Complete nal found. Off: 3, Size: 28706
h264parse gsth264parse.c:1949:gst_h264_parse_handle_frame: complete nal (offset, size): (3, 28706)
h264parse gsth264parse.c:1534:gst_h264_parse_update_backlog: vcl nal (1) added to backlog
codecparsers_h264 gsth264parser.c:2467:gst_h264_parser_parse_slice_hdr: parsing "Slice header", slice type 5
codecparsers_h264 gsth264parser.c:775:gst_h264_slice_parse_pred_weight_table: parsing "Prediction weight table"
codecparsers_h264 gsth264parser.c:709:gst_h264_slice_parse_dec_ref_pic_marking: parsing "Decoded reference picture marking"
h264parse gsth264parse.c:1058:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 28706
h264parse gsth264parse.c:2112:gst_h264_parse_handle_frame: skipping 0
h264parse gsth264parse.c:250:gst_h264_parse_reset_frame: reset frame
h264parse gsth264parse.c:1912:gst_h264_parse_handle_frame: last parse position 0
codecparsers_h264 gsth264parser.c:250:gst_h264_parse_nalu_header: Nal type 1, ref_idc 2
codecparsers_h264 gsth264parser.c:250:gst_h264_parse_nalu_header: Nal type 1, ref_idc 2
codecparsers_h264 gsth264parser.c:1577:gst_h264_parser_identify_nalu: Complete nal found. Off: 3, Size: 28706
h264parse gsth264parse.c:1949:gst_h264_parse_handle_frame: complete nal (offset, size): (3, 28706)
h264parse gsth264parse.c:1534:gst_h264_parse_update_backlog: vcl nal (1) added to backlog
codecparsers_h264 gsth264parser.c:2467:gst_h264_parser_parse_slice_hdr: parsing "Slice header", slice type 5
codecparsers_h264 gsth264parser.c:775:gst_h264_slice_parse_pred_weight_table: parsing "Prediction weight table"
codecparsers_h264 gsth264parser.c:709:gst_h264_slice_parse_dec_ref_pic_marking: parsing "Decoded reference picture marking"
h264parse gsth264parse.c:1058:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 28706
...repeats forever, apparently "skipping 0" and reparsing the same thing