ffmpeg - gstreamer 通过 udp 接收和重新组合 h.264 视频
问题描述
我正在尝试从 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
我会尝试使用这些选项并报告。
解决方案
您正在尝试处理 GStreamer 管道中的原始视频,即使它应该处理 H.264 编码视频。尝试类似(未经测试的命令):
gst-launch-1.0 -v playbin2 uri=udp://0.0.0.0:6038
推荐阅读
- ios - 在从路径和基本 URL 创建 URL 的 iPad 上,如果基本 URL 位于存储设备上,则生成的 URL 会丢弃基本 URL 的最后一个组成部分
- matlab - 在matlab中使用shadedErrorBar时不能使用默认颜色以外的颜色
- c# - 如何使用 JsonWebTokenHandler web api 创建 JWT 身份验证令牌?
- wordpress - Woocommerce 插件导致服务器过载
- django - 服务器记录了 200 的 HTTP 状态代码,但 Chrome HAR 显示 403 - HTTP 状态代码可以更改吗?
- flutter - 如何在注册按钮颤动中使用 CircularProgressIndicator
- angular - 如何避免这些方法的执行顺序?(角度)
- python-3.x - 为什么我通过在我的代码中以不同的顺序放置“年”和“年”得到不同的输出
- c# - 当我尝试将图像放入 GridView1 时出现此错误。请问谁能帮我解决
- java - 是否可以将所有 Unicode 或 UTF 8 位存储到字符串中?