gstreamer получает и повторно обрабатывает видео h.264 через udp - PullRequest
0 голосов
/ 30 апреля 2019

Я пытаюсь захватить видеопоток с дрона Tello с gstreamer

Я пробовал с gstreamer конвейером

gst-launch-1.0 -v udpsrc buffer-size=622080 skip-first-bytes=2 port=6038 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)RAW,width=(string)960, height=(string)720, payload=(int)96, a-framerate=25" \
    ! queue \
    ! rtpvrawdepay \
    ! autovideosink

Но это выходы (с export GST_DEBUG=*:3)

WARNING: from element /GstPipeline:pipeline0/GstRtpVRawDepay:rtpvrawdepay0: Could not decode stream.
Additional debug info:
gstrtpbasedepayload.c(506): GstFlowReturn gst_rtp_base_depayload_handle_buffer(GstRTPBaseDepayload *, GstRTPBaseDepayloadClass *, GstBuffer *) (): /GstPipeline:pipeline0/GstRtpVRawDepay:rtpvrawdepay0:

Информацию о потоке можно посмотреть здесь: https://github.com/m6c7l/dji-ryze-tello/tree/master/example/video

Видео может быть передано в ffmpeg с помощью следующей команды ffmpeg -i - -f image2pipe -pix_fmt rgb24 -vcodec rawvideo -

Мне не хватает конвейера gstreamer, который может объединить эти NAL в кадр h264.

Обновление: вывод с playbin

Я попытался запустить команду с export GST_DEBUG=*:3 и несколько раз получаю следующий вывод:

gst-launch-1.0 -v playbin uri=udp://0.0.0.0:6038
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: ring-buffer-max-size = 0
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: buffer-size = -1
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: buffer-duration = -1
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: use-buffering = false
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: download = false
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: uri = udp://0.0.0.0:6038
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: connection-speed = 0
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: source = "\(GstUDPSrc\)\ source"
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src: caps = video/x-h264, stream-format=(string)byte-stream
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstH264Parse:h264parse0.GstPad:sink: caps = video/x-h264, stream-format=(string)byte-stream
0:01:19.923679000  3202 0x7f9639857320 WARN               h264parse gsth264parse.c:1351:gst_h264_parse_handle_frame:<h264parse0> broken/invalid nal Type: 1 Slice, Size: 16113 will be dropped
0:01:19.924320000  3202 0x7f9639857320 WARN               h264parse gsth264parse.c:1351:gst_h264_parse_handle_frame:<h264parse0> broken/invalid nal Type: 1 Slice, Size: 17237 will be dropped
0:01:19.925063000  3202 0x7f9639857320 WARN       codecparsers_h264 gsth264parser.c:2039:gst_h264_parse_pps: failed to read SE
0:01:19.925075000  3202 0x7f9639857320 WARN       codecparsers_h264 gsth264parser.c:2046:gst_h264_parse_pps: error parsing "Picture parameter set"
0:01:19.925081000  3202 0x7f9639857320 WARN               h264parse gsth264parse.c:882:gst_h264_parse_process_nal:<h264parse0> failed to parse PPS:
0:01:19.925089000  3202 0x7f9639857320 WARN               h264parse gsth264parse.c:1351:gst_h264_parse_handle_frame:<h264parse0> broken/invalid nal Type: 8 PPS, Size: 5 will be dropped
0:01:19.925106000  3202 0x7f9639857320 WARN       codecparsers_h264 gsth264parser.c:2039:gst_h264_parse_pps: failed to read SE

Я попробую поэкспериментировать с опциями и доложить.

1 Ответ

0 голосов
/ 06 мая 2019

Вы пытаетесь обработать необработанное видео в своем конвейере GStreamer, даже если оно должно обрабатывать видео в кодировке H.264.Попробуйте что-то вроде (команда не проверена):

gst-launch-1.0 -v playbin2 uri = udp: //0.0.0.0: 6038

...