Skip to content

How to record video+audio stream from input.srt? #3954

Answered by vitoyucepi
rrolla asked this question in Q&A
Discussion options

You must be logged in to vote

I made a mistake in on_connect, the correct way to do it is like this:

next_fun = ref(fun () -> null())
def next() =
f = next_fun()
f()
end
# Instantiate the source
default =
fun () ->
request.dynamic(
id=id,
prefetch=prefetch,
timeout=timeout,
retry_delay=1.,
available={not has_stopped()},
next
)

on_connect_ref = ref(fun() -> ())
def on_connect()
  f = on_connect_ref()
  f()
end

liveSource = input.srt(
    bind_address="0.0.0.0",
    mode="listener",
    port=38112,
    pbkeylen=16,
    on_connect=on_connect,
    passphrase="…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@rrolla
Comment options

@vitoyucepi
Comment options

@vitoyucepi
Comment options

Answer selected by rrolla
@rrolla
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants