Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Clean Interrupt #121

Open
Open
@glitchednoop

Description

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?

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

        AltStyle によって変換されたページ (->オリジナル) /