quasarstream / python-ffmpeg-video-streaming

📼 Package media content for online streaming(DASH and HLS) using FFmpeg
https://www.quasarstream.com/op/python/ffmpeg-streaming?u=py-ff
MIT License
834 stars 142 forks source link

kill ffmpeg process on finish up if enabled #122

Open yvd opened 1 year ago

yvd commented 1 year ago
Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Fixed tickets fixes #issuenum
Related issues/PRs #issuenum
License MIT

What's in this PR?

Added an option to kill the ffmpeg process in the finish_up phase. Useful when using an input source as camera

Why?

Need to deallocate input source (camera) programatically once the stream is finished, so that it can be used again.

Example Usage


video = ffmpeg_streaming.input("/dev/video0", capture=True)
hls = video.hls(Formats.h264(), kill_process_on_exit=True)

// Now we can do
hls.finish_up() // will stop the ffmpeg process and free the attached camera

#### To Do

- [ ] Create tests