App for recording video from web camera in background


I need a simple app for recording video/audio from web camera (not IPTV) in background while system is up. Or may be there is some video surveillance app available or can be installed on Endless OS?

Put the following script into some file like in your home directory:

TEMP=$(mktemp -d)

pushd ${TEMP} 2>/dev/null 1>&2
wget -O ffmpeg.tar.xz ${URL}
if [ $? -eq 0 ]; then
	cat ffmpeg.tar.xz | xz -dc | tar -xvf -
	if [ ! -d ~/bin ]; then
		mkdir ~/bin

	install -Dm755 ffmpeg-*-amd64-static/ffmpeg ~/bin/ffmpeg

	cat ~/.bashrc 2>&1 | grep -E "/sysroot/home/${USERNAME}"/bin 2>/dev/null 1>&2
	if [ $? -ne 0 ]; then
		echo export PATH=${PATH}:~/bin >> ~/.bashrc

	echo Installed ffmpeg and added it to the system path
	>&2 echo "failed to download ffmpeg"

popd 2>/dev/null 1>&2
rm -Rf ${TEMP}

Now open a Terminal and run:

chmod +x ~/

This will fetch the current stable version of ffmpeg, extract it to your home directory and adds a path to it for easier execution. Close the Terminal and open it again to take effect.

Now you are able to execute ffmpeg which is a versatile tool for processing video. For example:

ffmpeg -f v4l2 -framerate 10 -video_size 1280x720 -i /dev/video0 test.mkv

For a full reference of all available options, consult the ffmpeg wiki:

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.