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

file closed events not working in 2.2.2 (working in 2.1.4) #3588

Closed
scottgrobinson opened this issue Dec 12, 2023 · 1 comment
Closed

file closed events not working in 2.2.2 (working in 2.1.4) #3588

scottgrobinson opened this issue Dec 12, 2023 · 1 comment

Comments

@scottgrobinson
Copy link

scottgrobinson commented Dec 12, 2023

Describe the bug
HLS file closed events appear to be missing/not avaliable in 2.2.2

Specific use case for file closed events - On a HLS file being closed, copy it to another location as we use the HLS files for internal "listen again"

2.1.4

2023/12/12 18:32:56 [lang.deprecated:2] WARNING: "gettimeofday" is deprecated and will be removed in future version. Please use "time" instead.
change: opened, /tmp/hls/stream_2_1702405976_2.mp3
change: closed, /tmp/hls/stream_2_1702405976_2.mp3
change: opened, /tmp/hls/stream.m3u8
change: closed, /tmp/hls/stream.m3u8

2.2.2

2023/12/12 18:31:48 [lang.deprecated:2] WARNING: "gettimeofday" is deprecated and will be removed in future version. Please use "time" instead.
change: created, /tmp/hls/stream_2_1702405908_32.mp3
change: deleted, /tmp/hls/stream_2_1702405889_23.mp3
change: updated, /tmp/hls/stream.m3u8

To Reproduce

s = noise()

def on_file_change(~state,path)
  print("change: #{state}, #{path}")
end

stream = %mp3(bitrate=128)
streams = [("stream", stream)]

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

output.file.hls(playlist="live.m3u8",
                segment_duration=2.0,
                segments=5,
                segments_overhead=5,
                segment_name=segment_name,
                on_file_change=on_file_change,
                "/tmp/hls",
                streams,
                s)

Expected behavior
file closed events should be received

Version details
2.1.4 vs 2.2.2 Docker

Install method
Docker

@toots
Copy link
Member

toots commented Dec 14, 2023

Hi @scottgrobinson. File operations are now atomic on HLS so as soon as you get the "created" event, you can grab the file and run with it, it should be fully copied and closed by then!

@savonet savonet locked and limited conversation to collaborators Dec 14, 2023
@toots toots converted this issue into discussion #3595 Dec 14, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants