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.42k stars 130 forks source link

Error when encoding data: Avutil.Error(Broken pipe) #2854

Closed TheRealMattLear closed 1 year ago

TheRealMattLear commented 1 year ago

Describe the bug Seeing the below error after starting liquidsoap while the input is already active. If the input is not active and starts after liquidsoap is up and running then the problem does not seem to occur. It's been a tough one to pin down and can't seem to replicate it outside of the docker environment strangely.

Error

[rtmp @ 0x7ff7fc4c6f80] 2023/01/16 10:40:42 [output.url:4] Error when encoding data: Avutil.Error(Broken pipe)
2023/01/16 10:40:42 [output.url:4] Raised by primitive operation at Stdlib__List.iter in file "list.ml", line 110, characters 12-15
2023/01/16 10:40:42 [output.url:4] Called from Stdlib__Option.map in file "option.ml", line 24, characters 57-62
2023/01/16 10:40:42 [output.url:4] Called from Ffmpeg_encoder_common.encode in file "encoder/ffmpeg_encoder_common.ml", line 103, characters 4-80
2023/01/16 10:40:42 [output.url:4] Called from Ffmpeg_encoder_common.encoder.encode in file "encoder/ffmpeg_encoder_common.ml", line 226, characters 4-44
2023/01/16 10:40:42 [output.url:4] Called from Pipe_output.url_output#encode in file "outputs/pipe_output.ml", line 117, characters 10-36
2023/01/16 10:40:42 [output.url:4]

To Reproduce

log.level.set(4)

settings.init.allow_root.set(true);
settings.ffmpeg.log.verbosity.set("debug")
settings.ffmpeg.content.copy.relaxed_compatibility_check.set(true)

settings.scheduler.non_blocking_queues.set(3)
settings.scheduler.generic_queues.set(3)
settings.scheduler.fast_queues.set(3)

# Direct live input on this node
live_stream = input.ffmpeg(
    self_sync=true,
    max_buffer=20.,
    poll_delay=5.,
    log_overfull=false,
    format="live_flv",
    int_args=[("listen", 0)],
    "rtmp://127.0.0.1/static/test"
)
live_stream = ffmpeg.filter.bitstream.h264_mp4toannexb(live_stream)

# Fallback Video
fallback_video = single("/home/vod/sample.mp4");
fallback_video = ffmpeg.filter.bitstream.h264_mp4toannexb(fallback_video)

# Automatically switch between live stream and fall video
s = fallback(track_sensitive=false,[live_stream,fallback_video])
s = ffmpeg.filter.bitstream.aac_adtstoasc(s)

flv = %ffmpeg(
  format="flv",
  fflags="-autobsf",
  %audio.copy, %video.copy)

output.url(
  fallible=true,
  url="rtmp://127.0.0.1:1935/output/test?password=secret",
  flv,
  s
  )

Output

2023/01/16 10:40:30 >>> LOG START
2023/01/16 10:40:27 [main:3] Liquidsoap 2.1.2
2023/01/16 10:40:27 [main:3] Using: bytes=[distributed with OCaml 4.02 or above] posix-time2=2.0.0 pcre=7.5.0 sedlex=3.0 menhirLib=20220210 curl=0.9.2 uri=4.2.0 memtrace=v0.2.2 mem_usage=0.0.4 dtools=0.4.4 duppy=0.9.3 cry=0.6.8 mm=0.8.2 xmlplaylist=0.1.5 lastfm=0.3.3 ogg=0.7.3 ogg.decoder=0.7.3 vorbis=0.8.1 vorbis.decoder=0.8.1 opus=0.2.3 opus.decoder=0.2.3 speex=0.4.1 speex.decoder=0.4.1 mad=0.5.2 flac=0.3.0 flac.ogg=0.3.0 flac.decoder=0.3.0 dynlink=[distributed with Ocaml] lame=0.3.6 shine=0.2.3 frei0r=0.1.2 fdkaac=0.3.2 theora=0.4.0 theora.decoder=0.4.0 ffmpeg=1.1.6 bjack=0.1.6 alsa=0.3.0 ao=0.2.4 samplerate=0.1.6 taglib=0.3.10 ssl=0.5.11 magic=0.7.3 camomile=1.0.2 inotify=2.3 faad=0.5.2 soundtouch=0.1.9 portaudio=0.2.3 pulseaudio=0.1.5 ladspa=0.2.2 dssi=0.1.5 tsdl=v0.9.9 tsdl-ttf=0.3.2 tsdl-image=0.3.2 camlimages=4.2.6 camlimages.freetype=5.0.4 cohttp-lwt-unix=5.0.0 prometheus-app=1.2 srt.constants=0.2.2 srt.types=0.2.2 srt.stubs=0.2.2 srt.stubs.locked=0.2.2 srt=0.2.2 lo=0.2.0 gd=1.0a5 irc-client-unix=[unspecified]
2023/01/16 10:40:27 [clock:3] Using native (high-precision) implementation for latency control
2023/01/16 10:40:30 [frame:4] frame.audio.samplerate set to: 44100
2023/01/16 10:40:30 [frame:4] frame.video.framerate set to: 25
2023/01/16 10:40:30 [frame:4] frame.audio.channels set to: 2
2023/01/16 10:40:30 [frame:4] frame.video.default set to: false
2023/01/16 10:40:30 [frame:4] frame.midi.channels set to: 0
2023/01/16 10:40:30 [frame:4] frame.video.width set to: 1280
2023/01/16 10:40:30 [frame:4] frame.video.height set to: 720
2023/01/16 10:40:30 [frame:4] frame.audio.samplerate set to: 44100
2023/01/16 10:40:30 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz main.
2023/01/16 10:40:30 [frame:3] Video frame size set to: 1280x720
2023/01/16 10:40:30 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
2023/01/16 10:40:30 [frame:3] Targeting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
2023/01/16 10:40:30 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
2023/01/16 10:40:30 [sandbox:3] Sandboxing disabled
2023/01/16 10:40:30 [video.converter:3] Using preferred video converter: ffmpeg.
2023/01/16 10:40:30 [audio.converter:3] Using samplerate converter: libsamplerate.
2023/01/16 10:40:30 [clock:4] Currently 2 clock(s) allocated.
2023/01/16 10:40:30 [clock.aac_adtstoasc.producer_0.child:4] Starting 2 source(s)...
2023/01/16 10:40:30 [source:4] Source input.ffmpeg_0 gets up with content kind: {audio=ffmpeg.audio.copy,video=ffmpeg.video.copy,midi=none}.
2023/01/16 10:40:30 [source:4] Source aac_adtstoasc.consumer_0 gets up with content kind: {audio=ffmpeg.audio.copy,video=ffmpeg.video.copy,midi=none}.
2023/01/16 10:40:30 [aac_adtstoasc.consumer_0:4] Content type is {audio=ffmpeg.audio.copy,video=ffmpeg.video.copy,midi=none}.
2023/01/16 10:40:30 [source:4] Source switch_0 gets up with content kind: {audio=ffmpeg.audio.copy,video=ffmpeg.video.copy,midi=none}.
2023/01/16 10:40:30 [source:4] Source single_0 gets up with content kind: {audio=ffmpeg.audio.copy,video=ffmpeg.video.copy,midi=none}.
2023/01/16 10:40:30 [single_0:3] "/var/www/html/storage/app/fallback/kw4dvhao/fallback.mp4" is static, resolving once for all...
2023/01/16 10:40:30 [decoder.ogg:4] Unsupported file extension for "/var/www/html/storage/app/fallback/kw4dvhao/fallback.mp4"!
2023/01/16 10:40:30 [decoder.ogg:4] Unsupported MIME type for "/var/www/html/storage/app/fallback/kw4dvhao/fallback.mp4": video/mp4!
2023/01/16 10:40:30 [decoder.srt:4] Unsupported file extension for "/var/www/html/storage/app/fallback/kw4dvhao/fallback.mp4"!
2023/01/16 10:40:30 [decoder.srt:4] Unsupported MIME type for "/var/www/html/storage/app/fallback/kw4dvhao/fallback.mp4": video/mp4!
2023/01/16 10:40:30 [decoder:4] Available decoders: FFMPEG (priority: 10), IMAGE (priority: 1)
2023/01/16 10:40:30 [decoder:4] Trying decoder "FFMPEG"
[NULL @ 0x7ff810009180] Opening '/var/www/html/storage/app/fallback/kw4dvhao/fallback.mp4' for reading
[file @ 0x7ff810009b80] Setting default whitelist 'file,crypto,data'
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810009180] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810009180] ISO: File Type Major Brand: mp42
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810009180] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810009180] Processing st: 0, edit list 0 - media time: 0, duration: 498060
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810009180] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810009180] Processing st: 1, edit list 0 - media time: 1024, duration: 267264
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810009180] drop a frame at curr_cts: 0 @ 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810009180] Before avformat_find_stream_info() pos: 6267 bytes read:32768 seeks:0 nb_streams:2
[h264 @ 0x7ff81000ad40] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x7ff81000ad40] nal_unit_type: 8(PPS), nal_ref_idc: 3
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810009180] demuxer injecting skip 1024 / discard 0
[aac @ 0x7ff810011600] skip 1024 / discard 0 samples due to side data
[h264 @ 0x7ff81000ad40] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x7ff81000ad40] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff81000ad40] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff81000ad40] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff81000ad40] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff81000ad40] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff81000ad40] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff81000ad40] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff81000ad40] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff81000ad40] Format yuv420p chosen by get_format().
[h264 @ 0x7ff81000ad40] Reinit context to 1280x720, pix_fmt: yuv420p
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810009180] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810009180] After avformat_find_stream_info() pos: 60263 bytes read:65536 seeks:0 frames:2
2023/01/16 10:40:30 [decoder.ffmpeg:4] ffmpeg recognizes "/var/www/html/storage/app/fallback/kw4dvhao/fallback.mp4" as: audio: {codec: aac, 48000Hz, 1 channel(s)}, video: {codec: h264, 1280x720, yuv420p} and content-type: {audio=ffmpeg.audio.copy(sample_rate=48000,sample_format=fltp,channel_layout="mono",codec="aac"),video=ffmpeg.video.copy(pixel_format=yuv420p,aspect_ratio=63/64,height=720,width=1280,codec="h264"),midi=none}.
[AVIOContext @ 0x7ff810011f40] Statistics: 65536 bytes read, 0 seeks
2023/01/16 10:40:30 [decoder:4] Selected decoder FFMPEG for file "/var/www/html/storage/app/fallback/kw4dvhao/fallback.mp4" with expected kind {audio=ffmpeg.audio.copy(sample_rate=48000,sample_format=fltp,channel_layout="mono",codec="aac"),video=ffmpeg.video.copy(pixel_format=yuv420p,aspect_ratio=63/64,height=720,width=1280,codec="h264"),midi=none} and detected content {audio=ffmpeg.audio.copy(sample_rate=48000,sample_format=fltp,channel_layout="mono",codec="aac"),video=ffmpeg.video.copy(pixel_format=yuv420p,aspect_ratio=63/64,height=720,width=1280,codec="h264"),midi=none}
[NULL @ 0x7ff810009180] Opening '/var/www/html/storage/app/fallback/kw4dvhao/fallback.mp4' for reading
[file @ 0x7ff810009c80] Setting default whitelist 'file,crypto,data'
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810009180] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810009180] ISO: File Type Major Brand: mp42
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810009180] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810009180] Processing st: 0, edit list 0 - media time: 0, duration: 498060
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810009180] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810009180] Processing st: 1, edit list 0 - media time: 1024, duration: 267264
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810009180] drop a frame at curr_cts: 0 @ 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810009180] Before avformat_find_stream_info() pos: 6267 bytes read:32768 seeks:0 nb_streams:2
[h264 @ 0x7ff81000f2c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x7ff81000f2c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810009180] demuxer injecting skip 1024 / discard 0
[aac @ 0x7ff810036680] skip 1024 / discard 0 samples due to side data
[h264 @ 0x7ff81000f2c0] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x7ff81000f2c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff81000f2c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff81000f2c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff81000f2c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff81000f2c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff81000f2c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff81000f2c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff81000f2c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff81000f2c0] Format yuv420p chosen by get_format().
[h264 @ 0x7ff81000f2c0] Reinit context to 1280x720, pix_fmt: yuv420p
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810009180] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810009180] After avformat_find_stream_info() pos: 60263 bytes read:65536 seeks:0 frames:2
[AVIOContext @ 0x7ff81000d9c0] Statistics: 65536 bytes read, 0 seeks
2023/01/16 10:40:30 [metadata.flac:4] Unsupported file extension for "/var/www/html/storage/app/fallback/kw4dvhao/fallback.mp4"!
2023/01/16 10:40:30 [metadata.flac:4] Unsupported MIME type for "/var/www/html/storage/app/fallback/kw4dvhao/fallback.mp4": video/mp4!
2023/01/16 10:40:30 [metadata.mp4:4] Unsupported MIME type for "/var/www/html/storage/app/fallback/kw4dvhao/fallback.mp4": video/mp4!
2023/01/16 10:40:30 [decoder.ogg:4] Unsupported file extension for "/var/www/html/storage/app/fallback/kw4dvhao/fallback.mp4"!
2023/01/16 10:40:30 [decoder.ogg:4] Unsupported MIME type for "/var/www/html/storage/app/fallback/kw4dvhao/fallback.mp4": video/mp4!
2023/01/16 10:40:30 [decoder.id3:4] Unsupported file extension for "/var/www/html/storage/app/fallback/kw4dvhao/fallback.mp4"!
2023/01/16 10:40:30 [decoder.id3:4] Unsupported MIME type for "/var/www/html/storage/app/fallback/kw4dvhao/fallback.mp4": video/mp4!
2023/01/16 10:40:30 [decoder.id3:4] Unsupported file extension for "/var/www/html/storage/app/fallback/kw4dvhao/fallback.mp4"!
2023/01/16 10:40:30 [decoder.id3:4] Unsupported MIME type for "/var/www/html/storage/app/fallback/kw4dvhao/fallback.mp4": video/mp4!
2023/01/16 10:40:30 [decoder.id3:4] Unsupported file extension for "/var/www/html/storage/app/fallback/kw4dvhao/fallback.mp4"!
2023/01/16 10:40:30 [decoder.id3:4] Unsupported MIME type for "/var/www/html/storage/app/fallback/kw4dvhao/fallback.mp4": video/mp4!
2023/01/16 10:40:30 [decoder.image.metadata:4] Unsupported file extension for "/var/www/html/storage/app/fallback/kw4dvhao/fallback.mp4"!
2023/01/16 10:40:30 [decoder.image.metadata:4] Unsupported MIME type for "/var/www/html/storage/app/fallback/kw4dvhao/fallback.mp4": video/mp4!
[NULL @ 0x7ff810037a40] Opening '/var/www/html/storage/app/fallback/kw4dvhao/fallback.mp4' for reading
[file @ 0x7ff810108240] Setting default whitelist 'file,crypto,data'
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810037a40] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810037a40] ISO: File Type Major Brand: mp42
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810037a40] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810037a40] Processing st: 0, edit list 0 - media time: 0, duration: 498060
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810037a40] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810037a40] Processing st: 1, edit list 0 - media time: 1024, duration: 267264
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810037a40] drop a frame at curr_cts: 0 @ 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810037a40] Before avformat_find_stream_info() pos: 6267 bytes read:32768 seeks:0 nb_streams:2
[h264 @ 0x7ff81001d140] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x7ff81001d140] nal_unit_type: 8(PPS), nal_ref_idc: 3
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810037a40] demuxer injecting skip 1024 / discard 0
[aac @ 0x7ff810009180] skip 1024 / discard 0 samples due to side data
[h264 @ 0x7ff81001d140] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x7ff81001d140] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff81001d140] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff81001d140] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff81001d140] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff81001d140] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff81001d140] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff81001d140] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff81001d140] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff81001d140] Format yuv420p chosen by get_format().
[h264 @ 0x7ff81001d140] Reinit context to 1280x720, pix_fmt: yuv420p
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810037a40] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff810037a40] After avformat_find_stream_info() pos: 60263 bytes read:65536 seeks:0 frames:2
[AVIOContext @ 0x7ff810011cc0] Statistics: 65536 bytes read, 0 seeks
[NULL @ 0x7ff8100f6340] Opening '/var/www/html/storage/app/fallback/kw4dvhao/fallback.mp4' for reading
[file @ 0x7ff81002ca80] Setting default whitelist 'file,crypto,data'
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff8100f6340] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff8100f6340] ISO: File Type Major Brand: mp42
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff8100f6340] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff8100f6340] Processing st: 0, edit list 0 - media time: 0, duration: 498060
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff8100f6340] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff8100f6340] Processing st: 1, edit list 0 - media time: 1024, duration: 267264
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff8100f6340] drop a frame at curr_cts: 0 @ 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff8100f6340] Before avformat_find_stream_info() pos: 6267 bytes read:32768 seeks:0 nb_streams:2
[h264 @ 0x7ff810064580] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x7ff810064580] nal_unit_type: 8(PPS), nal_ref_idc: 3
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff8100f6340] demuxer injecting skip 1024 / discard 0
[aac @ 0x7ff810037a40] skip 1024 / discard 0 samples due to side data
[h264 @ 0x7ff810064580] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x7ff810064580] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff810064580] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff810064580] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff810064580] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff810064580] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff810064580] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff810064580] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff810064580] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff810064580] Format yuv420p chosen by get_format().
[h264 @ 0x7ff810064580] Reinit context to 1280x720, pix_fmt: yuv420p
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff8100f6340] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ff8100f6340] After avformat_find_stream_info() pos: 60263 bytes read:65536 seeks:0 frames:2
2023/01/16 10:40:31 [single_0:3] Prepared "/var/www/html/storage/app/fallback/kw4dvhao/fallback.mp4" (RID 0).
2023/01/16 10:40:31 [clock.main:4] Starting 1 source(s)...
2023/01/16 10:40:31 [source:4] Source output.file_0 gets up with content kind: {audio=ffmpeg.audio.copy(sample_rate=48000,sample_format=fltp,channel_layout="mono",codec="aac"),video=ffmpeg.video.copy(pixel_format=yuv420p,aspect_ratio=63/64,height=720,width=1280,codec="h264"),midi=none}.
2023/01/16 10:40:31 [output.url:4] Content type is {audio=ffmpeg.audio.copy(sample_rate=48000,sample_format=fltp,channel_layout="mono",codec="aac"),video=ffmpeg.video.copy(pixel_format=yuv420p,aspect_ratio=63/64,height=720,width=1280,codec="h264"),midi=none}.
2023/01/16 10:40:31 [source:4] Source aac_adtstoasc.producer_0 gets up with content kind: {audio=ffmpeg.audio.copy(sample_rate=48000,sample_format=fltp,channel_layout="mono",codec="aac"),video=ffmpeg.video.copy(pixel_format=yuv420p,aspect_ratio=63/64,height=720,width=1280,codec="h264"),midi=none}.
2023/01/16 10:40:31 [aac_adtstoasc.producer_0:4] Content type is {audio=ffmpeg.audio.copy(sample_rate=48000,sample_format=fltp,channel_layout="mono",codec="aac"),video=ffmpeg.video.copy(pixel_format=yuv420p,aspect_ratio=63/64,height=720,width=1280,codec="h264"),midi=none}.
[rtmp @ 0x7ff8100314c0] No default whitelist set
[tcp @ 0x7ff8100f6a40] No default whitelist set
[tcp @ 0x7ff8100f6a40] Original list of addresses:
[tcp @ 0x7ff8100f6a40] Address 127.0.0.1 port 1935
[tcp @ 0x7ff8100f6a40] Interleaved list of addresses:
[tcp @ 0x7ff8100f6a40] Address 127.0.0.1 port 1935
[tcp @ 0x7ff8100f6a40] Starting connection attempt to 127.0.0.1 port 1935
[tcp @ 0x7ff8100f6a40] Successfully connected to 127.0.0.1 port 1935
[rtmp @ 0x7ff8100314c0] Handshaking...
[rtmp @ 0x7ff8100314c0] Type answer 3
[rtmp @ 0x7ff8100314c0] Server version 13.14.10.13
[rtmp @ 0x7ff8100314c0] Proto = rtmp, path = /output/kw4dvhao?password=secret, app = output, fname = kw4dvhao?password=secret
[rtmp @ 0x7ff8100314c0] Window acknowledgement size = 5000000
[rtmp @ 0x7ff8100314c0] Max sent, unacked = 5000000
[rtmp @ 0x7ff8100314c0] New incoming chunk size = 1000
[rtmp @ 0x7ff8100314c0] Releasing stream...
[rtmp @ 0x7ff8100314c0] FCPublish stream...
[rtmp @ 0x7ff8100314c0] Creating stream...
[rtmp @ 0x7ff8100314c0] Sending publish command for 'kw4dvhao?password=secret'
2023/01/16 10:40:31 [threads:4] Created thread "clock_main" (1 total).
2023/01/16 10:40:31 [clock:4] Main phase starts.
2023/01/16 10:40:31 [threads:4] Created thread "generic queue #1" (1 total).
2023/01/16 10:40:31 [threads:4] Created thread "generic queue #2" (2 total).
2023/01/16 10:40:31 [threads:4] Created thread "generic queue #3" (3 total).
2023/01/16 10:40:31 [threads:4] Created thread "fast queue #1" (4 total).
2023/01/16 10:40:31 [threads:4] Created thread "fast queue #2" (5 total).
2023/01/16 10:40:31 [threads:4] Created thread "fast queue #3" (6 total).
2023/01/16 10:40:31 [threads:4] Created thread "non-blocking queue #1" (7 total).
2023/01/16 10:40:31 [threads:4] Created thread "non-blocking queue #2" (8 total).
2023/01/16 10:40:31 [threads:4] Created thread "non-blocking queue #3" (9 total).
2023/01/16 10:40:31 [video.text:3] Using camlimages implementation
[live_flv @ 0x7ff7f4004200] Opening 'rtmp://127.0.0.1/static/kw4dvhao' for reading
[rtmp @ 0x7ff7f4004f00] No default whitelist set
[tcp @ 0x7ff7f4005b00] No default whitelist set
[tcp @ 0x7ff7f4005b00] Original list of addresses:
[tcp @ 0x7ff7f4005b00] Address 127.0.0.1 port 1935
[tcp @ 0x7ff7f4005b00] Interleaved list of addresses:
[tcp @ 0x7ff7f4005b00] Address 127.0.0.1 port 1935
[tcp @ 0x7ff7f4005b00] Starting connection attempt to 127.0.0.1 port 1935
[tcp @ 0x7ff7f4005b00] Successfully connected to 127.0.0.1 port 1935
[rtmp @ 0x7ff7f4004f00] Handshaking...
[rtmp @ 0x7ff7f4004f00] Type answer 3
[rtmp @ 0x7ff7f4004f00] Server version 13.14.10.13
[rtmp @ 0x7ff7f4004f00] Proto = rtmp, path = /static/kw4dvhao, app = static, fname = kw4dvhao
2023/01/16 10:40:31 [clock.main:3] Streaming loop starts in auto-sync mode
2023/01/16 10:40:31 [clock.main:3] Delegating synchronisation to CPU clock
[h264 @ 0x7ff7fc0ac100] 2023/01/16 10:40:31 [switch_0:3] Switch to single_0.
nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x7ff7fc0ac100] nal_unit_type: 8(PPS), nal_ref_idc: 3
[rtmp @ 0x7ff7f4004f00] Window acknowledgement size = 5000000
[rtmp @ 0x7ff7f4004f00] Max sent, unacked = 5000000
[rtmp @ 0x7ff7f4004f00] New incoming chunk size = 1000
[rtmp @ 0x7ff7f4004f00] Creating stream...
[rtmp @ 0x7ff7f4004f00] Sending play command for 'kw4dvhao'
[live_flv @ 0x7ff7f4004200] Before avformat_find_stream_info() pos: 13 bytes read:566 seeks:0 nb_streams:0
[NULL @ 0x7ff7f401e500] nal_unit_type: 7(SPS), nal_ref_idc: 3
[NULL @ 0x7ff7f401e500] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x7ff7f401e500] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x7ff7f401e500] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x7ff7f401e500] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x7ff7f401e500] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x7ff7f401e500] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7ff7f401e500] Format yuv420p chosen by get_format().
[h264 @ 0x7ff7f401e500] Reinit context to 1280x720, pix_fmt: yuv420p
[h264 @ 0x7ff7f401e500] no picture
[live_flv @ 0x7ff7f4004200] All info found
[live_flv @ 0x7ff7f4004200] rfps: 29.666667 0.016552
[live_flv @ 0x7ff7f4004200] rfps: 29.750000 0.009347
[live_flv @ 0x7ff7f4004200] rfps: 29.750000 0.009347
[live_flv @ 0x7ff7f4004200] rfps: 29.833333 0.004197
[live_flv @ 0x7ff7f4004200] rfps: 29.916667 0.001104
[live_flv @ 0x7ff7f4004200] rfps: 29.916667 0.001104
[live_flv @ 0x7ff7f4004200] rfps: 30.000000 0.000067
[live_flv @ 0x7ff7f4004200] rfps: 30.000000 0.000067
[live_flv @ 0x7ff7f4004200] rfps: 60.000000 0.000270
[live_flv @ 0x7ff7f4004200] rfps: 60.000000 0.000270
[live_flv @ 0x7ff7f4004200] rfps: 120.000000 0.001079
[live_flv @ 0x7ff7f4004200] rfps: 120.000000 0.001079
[live_flv @ 0x7ff7f4004200] rfps: 240.000000 0.004316
[live_flv @ 0x7ff7f4004200] rfps: 240.000000 0.004316
[live_flv @ 0x7ff7f4004200] rfps: 29.970030 0.000204
[live_flv @ 0x7ff7f4004200] rfps: 29.970030 0.000204
[live_flv @ 0x7ff7f4004200] rfps: 59.940060 0.000814
[live_flv @ 0x7ff7f4004200] rfps: 59.940060 0.000814
[live_flv @ 0x7ff7f4004200] After avformat_find_stream_info() pos: 347713 bytes read:347713 seeks:0 frames:103
2023/01/16 10:40:34 [decoder.ffmpeg:4] ffmpeg recognizes "rtmp://127.0.0.1/static/kw4dvhao" as: audio: {codec: aac, 48000Hz, 2 channel(s)}, video: {codec: h264, 1280x720, yuv420p} and content-type: {audio=ffmpeg.audio.copy(sample_rate=48000,sample_format=fltp,channel_layout="mono",codec="aac"),video=ffmpeg.video.copy(pixel_format=yuv420p,aspect_ratio=63/64,height=720,width=1280,codec="h264"),midi=none}.
[h264 @ 0x7ff7fc1acac0] 2023/01/16 10:40:34 [switch_0:3] Switch to input.ffmpeg_0 with transition.
nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x7ff7fc1acac0] nal_unit_type: 8(PPS), nal_ref_idc: 3
[rtmp @ 0x7ff7fc4c6f80] 2023/01/16 10:40:42 [output.url:4] Error when encoding data: Avutil.Error(Broken pipe)
2023/01/16 10:40:42 [output.url:4] Raised by primitive operation at Stdlib__List.iter in file "list.ml", line 110, characters 12-15
2023/01/16 10:40:42 [output.url:4] Called from Stdlib__Option.map in file "option.ml", line 24, characters 57-62
2023/01/16 10:40:42 [output.url:4] Called from Ffmpeg_encoder_common.encode in file "encoder/ffmpeg_encoder_common.ml", line 103, characters 4-80
2023/01/16 10:40:42 [output.url:4] Called from Ffmpeg_encoder_common.encoder.encode in file "encoder/ffmpeg_encoder_common.ml", line 226, characters 4-44
2023/01/16 10:40:42 [output.url:4] Called from Pipe_output.url_output#encode in file "outputs/pipe_output.ml", line 117, characters 10-36
2023/01/16 10:40:42 [output.url:4]
No default whitelist set
[tcp @ 0x7ff7fc4c8500] No default whitelist set
[tcp @ 0x7ff7fc4c8500] Original list of addresses:
[tcp @ 0x7ff7fc4c8500] Address 127.0.0.1 port 1935
[tcp @ 0x7ff7fc4c8500] Interleaved list of addresses:
[tcp @ 0x7ff7fc4c8500] Address 127.0.0.1 port 1935
[tcp @ 0x7ff7fc4c8500] Starting connection attempt to 127.0.0.1 port 1935
[tcp @ 0x7ff7fc4c8500] Successfully connected to 127.0.0.1 port 1935
[rtmp @ 0x7ff7fc4c6f80] Handshaking...
[rtmp @ 0x7ff7fc4c6f80] Type answer 3
[rtmp @ 0x7ff7fc4c6f80] Server version 13.14.10.13
[rtmp @ 0x7ff7fc4c6f80] Proto = rtmp, path = /output/kw4dvhao?password=secret, app = output, fname = kw4dvhao?password=secret
[rtmp @ 0x7ff7fc4c6f80] Window acknowledgement size = 5000000
[rtmp @ 0x7ff7fc4c6f80] Max sent, unacked = 5000000
[rtmp @ 0x7ff7fc4c6f80] New incoming chunk size = 1000
[rtmp @ 0x7ff7fc4c6f80] Releasing stream...
[rtmp @ 0x7ff7fc4c6f80] FCPublish stream...
[rtmp @ 0x7ff7fc4c6f80] Creating stream...
[rtmp @ 0x7ff7fc4c6f80] Sending publish command for 'kw4dvhao?password=secret'
[rtmp @ 0x7ff7f4004f00] Sending bytes read report
^C2023/01/16 10:40:47 [main:3] Shutdown started!

Version details

Install method

.deb install

toots commented 1 year ago

Thanks for reporting. Since it is happening in docker, I am wondering if this could have something to do with the networking layer of docker being slow to get setup? Have you tried decoupling from the docker networking stack? It could be that this is actually a legit error and that networking layer is not ready when the script starts outputing data.

TheRealMattLear commented 1 year ago

@toots in this instance the liquidsoap process starts well after the initialisation of the docker container, as in, the docker container has been running for several days already prior to launching the liquidsoap process. With this knowledge, do let me know if there is anything i can test

TheRealMattLear commented 1 year ago

@toots I can confirm what we're seeing here is publishing to the output.url earlier than the defined drop_idle_publisher value in nginx-rtmp after an improper disconnection in the previous process. The connection is being rejected and then liquidsoap seemed to just give up and shut down.

I've just confirmed with Liquidsoap 2.1.4+git@5c4daae3d that the liquidsoap process no longer shuts down and successfully reconnects the output.url connection.

toots commented 1 year ago

Great, thanks! 2.1.4 is coming out imminently..