Skip to content
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

Clean Interrupt #121

Open
glitchednoop opened this issue Jun 24, 2023 · 0 comments
Open

Clean Interrupt #121

glitchednoop opened this issue Jun 24, 2023 · 0 comments

Comments

@glitchednoop
Copy link

Script works perfect but trying to figure out the best way to save a long live stream but keep the saved chunks to an hour each.

Is there a way to interrupt but still finalize the file? Currently using the basic example:

video = ffmpeg_streaming.input(url)
stream = video.stream2file(Formats.hevc())
stream.output(savepath)

Since the input() call is blocking it seems the only way to exit before the stream ends is a ctrl+c or keyboard interrupt that just exits the ffmpeg call, however if you do it twice or too fast you exiting the script leaving the mp4 corrupt. I assume its missing headers and could probably be transcoded to fix it. But is there a cleaner way to exit that will still finalize the headers? I feel like I could multi thread this to handle the kill but is there a cleaner way that's already built in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant