26 lines
1.1 KiB
Plaintext
26 lines
1.1 KiB
Plaintext
# Stream live via RTMP. You need the following Gstreamer plugins: flvmux, rtmpsink, x264enc and a suitable AAC encoder (see @audio_encoder@ params).
|
|
# @param ~id Source ID
|
|
# @param ~video_bitrate Video bitrate
|
|
# @param ~audio_encoder Audio encoder. Can be one of: "fdkaacenc", "voaacenc"
|
|
# @param ~audio_bitrate Audio bitrate
|
|
# @param ~url Server URL
|
|
# @param ~key Secret key
|
|
# @param source Source to stream
|
|
# @category Source / Output
|
|
def output.rtmp.live(~id="",
|
|
~video_bitrate=2000,
|
|
~audio_encoder="fdkaacenc",
|
|
~audio_bitrate=128000,
|
|
~url="rtmp://icynet.eu:1935/live",
|
|
~key,
|
|
source) =
|
|
video_pipeline = "videoconvert ! \
|
|
x264enc bitrate=#{video_bitrate} byte-stream=false key-int-max=60 bframes=0 aud=true tune=zerolatency ! \
|
|
video/x-h264,profile=main ! queue ! mux."
|
|
audio_pipeline = "audioconvert ! #{audio_encoder} bitrate=#{audio_bitrate} ! queue ! mux."
|
|
pipeline = "flvmux streamable=true name=mux ! rtmpsink location=\"#{url}/#{key}\""
|
|
|
|
output.gstreamer.audio_video(id=id,video_pipeline=video_pipeline,
|
|
audio_pipeline=audio_pipeline,pipeline=pipeline,source)
|
|
end
|