Anonymous
Проблема с декодированием h.264 с помощью Gstreamer
Сообщение
Anonymous » 15 янв 2025, 15:22
У меня проблема с декодированием файла h.264. Конвейер Gstreamer завершается сбоем со следующим сообщением:
Код: Выделить всё
...................
0:00:01.968415100 2374 0x3fa0000b70 DEBUG v4l2videodec gstv4l2videodec.c:1156:gst_v4l2_vidRedistribute latency...
eo_dec_sink_getcaps: Returning sink caps video/x-h264, width=(int)[ 48, 4096 ], height=(int)[ 16, 2304 ], framerate=(fraction)[ 0/1, 2147483647/1 ], stream-format=(string)byte-stream, alignment=(string)au, level=(string){ 1, 1b, 1.1, 1.2, 1.3, 2, 2.1, 2.2, 3, 3.1, 3.2, 4, 4.1, 4.2, 5, 5.1 }, profile=(string){ baseline, constrained-baseline, main, high }, colorimetry=(string){ bt709, bt601, smpte240m, 1:3:5:1, 2:4:5:2, 2:4:5:3, 1:4:7:1, 2:4:7:1, 2:4:12:8, bt2020, 2:0:0:0 }, parsed=(boolean)true
0:00:01.969251400 2374 0x3fa0000b70 DEBUG h264parse gsth264parse.c:1897:ensure_caps_profile: Setting compatible profile high to the caps
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = video/x-h264, width=(int)320, height=(int)240, framerate=(fraction)0/1, coded-picture-structure=(string)frame, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, colorimetry=(string)2:4:5:4, parsed=(boolean)true, stream-format=(string)byte-stream, alignment=(string)au, profile=(string)high, level=(string)1.3
0:00:01.970644300 2374 0x3fa0000b70 DEBUG v4l2videodec gstv4l2videodec.c:1156:gst_v4l2_video_dec_sink_getcaps: Returning sink caps EMPTY
0:00:01.971063200 2374 0x3fa0000b70 LOG h264parse gsth264parse.c:2657:gst_h264_parse_get_timestamp: Upstream ts 0:00:00.000000000
0:00:01.971347300 2374 0x3fa0000b70 DEBUG h264parse gsth264parse.c:2674:gst_h264_parse_get_timestamp: unable to compute timestamp: timing info not present
0:00:01.971434900 2374 0x3fa0000b70 DEBUG h264parse gsth264parse.c:2575:gst_h264_parse_get_duration: unable to compute duration: timing info not present
0:00:01.972205200 2374 0x3fa0000b70 DEBUG v4l2videodec gstv4l2videodec.c:1156:gst_v4l2_video_dec_sink_getcaps: Returning sink caps EMPTY
0:00:01.972825600 2374 0x3fa0000b70 DEBUG h264parse gsth264parse.c:3268:gst_h264_parse_pre_push_frame: Inserting AUD into the stream.
0:00:01.972947300 2374 0x3fa0000b70 DEBUG h264parse gsth264parse.c:225:gst_h264_parse_reset_frame: reset frame
0:00:01.973267700 2374 0x3fa0000b70 DEBUG v4l2videodec gstv4l2videodec.c:1156:gst_v4l2_video_dec_sink_getcaps: Returning sink caps EMPTY
0:00:01.973586100 2374 0x3fa0000b70 DEBUG v4l2videodec gstv4l2videodec.c:1156:gst_v4l2_video_dec_sink_getcaps: Returning sink caps EMPTY
ERROR: from element /GstPipeline:pipeline0/GstH264Parse:h264parse0: Internal data stream error.
Additional debug info:
../gstreamer-1.22.12/libs/gst/base/gstbaseparse.c(3699): gst_base_parse_loop (): /GstPipeline:pipeline0/GstH264Parse:h264parse0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
0:00:01.974780200 2374 0x3fa0000b70 DEBUG v4l2videodec gstv4l2videodec.c:1156:gst_v4l2_vidSetting pipeline to NULL ...
eo_dec_sink_getcaps: Returning sink caps EMPTY
Выполнить команду:
Код: Выделить всё
export GST_DEBUG=h264parse:7,v4l2videodec:7
gst-launch-1.0 -vvv --no-fault filesrc location=./test-25fps.h264 num-buffers=10 ! h264parse ! v4l2h264dec ! video/x-raw,format=I420 ! filesink location=./out.yuv
Похоже, что драйвер устройства не поддерживает колориметрию
2:4:5:4 , что соответствует
Код: Выделить всё
colorimetry.range = GST_VIDEO_COLOR_RANGE_16_235;
colorimetry.matrix = GST_VIDEO_COLOR_MATRIX_BT601;
colorimetry.transfer = GST_VIDEO_TRANSFER_BT709;
colorimetry.primaries = GST_VIDEO_COLOR_PRIMARIES_SMPTE170M;
[Ссылка на исходный код gst:
https://gitlab.freedesktop.org/gstreame ... /gst-libs/ gst/video/video-color.h?ref_type=heads#L42]
Но я понятия не имею, что мне нужно исправить или реализовать в моем драйвере для поддержки
2:4:5:4 колориметрия. Я не нашел никакого дескриптора для управления этими параметрами, например, для поддерживаемых уровней и профилей, путем создания соответствующих клавиш управления.
Подробнее здесь:
https://stackoverflow.com/questions/793 ... -gstreamer
1736943776
Anonymous
У меня проблема с декодированием файла h.264. Конвейер Gstreamer завершается сбоем со следующим сообщением: [code]................... 0:00:01.968415100 2374 0x3fa0000b70 DEBUG v4l2videodec gstv4l2videodec.c:1156:gst_v4l2_vidRedistribute latency... eo_dec_sink_getcaps: Returning sink caps video/x-h264, width=(int)[ 48, 4096 ], height=(int)[ 16, 2304 ], framerate=(fraction)[ 0/1, 2147483647/1 ], stream-format=(string)byte-stream, alignment=(string)au, level=(string){ 1, 1b, 1.1, 1.2, 1.3, 2, 2.1, 2.2, 3, 3.1, 3.2, 4, 4.1, 4.2, 5, 5.1 }, profile=(string){ baseline, constrained-baseline, main, high }, colorimetry=(string){ bt709, bt601, smpte240m, 1:3:5:1, 2:4:5:2, 2:4:5:3, 1:4:7:1, 2:4:7:1, 2:4:12:8, bt2020, 2:0:0:0 }, parsed=(boolean)true 0:00:01.969251400 2374 0x3fa0000b70 DEBUG h264parse gsth264parse.c:1897:ensure_caps_profile: Setting compatible profile high to the caps /GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = video/x-h264, width=(int)320, height=(int)240, framerate=(fraction)0/1, coded-picture-structure=(string)frame, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, colorimetry=(string)2:4:5:4, parsed=(boolean)true, stream-format=(string)byte-stream, alignment=(string)au, profile=(string)high, level=(string)1.3 0:00:01.970644300 2374 0x3fa0000b70 DEBUG v4l2videodec gstv4l2videodec.c:1156:gst_v4l2_video_dec_sink_getcaps: Returning sink caps EMPTY 0:00:01.971063200 2374 0x3fa0000b70 LOG h264parse gsth264parse.c:2657:gst_h264_parse_get_timestamp: Upstream ts 0:00:00.000000000 0:00:01.971347300 2374 0x3fa0000b70 DEBUG h264parse gsth264parse.c:2674:gst_h264_parse_get_timestamp: unable to compute timestamp: timing info not present 0:00:01.971434900 2374 0x3fa0000b70 DEBUG h264parse gsth264parse.c:2575:gst_h264_parse_get_duration: unable to compute duration: timing info not present 0:00:01.972205200 2374 0x3fa0000b70 DEBUG v4l2videodec gstv4l2videodec.c:1156:gst_v4l2_video_dec_sink_getcaps: Returning sink caps EMPTY 0:00:01.972825600 2374 0x3fa0000b70 DEBUG h264parse gsth264parse.c:3268:gst_h264_parse_pre_push_frame: Inserting AUD into the stream. 0:00:01.972947300 2374 0x3fa0000b70 DEBUG h264parse gsth264parse.c:225:gst_h264_parse_reset_frame: reset frame 0:00:01.973267700 2374 0x3fa0000b70 DEBUG v4l2videodec gstv4l2videodec.c:1156:gst_v4l2_video_dec_sink_getcaps: Returning sink caps EMPTY 0:00:01.973586100 2374 0x3fa0000b70 DEBUG v4l2videodec gstv4l2videodec.c:1156:gst_v4l2_video_dec_sink_getcaps: Returning sink caps EMPTY ERROR: from element /GstPipeline:pipeline0/GstH264Parse:h264parse0: Internal data stream error. Additional debug info: ../gstreamer-1.22.12/libs/gst/base/gstbaseparse.c(3699): gst_base_parse_loop (): /GstPipeline:pipeline0/GstH264Parse:h264parse0: streaming stopped, reason not-negotiated (-4) ERROR: pipeline doesn't want to preroll. 0:00:01.974780200 2374 0x3fa0000b70 DEBUG v4l2videodec gstv4l2videodec.c:1156:gst_v4l2_vidSetting pipeline to NULL ... eo_dec_sink_getcaps: Returning sink caps EMPTY [/code] Выполнить команду: [code]export GST_DEBUG=h264parse:7,v4l2videodec:7 gst-launch-1.0 -vvv --no-fault filesrc location=./test-25fps.h264 num-buffers=10 ! h264parse ! v4l2h264dec ! video/x-raw,format=I420 ! filesink location=./out.yuv [/code] Похоже, что драйвер устройства не поддерживает колориметрию [b]2:4:5:4[/b], что соответствует [code]colorimetry.range = GST_VIDEO_COLOR_RANGE_16_235; colorimetry.matrix = GST_VIDEO_COLOR_MATRIX_BT601; colorimetry.transfer = GST_VIDEO_TRANSFER_BT709; colorimetry.primaries = GST_VIDEO_COLOR_PRIMARIES_SMPTE170M; [/code] [Ссылка на исходный код gst: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/blob/discontinued-for-monorepo/gst-libs/ gst/video/video-color.h?ref_type=heads#L42] Но я понятия не имею, что мне нужно исправить или реализовать в моем драйвере для поддержки [b]2:4:5:4[/b] колориметрия. Я не нашел никакого дескриптора для управления этими параметрами, например, для поддерживаемых уровней и профилей, путем создания соответствующих клавиш управления. Подробнее здесь: [url]https://stackoverflow.com/questions/79358197/issue-with-decoding-h-264-with-gstreamer[/url]