Replies: 3 comments
|
"Async" as in running both ffmpeg and python code in parallel is already supported via the stream I/O feature of the import ffmpegio as ff
output = 'rtsp_%Y_%m_%d_%H_%M_%S.mp4'
scale = 'scale = 320 : -1'
segment_time = '00:01:00'
with ff.open(output, 'wv', rate_in=25,
vcodec = 'libx264',
reset_timestamps = 1,
strftime = 1,
f = 'segment',
segment_time = segment_time,
segment_atclocktime = 1,
vf = scale,
overwrite=True) as stream:
for F in my_frame_generator():
stream.write(F)If you don't want to use the context manager, you can call stream = ff.open(output, 'wv', rate_in=25,
vcodec = 'libx264',
reset_timestamps = 1,
strftime = 1,
f = 'segment',
segment_time = segment_time,
segment_atclocktime = 1,
vf = scale,
overwrite=True) as stream:
try:
for F in my_frame_generator():
stream.write(F)
finally:
stream.close()As for the Now, if you meant "async" as in the |
|
conclusion code 1 result 1 code 2 result 2 code 3 result 3 code 4 result 4 best regards |
|
My bad, a finger slip. The open mode should be You need to write you own |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
nice to support async ?
the ffmpeg parameter can be run using another python ffmpeg module
e.g. module
e.g. code
to stop async
stream.terminate()best regards
All reactions