I need to record video and at the same time also detect if a QR Code is in front of camera, if yes, i send the string throught serial to another microcontroller that make other operations.
In the video i record that the user put the QR Code in front of the camera and all the events that occours before and after the QR Code, this is for security reason.
Is this clear?
The next step is to control the start and stop record throught serial, the video recorded can be long like 5 minutes
I have just successfully integrated this. However, there is still optimization that can be done to the following example. For now, you can be reassured that this feature is doable. Once the optimization of the code is done, we will commit to our official repository.
void setup() {
// Initialize serial communication
Serial.begin(115200);
// Configure camera video channel with video format information
Camera.configVideoChannel(CHANNEL, config);
Camera.configVideoChannel(RECORDINGCHANNEL, configv1);
Camera.videoInit();
mp4.configVideo(configv1);
mp4.setRecordingDuration(30);
mp4.setRecordingFileCount(1);
mp4.setRecordingFileName(“TestRecordingVideoOnly”);
mp4.setRecordingDataType(STORAGE_VIDEO); // Set MP4 to record video only
// Configure StreamIO object to stream data from video channel to MP4 recording
videoStreamer.registerInput(Camera.getStream(RECORDINGCHANNEL));
videoStreamer.registerOutput(mp4);
if (videoStreamer.begin() != 0) {
Serial.println(“StreamIO link start failed”);
}
// Start data stream from video channel
// Camera.channelBegin(CHANNEL);
Camera.channelBegin(RECORDINGCHANNEL);
// Start recording MP4 data to SD card
Serial.println(“Mp4 begin”);
mp4.begin();
Scanner.StartScanning();
}
void loop() {
// User can use the result string and length from here.
// You can modify the delay to the rate of retrieving the result string and result length.
// Currently, third successful scan will allow you to get the result string and length reliably.
// Note that this loop may not be optimised, you are to do your own conditional checks to get your application working.
// This is to illustrate how to retrieve the qr code scanning results.
Unfortunately you will have to configure a duration to record the video when starting a recording. For instance, you may set a duration of 5 mins. And at the 3 minute mark, if you want to stop the recording, you may call the API mp4.end().
Unfortunately, these debug messages cannot be removed at the moment, because the file that generates this is not open source. May I know if it is a must to remove the log? If yes, I will try to ask if I am able to provide you with the binary file with the printing log disabled.
Maybe i can use another serial to comunicate with my other microcontroller, but if i’m able to manage this log strings i prefer and i think it’s helpful also for the comunity if you provide a flag to enable/disable it in arduino ide
Thanks for your feedback, we will see if it is possible to provide a way for users to manage the log.
Let us know if you require any assistance for your smart locker project because there are still around 2 more weeks till end of May. Would like to help with any technical issues as soon as possible.