小编Ash*_*sad的帖子

gstreamer 1.0 + python:从播放管道动态链接和取消链接队列

我正在尝试实现的管道架构

当两个队列在将管道设置为 之前链接在一起时,该脚本运行良好PLAYING,但我很难理解 Gstreamer 动态管道及其实现。此外,缺乏 gstreamer 1.0 python 的文档/示例也没有帮助。

这是使用 tee 录制到文件并流式传输到 RTMP 服务器的工作脚本

import gi
import time
from gi.repository import GObject, Gst
gi.require_version('Gst', '1.0')

Gst.init(None)

Gst.debug_set_active(True)
Gst.debug_set_default_threshold(3)
pipeline = Gst.Pipeline()

rpicamsrc = Gst.ElementFactory.make("rpicamsrc", "rpicam")
rpicamsrc.set_property("bitrate", 500000)
rpicaps = Gst.caps_from_string('video/x-h264,width=360,height=240,framerate=10/1')
rCamCapsFilt = Gst.ElementFactory.make("capsfilter", "rCamCapsFilt")
rCamCapsFilt.set_property("caps", rpicaps)

h264parse = Gst.ElementFactory.make("h264parse", "h264")
h264parse2 = Gst.ElementFactory.make("h264parse", "enh2642")

flvmux = Gst.ElementFactory.make("flvmux", "flv")
mp4mux = Gst.ElementFactory.make("mp4mux", "mp4")

filesink = Gst.ElementFactory.make("filesink", "fsink")
filesink.set_property("location", "specific2.mp4")

rtmpsink = Gst.ElementFactory.make("rtmpsink", "rsink")
rtmpsink.set_property("location", "rtmp://<server>/live/test")

tee = Gst.ElementFactory.make("tee", "tee") …
Run Code Online (Sandbox Code Playgroud)

python gstreamer python-gstreamer raspberry-pi gstreamer-1.0

5
推荐指数
1
解决办法
1151
查看次数