savonet / liquidsoap

Liquidsoap is a statically typed scripting general-purpose language with dedicated operators and backend for all thing media, streaming, file generation, automation, HTTP backend and more.
http://liquidsoap.info
GNU General Public License v2.0
1.39k stars 126 forks source link

Multi SRT input fails #3513

Open LifelessMuffin opened 9 months ago

LifelessMuffin commented 9 months ago

Describe the bug Hi toots, there are still some issues with the multi SRT to HLS script from some weeks ago (reference to #3485 ) it basically crashes.

To Reproduce Script:

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

let {video = video_a, audio = audio_a} = source.tracks(input_a)
let {video = video_b, audio = audio_b} = source.tracks(input_b)
let {video = video_c, audio = audio_c} = source.tracks(input_c)

muxed_input =
  source(
    {
      audio_a=audio_a,
      audio_b=audio_b,
      audio_c=audio_c,
      video_a=video_a,
      video_b=video_b,
      video_c=video_c
    }
  )

streams =
  [
    (
      "transmux_high",
      %ffmpeg(
        format = "mpegts",
        %audio_a.copy,
        %audio_b.drop,
        %audio_c.drop,
        %video_a.copy,
        %video_b.drop,
        %video_c.drop
      )
    ),
    (
      "transmux_medium",
      %ffmpeg(
        format = "mpegts",
        %audio_a.drop,
        %audio_b.copy,
        %audio_c.drop,
        %video_a.drop,
        %video_b.copy,
        %video_c.drop
      )
    ),
    (
      "transmux_low",
      %ffmpeg(
        format = "mpegts",
        %audio_a.drop,
        %audio_b.drop,
        %audio_c.copy,
        %video_a.drop,
        %video_b.drop,
        %video_c.copy
      )
    )
  ]

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

output.file.hls(
  fallible=true,
  segment_duration=2.0,
  segments=5,
  segments_overhead=5,
  segment_name=segment_name,
  "/tmp/hls",
  streams,
  muxed_input
)

Output:

INFO: Loading Sdl_image, Target = linux
INFO: Loading Sdl_ttf, Target = linux
At test.liq, line 77, char 0-0:

Error 9: Failure: invalid content field
Raised at Stdlib.failwith in file "stdlib.ml", line 29, characters 17-33
Called from Lang_ffmpeg.parse_encoder_name in file "src/core/encoder/lang/lang_ffmpeg.ml", line 160, characters 13-45
Called from Lang_ffmpeg.type_of_encoder.(fun) in file "src/core/encoder/lang/lang_ffmpeg.ml", line 202, characters 30-53
Called from Stdlib__List.fold_left in file "list.ml", line 121, characters 24-34
Called from Lang_encoder.type_of_encoder in file "src/core/encoder/lang_encoder.ml", line 131, characters 15-32
Called from Liquidsoap_lang__Typechecking.check.(fun) in file "src/lang/typechecking.ml", line 194, characters 16-45
Called from Liquidsoap_lang__Typechecking.check.(fun).check in file "src/lang/typechecking.ml", line 141, characters 4-39
Called from Stdlib__List.iter in file "list.ml", line 110, characters 12-15
Called from Liquidsoap_lang__Typechecking.check.(fun) in file "src/lang/typechecking.ml", line 208, characters 10-52
Called from Liquidsoap_lang__Typechecking.check.(fun).check in file "src/lang/typechecking.ml", line 141, characters 4-39
Called from Stdlib__List.iter in file "list.ml", line 110, characters 12-15
Called from Liquidsoap_lang__Typechecking.check.(fun) in file "src/lang/typechecking.ml", line 203, characters 10-52
Called from Liquidsoap_lang__Typechecking.check.(fun).check in file "src/lang/typechecking.ml", line 141, characters 4-39
Called from Liquidsoap_lang__Typechecking.check.(fun) in file "src/lang/typechecking.ml", line 346, characters 10-43
Called from Liquidsoap_lang__Typechecking.check.(fun).check in file "src/lang/typechecking.ml", line 141, characters 4-39
Called from Liquidsoap_lang__Typechecking.check.(fun) in file "src/lang/typechecking.ml", line 390, characters 10-48
Called from Liquidsoap_lang__Typechecking.check.(fun).check in file "src/lang/typechecking.ml", line 141, characters 4-39
Called from Liquidsoap_lang__Typechecking.check.(fun) in file "src/lang/typechecking.ml", line 390, characters 10-48
Called from Liquidsoap_lang__Typechecking.check.(fun).check in file "src/lang/typechecking.ml", line 141, characters 4-39
Called from Liquidsoap_lang__Typechecking.check.(fun) in file "src/lang/typechecking.ml", line 390, characters 10-48
Called from Liquidsoap_lang__Typechecking.check.(fun).check in file "src/lang/typechecking.ml", line 141, characters 4-39
Called from Liquidsoap_lang__Typechecking.check.(fun) in file "src/lang/typechecking.ml", line 390, characters 10-48
Called from Liquidsoap_lang__Typechecking.check.(fun).check in file "src/lang/typechecking.ml", line 141, characters 4-39
Called from Liquidsoap_lang__Typechecking.check.(fun) in file "src/lang/typechecking.ml", line 390, characters 10-48
Called from Liquidsoap_lang__Typechecking.check.(fun).check in file "src/lang/typechecking.ml", line 141, characters 4-39
Called from Liquidsoap_lang__Typechecking.check.(fun) in file "src/lang/typechecking.ml", line 390, characters 10-48
Called from Liquidsoap_lang__Typechecking.check.(fun).check in file "src/lang/typechecking.ml", line 141, characters 4-39
Called from Liquidsoap_lang__Typechecking.check.(fun) in file "src/lang/typechecking.ml", line 390, characters 10-48
Called from Liquidsoap_lang__Typechecking.check in file "src/lang/typechecking.ml", line 420, characters 4-48
Re-raised at Liquidsoap_lang__Typechecking.check in file "src/lang/typechecking.ml", line 429, characters 4-38
Called from Liquidsoap_lang__Startup.time in file "src/lang/startup.ml", line 30, characters 12-16
Called from Liquidsoap_lang__Runtime.type_and_run.(fun) in file "src/lang/runtime.ml", line 33, characters 9-105
Called from Stdlib__Fun.protect in file "fun.ml", line 33, characters 8-15
Re-raised at Stdlib__Fun.protect in file "fun.ml", line 38, characters 6-52
Called from Liquidsoap_lang__Runtime.type_and_run in file "src/lang/runtime.ml", line 30, characters 4-612
Called from Liquidsoap_lang__Runtime.report in file "src/lang/runtime.ml" (inlined), line 215, characters 12-23
Called from Liquidsoap_lang__Runtime.from_lexbuf in file "src/lang/runtime.ml", line 229, characters 2-159

Version details

Install method Installed from .deb installer

toots commented 9 months ago

Sorry I'm just seeing this. Will have a look asap.