Before I left the house, I had Cheese recording at a resolution that would not fill up my hard drive. It recorded 7 hours but the entry of my landlard to do repairs does not appear?
Is there a way to definitely know how long the recording was?
I am having problems seeing my posts. I click on my avatar and see a lot of things.
I know nothing about Cheese itself and can't seem to find docs on how it can be configured, even on the GitLab site. I even went so far as to install Cheese on my UM 22.04, and don't see anything that could help, beyond what I already said.
My only other suggestion is that, possibly, some other video application may have logic to break a non-stop stream of video into pre-configured time-slices, maybe 1 file per 20 minutes or per hour. That would give you many files and, possibly, the App's logic would be to add a date/time string to the filename on storage, to indicate the sequence or window of time recorded.
Having the camera/recording provide a date/time overlay (URL reference provided; reconfirmed by example from Pavlos) is that such a recording could be used as legal evidence, if there was ever a question of someone having entered your premises and done anything illicit, which you only discovered at a later date.
As long as you did not "trim" that original recording (after the fact, in order to limit the contents to the timeframe specific to the display of an offense), that recording would be acceptable as non-tampered evidence.
Which is why, given that much could be visible on a long recording, it would be beneficial to arrange for the recording of multiple time-slices of 15 min, 20 min, or 1 hour, depending on long a window, or how many files, you would like to manage.
If you would like, I could work on creating such a script for you, but I would need you to do the testing, because I don't have the video camera. I actually started some rough scripting when I first answered your question.
Script "VIDEO__Record_LiveStreamWithTimeStamp.sh":
(EDIT: removed spurious "-t" in function)
#!/bin/bash
####################################################################################################
###
### Script to simplify interraction with ffmpeg for recording from video stream
###
### REF: https://askubuntu.com/a/428501
### REF: https://ubuntu-mate.community/t/cheese-recording-not-showing-landlord-coming-into-my-trailer-for-repair/28390/9
###
####################################################################################################
####################################################################################################
recordSegment()
{
###
### Options used in REF which were not used by Pavlos in his response demo
###
# -f video4linux2 \
# -s 640x480 \
# -r 30 \
# -vcodec libx264 \
# -vb 2000k \
ffmpeg \
-i /dev/video0 \
-preset ultrafast \
${segInterval} \
-vf "${textOverlayParameters}" \
-f mp4 "${videoFile}"
}
####################################################################################################
recordSlice()
{
videoFile="${videoFilePref}_${sliceStart}.mp4"
printf "\n\t Starting capture of video stream for next ${sliceMax} minutes as:\n\t -> ${videoFile}\n"
recordSegment
}
####################################################################################################
###
### 'drawtext' option specifications
###
#fontSpec="fontfile=DejaVuSans-Bold.ttf"
fontSpec="fontfile=FreeMono.ttf"
#timeFmt="text='\\%T'"
timeFmt="text='\\%{localtime}'"
fontClr="[email protected]"
timePosn="x=7:y=460"
textOverlayParameters="drawtext=${fontSpec}:${timeFmt}:${fontClr}:${timePosn}"
#echo ${textOverlayParameters}
#exit
####################################################################################################
mode=1
timeTot=0
timeWait=0
count=0
label=0
videoFilePref="vidrecord"
sliceMax=0
while [ $# -gt 0 ]
do
case "${1}" in
"--single" )
mode=1
shift
;;
"--slices" )
### number of recording slices to cover specified duration
mode=2
slices="${2}"
shift ; shift
;;
"--duration" )
### total recording time [ units in hours ]
timeTot="${2}"
count=1
shift ; shift
;;
"--wait" )
### wait time before start [ units in minutes ]
timeWait="${2}"
shift ; shift
;;
"--label" )
videoFilePref="${2}"
shift ; shift
;;
"--label_int" )
label=1
shift
;;
"--label_hms" )
label=0
shift
;;
"--debug" )
dbg=1
shift
;;
* ) printf "\n\t Invalid parameter used on command line. \n\t Only valid: [ --single | --slices {count} ] [ --duration {hours} ] [ --wait {minutes} ] [ --label {string} ] [ --label_int | --label_hms ] [ --debug ] \n Bye!\n\n" ; exit 1
esac
done
####################################################################################################
if [ ${mode} -eq 1 ]
then
test ${timeTot} -eq 0 && { printf "\n\t ERROR: Need to specify total record time with '--duration {hours}' option.\n Bye!\n\n" ; exit 1 ; }
if [ ${timeWait} -gt 0 ]
then
printf "\n\t WAITING ${timeWait} minute(s) before proceed with video recording ...\n\n"
hTime=$( expr ${timeWait} \* 60 )
sleep ${hTime}
fi
sliceMax=$( expr ${timeTot} \* 60 )
segInterval="-t $( expr ${sliceMax} \* 60 )"
if [ ${label} -eq 1 ]
then
sliceStart="$(date '+%Y%m%d_%H%M' )_${sliceMax}m"
else
sliceStart=$(date '+%Y%m%d_%H%M%S' )
fi
recordSlice
exit
fi
if [ ${mode} -eq 2 ]
then
test ${timeTot} -eq 0 && { printf "\n\t ERROR: Need to specify total record time with '--duration {hours}' option.\n Bye!\n\n" ; exit 1 ; }
if [ ${timeWait} -gt 0 ]
then
printf "\n\t WAITING ${timeWait} minute(s) before proceed with video recording ...\n\n"
hTime=$( expr ${timeWait} \* 60 )
sleep ${hTime}
fi
duration=$( expr ${timeTot} \* 60 )
sliceMax=$( expr ${duration} / ${slices} )
segInterval="-t $( expr ${sliceMax} \* 60 )"
indx=0
while [ ${indx} -lt ${slices} ]
do
if [ ${label} -eq 1 ]
then
sliceStart="$(date '+%Y%m%d_%H%M' )_${sliceMax}m"
else
sliceStart=$(date '+%Y%m%d_%H%M%S' )
fi
recordSlice
indx=$( expr ${indx} + 1 )
done
exit
fi
exit
Session log for "--single" mode:
./VIDEO__Record_LiveStreamWithTimeStamp.sh --single --duration 2 --label_int
Starting capture of video stream for next 120 minutes as:
-> vidrecord_20241024_1741_120m.mp4
Session log with "--slices" mode:
./VIDEO__Record_LiveStreamWithTimeStamp.sh --slices 6 --duration 2 --label_hms
Starting capture of video stream for next 20 minutes as:
-> vidrecord_20241024_181047.mp4
Starting capture of video stream for next 20 minutes as:
-> vidrecord_20241024_183047.mp4
Starting capture of video stream for next 20 minutes as:
-> vidrecord_20241024_185047.mp4
Starting capture of video stream for next 20 minutes as:
-> vidrecord_20241024_191047.mp4
Starting capture of video stream for next 20 minutes as:
-> vidrecord_20241024_193047.mp4
Starting capture of video stream for next 20 minutes as:
-> vidrecord_20241024_195047.mp4
Andy, the script I offered is an attempt to give you a template for customizing to your needs.
That script incorporates the date and time stamp in the video with the ffmpeg's "drawtext" option string (that is composed of other parameters which I've explicitly defined as parameters, to make it easier to understand).
The "--duration" option is my suggested approach for giving a length of the recording time (using hours), which is then converted into the value for ffmpeg's "-t" option which is in seconds.
But all of that can be changed by yourself, if you prefer to work with minutes, and modify the calculations in the script accordingly. If you want me to change that to minutes (i.e. 720 minutes for a 12 hour recording), I can modify my script for that, if you prefer.
I backed away from specifying start and end times because it got a bit too complicated for me. That is why I only offered a parameter for wait, in minutes, before the recording starts for the specified duration.
---- edit -----
... ( snip ) ...
Please see my later posting for the finalized script.
"--duration" was replaced by the two mutually-exclusive options "--hours" and "--minutes".