Skip to content

Clean Interrupt  #121

Description

@glitchednoop

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions