Page 1 of 1

[SOLVED]Saving and processing the video of the AI deck

Posted: Fri Mar 19, 2021 6:25 pm
by Sadeem
Hi,

I want the AI deck to take a video. After that, I process it on the computer and control the Crazyflie flight.
So, I would ask how I can access this video so I can process it? Also, can I save that video on my computer?
I tried to trace the viewer.py file, but I could not discover so.


Thank you.

Re: Saving and processing the video of the AI deck

Posted: Mon Mar 22, 2021 12:51 pm
by kimberly
Hi! This functionality doesn't exist yet but can be made yourselve.

This allows you to save an frame in viewer.py in _showframe()

Code: Select all

pix = img_loader.get_pixbuf()
pix.savev('test.jpg', 'jpeg', ["quality"], ["100"])
what I would suggest is to place something in there that iterates the frames (frame1.jpg, frame2.jpg, etc), and from that bunch of images that you create the video, but if you only need the frames for learning a NN, then you do not need to make an video anyway.

Another easy way is to use a screenrecorder if you are only interested in the video.