gpt4 book ai didi

video-streaming - 使用 gstreamer 通过 rtp 流式传输 H.264 视频

转载 作者:行者123 更新时间:2023-12-03 20:51:30 37 4
gpt4 key购买 nike

我是 gstreamer 的新手,我正在尝试使用它。我的第一个目标是在两个设备之间创建一个简单的 h264 视频 rtp 流。我正在使用这两个管道:

发件人:gst-launch-1.0 -v filesrc location=c:\\tmp\\sample_h264.mov ! x264enc ! rtph264pay ! udpsink host=127.0.0.1 port=5000
接收者:gst-launch-1.0 -v udpsrc port=5000 ! rtpmp2tdepay ! decodebin ! autovideosink
但是对于第一个(发件人),我收到以下错误:

Setting pipeline to PAUSED ...
Pipeline is PE*R*O L(LgIsNtG- l.a.u.n
h-1.0:5788): CRITICAL **: gst_adapter_map: assertion `size > 0' failed
ERROR: from element /GstPipeline:pipeline0/GstFileSrc:filesrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2812): gst_base_src_loop (): /GstPipeline:pipeline0/GstFileSrc:filesrc0:
streaming task paused, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

我尝试了很多其他配置,但找不到合适的管道。

一些其他信息:
Gstreamer 版本:1.0.7
操作系统:Windows 7

任何想法/建议?
谢谢,

最佳答案

filesrc将从给定文件中读取数据作为原始字节;你不能只用 x264enc 编码这些原始字节,您将需要视频数据才能工作。在重新编码流之前尝试添加解复用器/解码器),例如像这样:

发件人:

gst-launch-1.0 -v \
filesrc location=/tmp/sample_h264.mov
! qtdemux \
! h264parse \
! ffdec_h264 \
! ffmpegcolorspace \
! x264enc \
! rtph264pay \
! udpsink host=127.0.0.1 port=5000

您应该使用测试视频源快速检查这是否有效:
gst-launch-1.0 -v \
videotestsrc
! x264enc \
! rtph264pay \
! udpsink host=127.0.0.1 port=5000

关于video-streaming - 使用 gstreamer 通过 rtp 流式传输 H.264 视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17313985/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com