0

I try to restream my channel to another one with liquidsoap and gstream. I want do that becouse of fallback and use another source if first one it's not used. I got:

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)

I got one problem.. Recognize first stream.. Script don't want to recognize it because it think that it's the file. How to recognize rtmp stream and decode it?

2
  • I try something like: input.http("rtmp://91.121.144.88/live/test"):source(2,1,0) But don't help.. Commented Mar 24, 2016 at 23:50
  • Hey! Have you managed to work this solution with Gstreamer?
    – eirenik0
    Commented Oct 1, 2019 at 13:18

1 Answer 1

2

try this:

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)

Not the answer you're looking for? Browse other questions tagged or ask your own question.