google-coral / pycoral

Python API for ML inferencing and transfer-learning on Coral devices
https://coral.ai
Apache License 2.0
351 stars 145 forks source link

How to record a video in coral dev board using hardware codec ? #20

Closed vaibhav810 closed 3 years ago

vaibhav810 commented 3 years ago

I have coral dev kit and coral camera with me..

I want my inference pipelining running as it as while recording input (raw format is also acceptable ) camera frames in file parallely .How do i achieve that ? gsteramer pipeline ?

If i use cv2.videowriter , its very bottleneck & low fps

mbrooksx commented 3 years ago

I would use GStreamer overall but unfortunately the iMX8M does not include a hardware video encoder (only a decoder). You could do SW encoding in our GStreamer pipelines by changing the display part of the pipeline (https://github.com/google-coral/examples-camera/blob/master/gstreamer/gstreamer.py#L254) to something that use SW encoding (for example, x264enc ! mp4mux ! filesink location=file.mp4).