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

Discussions about the AI-deck
Post Reply
Sadeem
Beginner
Posts: 12
Joined: Wed Jan 27, 2021 3:06 pm

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

Post 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.
Last edited by Sadeem on Thu Mar 25, 2021 12:21 am, edited 1 time in total.
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Saving and processing the video of the AI deck

Post 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.
Post Reply