Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

srt2hls - how to generate index.m3u8 from multiple inputs without re-encoding? #3477

Closed
LifelessMuffin opened this issue Oct 18, 2023 · 0 comments
Labels

Comments

@LifelessMuffin
Copy link

LifelessMuffin commented Oct 18, 2023

Hi guys, I would like to transmux the 3 inputs (with different bitrates) into 3 individual playlists (high.m3u8; mid.m3u8; low.m3u8) which are then indexed into the master playlist index.m3u8. When re-encoding a single input as shown in the examples it works fine, the index,m3u8 file is generated along the other playlists (ABR). But how to achieve the same without re-encoding and with 3 inputs?
This is my script:

settings.root.max_latency.set(5.)
settings.clock.allow_streaming_errors.set(false)

input_a = input.srt(port=9000, mode="listener")
input_b = input.srt(port=9001, mode="listener")
input_c = input.srt(port=9002, mode="listener")

transmux_high = %ffmpeg(format="mpegts", %audio.copy, %video.copy)
transmux_medium = %ffmpeg(format="mpegts", %audio.copy, %video.copy)
transmux_low = %ffmpeg(format="mpegts", %audio.copy, %video.copy)

high_stream = [("transmux_high",transmux_high)]
medium_stream = [("transmux_medium",transmux_medium)]
low_stream = [("transmux_low",transmux_low)]

def segment_name(~position,~extname,stream_name) =
  timestamp = int_of_float(time())
  duration = 2
  "#{stream_name}_#{duration}_#{timestamp}_#{position}.#{extname}"
end

output.file.hls(
                playlist="high.m3u8",
                fallible=true,
                segment_duration=2.0,
                segments=5,
                segments_overhead=5,
                segment_name=segment_name,
                "/var/www/liquidsoap/hls",
                high_stream,
                input_a
               )

output.file.hls(
                playlist="medium.m3u8",
                fallible=true,
                segment_duration=2.0,
                segments=5,
                segments_overhead=5,
                segment_name=segment_name,
                "/var/www/liquidsoap/hls",
                medium_stream,
                input_b
               )

output.file.hls(
                playlist="low.m3u8",
                fallible=true,
                segment_duration=2.0,
                segments=5,
                segments_overhead=5,
                segment_name=segment_name,
                "/var/www/liquidsoap/hls",
                low_stream,
                input_c
                )
@savonet savonet locked and limited conversation to collaborators Oct 21, 2023
@toots toots converted this issue into discussion #3485 Oct 21, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

1 participant