im trying to record video snippets
im doing something like this
from depthai_sdk.components.component import Component
from typing import Callable, List, Union
from depthai_sdk import OakCamera, RecordType
from depthai_sdk.classes.output_config import RecordConfig
import time
def get_component_outputs(output: Union[List, Callable, Component]) -> List[Callable]:
if not isinstance(output, List):
output = [output]
for i in range(len(output)):
if isinstance(output[i], Component):
# Select default (main) output of the component
output[i] = output[i].out.main
return output
duration = 10
with OakCamera(rotation=180) as oak:
color = oak.camera('color', resolution='1080P', fps=15, encode='H265')
left = oak.camera('left', resolution='800p', fps=15, encode='H265')
right = oak.camera('right', resolution='800p', fps=15, encode='H265')
# Sync & save all (encoded) streams
outputs = [color.out.encoded, left.out.encoded,right.out.encoded ]
record = oak.record(outputs, './')
oak.start()
start_time = time.monotonic()
rec_conf = ''
while oak.running():
if time.monotonic() - start_time > duration:
# if(isinstance(rec_conf,RecordConfig)):
# rec_conf.rec.close()
# rec_conf.rec.recorder.close()
# rec_conf.rec.process
# else:
record.close()
rec_conf = RecordConfig(get_component_outputs(outputs), record)
record = rec_conf.setup(oak.pipeline,oak.device,'')[0]
start_time = time.monotonic()
oak.poll()
im getting outputs however only the first file gets containerised to mp4 the others are all hevc, my shallow understanding tells me there is a pipeline that gets fixed before start and im basically trying to do something that may or may not make sense.
any help ?