首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >带回流的Liquidsoap + gstream

带回流的Liquidsoap + gstream
EN

Stack Overflow用户
提问于 2016-03-25 07:40:01
回答 1查看 703关注 0票数 0

我尝试使用liquidsoap和gstream将我的频道重定向到另一个频道。我想这样做是因为回退,如果第一个源没有使用,我会使用另一个源。我得到了:

代码语言:javascript
复制
set("frame.video.width", 1920)
set("frame.video.height", 1080)
#set("frame.video.samplerate", 30)
set("gstreamer.add_borders", false)
set("clock.allow_streaming_errors",false)

s = single("rtmp://link_to_rtmp_stream/test")
s = fallback([s, blank()])

output.gstreamer.audio_video(
  video_pipeline=
    "videoconvert ! x264enc bitrate=4000 ! video/x-h264,profile=baseline ! queue ! mux.",
  audio_pipeline=
    "audioconvert ! voaacenc bitrate=128000 ! queue ! mux.",
  pipeline=
    "flvmux name=mux ! rtmpsink location=\"rtmp://wherewewhantstream.com live=1\"",
  s)

我有一个问题..识别第一个流..脚本不想识别它,因为它认为它就是文件。如何识别rtmp流并解码?

EN

回答 1

Stack Overflow用户

发布于 2016-06-10 06:53:35

试试这个:

代码语言:javascript
复制
set("frame.video.width", 1920)
set("frame.video.height", 1080)
#set("frame.video.samplerate", 30)
set("gstreamer.add_borders", false)
set("clock.allow_streaming_errors",false)

def gstreamer.rtmp(~id="",uri) =
  pipeline = "rtmpsrc location=#{uri} ! tee name=t"
  audio_pipeline = "t. ! queue"
  video_pipeline = "t. ! queue"
  input.gstreamer.audio_video(id=id, pipeline=pipeline, audio_pipeline=audio_pipeline, video_pipeline=video_pipeline)
end

s = gstreamer.rtmp("rtmp://link_to_rtmp_stream/test")
s = fallback([s, blank()])

output.gstreamer.audio_video(
  video_pipeline=
    "videoconvert ! x264enc bitrate=4000 ! video/x-h264,profile=baseline ! queue ! mux.",
  audio_pipeline=
    "audioconvert ! voaacenc bitrate=128000 ! queue ! mux.",
  pipeline=
    "flvmux name=mux ! rtmpsink location=\"rtmp://wherewewhantstream.com live=1\"",
  s)
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36211811

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档