I have a camera which when motion is detected uploads JPG files at roughly one a second — so I want to take them and convert them back to video.
For the uploaded files
- It sometimes skips a few uploads (up to about 3 second gaps)
- They continue for around 20 seconds after motion has ceased
- The files are 640×480 color 24-bit Depth and each is around 40K
- The pictures vary in lighting between stills
- There are no files once the motion detection has stopped — so a gap in files can be used to determine the end of video
So I want to use a script to make these into a video - I'd like to
- Extend each JPG to the correct length of time
- “watermark” the timestamp onto the video
- Compress the video
For compression, I feel that the common background and large sections of unchanging video should be highly compressible
I'll be able to write the scripts which would include - the selection of the right set of files to include in each video - production of an intermediate parameter file - calculation of time span of each still image - determination of end of movie — including still currently recording
I'm running on a Window's laptop — but would consider a Raspberry Pi or Ubuntu system.
I've looked at FFmpeg but got a little lost of where to start — I did find possible-to-stream-append-images-into-an-existing-mp4. Which is close and I can start with this. However, one answer seemed to be saying that this may cause loss of fidelity with a comment saying no it won't. Also, I am unsure about how to make the JPGs extend to different lengths and how to watermark a time stamp onto each image
So my questions are What tool and encoding format is a good match with what I want ?
Should I make the script wait until the files are fully produced or is it possible to append one JPG file to the movie stream at a time with parameters without excessive loss of fidelity?
Is timestamping best done with a watermark on the video - or with some metadata tagging and require the renderer to display timestamps?
I have included one image from the camera