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

support async #111

Open
sugizo opened this issue Mar 22, 2024 · 2 comments
Open

support async #111

sugizo opened this issue Mar 22, 2024 · 2 comments

Comments

@sugizo
Copy link

sugizo commented Mar 22, 2024

nice to support async ?

the ffmpeg parameter can be run using another python ffmpeg module
e.g. module

typed-ffmpeg 
ffmpeg-python

e.g. code

import ffmpeg
url = 'http://takemotopiano.aa1.netvolante.jp:8190/nphMotionJpeg?Resolution=320x240&Quality=Standard&Framerate=30'
output = 'rtsp_%Y_%m_%d_%H_%M_%S.mp4'
scale = 'scale = 320 : -1'
segment_time = '00:01:00' 

stream = ffmpeg.input(url).output(filename = output, 
                                  vcodec = 'libx264', #acodec = 'copy', 
                                  reset_timestamps = 1, 
                                  strftime = 1, 
                                  f = 'segment', 
                                  segment_time = segment_time, 
                                  segment_atclocktime = 1, 
                                  vf = scale, 
                                  r = 25, ).overwrite_output().run_async()

to stop async
stream.terminate()

best regards

@almarklein
Copy link
Member

I'm not sure if I follow. You don't mean async as in await ... using asyncio, or do are you?

Your code example feels more like it will do the work in the background in a thread or something. This is out of scope of this library, because it represents a very specific use-cases, and one that can be implemented on top of imageio_ffmpeg.

@sugizo
Copy link
Author

sugizo commented Mar 26, 2024

I'm not sure if I follow. You don't mean async as in await ... using asyncio, or do are you?

Your code example feels more like it will do the work in the background in a thread or something. This is out of scope of this library, because it represents a very specific use-cases, and one that can be implemented on top of imageio_ffmpeg.

yes

objective
create video continously
from rtsp camera
with duration that defined
in segment_time parameter

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

2 participants