How to save the recorded video in a file only after it finishes a certain duration? #460
Unanswered
katharsais
asked this question in
Q&A
Replies: 1 comment
-
Hi, thank you for your question. If I understand correctly, you want to record a 5 minute video, but which doesn't appear in the filesystem until the recording is finished? For a short recording, you would be able write the video to a memory buffer, and only save it to a file at the very end. This may become difficult with a longer video because you will need a very large memory buffer, although it will depend on the bitrate and length of the recording. Another option might be to write the file to a temporary folder and then copy it after the recording finishes. Might that work for you? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello I am very new to the environment of Picamera2 and even the Raspberry Pi itself, a beginner who wasn't able to learn also about the predecessor, Picamera.
My question is how can you save the recording videos after it finishes? For example, if I make it record for 5 minutes, it should only be saved or can be seen in the file manager after it manages to go in that 5-minute mark. The reason of doing this is because I am using Syncthing (API that automates syncing of files between devices) and what happens is if the recording of video was stopped unexpectedly, it will sync that file but won't let play it, since what I understand is it did not fulfill the objective of recording a 5-minute video.
What I use is picam2.start_and_record_video(....) but if I'm not mistaken, it is the real culprit of this because the idea of running this code is to have a file to have the frames be stored in some certain way. Is there an alternative for this so that it will instead create or probably display in the file manager AFTER it completes the 5-minute?
Beta Was this translation helpful? Give feedback.
All reactions