How to record video+audio stream from input.srt? #3954
-
Version:
I'm trying same Error: At /var/liquidsoap/live.liq, line 32, char 127-139:
output.file(fallible=true, mpegtsCopySourceEncoder, {time.string("/var/liquidsoap/recordings/%Y-%m-%d-#{hour}-%M-%S.ts")}, liveSource())
Error 5: this value has type
source('A) where 'A is a set of internal tracks (inferred at /var/liquidsoap/live.liq, line 18, char 17-24)
but it should be a subtype of
source(audio=ffmpeg.copy, video=ffmpeg.copy)
settings.log.level.set(3)
settings.server.log.level.set(3)
settings.log.stdout.set(true)
settings.srt.log.set(true)
settings.srt.log.level.set(3)
# Set SRT log level, one of: “critical”, “error”, “warning”, “notice” or “debug”
settings.srt.log.verbosity.set("warning")
# Set FFMPEG log level, one of: “quiet”, “panic”, “fatal”, “error”, “warning”, “info”, “verbose”, “debug” or “trace”.
settings.ffmpeg.log.verbosity.set("warning")
settings.frame.video.width.set(1920)
settings.frame.video.height.set(1080)
settings.frame.video.framerate.set(50)
liveSource = ref(blank())
sourceRecordingToggle = ref(true)
encodedRecordingToggle = ref(true)
mpegtsCopySourceEncoder = %ffmpeg(
format="mpegts",
%audio.copy,
%video.copy,
)
def record()
timeStamp = time.local()
hour = timeStamp.hour+3
output.file(fallible=true, mpegtsCopySourceEncoder, {time.string("/var/liquidsoap/recordings/%Y-%m-%d-#{hour}-%M-%S.ts")}, liveSource())
{}
end
def startRecord()
thread.run((fun() -> begin record() end))
end
def onConnect()
print("Live connected!")
startRecord()
{}
end
liveSource.set(input.srt(
bind_address="0.0.0.0",
mode="listener",
port=38112,
pbkeylen=16,
on_connect=onConnect,
passphrase="test123456",
streamid="srt",
enforced_encryption=false,
read_timeout=null(),
write_timeout=null()
)
)
output.srt(fallible=true, bind_address="0.0.0.0", port=38113, enforced_encryption=false, mpegtsCopySourceEncoder, liveSource()) |
Beta Was this translation helpful? Give feedback.
Answered by
vitoyucepi
Jun 9, 2024
Replies: 1 comment 4 replies
-
Hi @rrolla, |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I made a mistake in
on_connect
, the correct way to do it is like this:liquidsoap/src/libs/playlist.liq
Lines 254 to 271 in 530afaf