App for recording video from web camera in background

Hello!

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 install-ffmpeg.sh in your home directory:

#!/bin/bash
TEMP=$(mktemp -d)
URL=https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz

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
	fi

	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
	fi

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

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

Now open a Terminal and run:

chmod +x ~/install-ffmpeg.sh
~/install-ffmpeg.sh

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: https://trac.ffmpeg.org/wiki

1 Like

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