Take Photo/Audio/Video from webcam by remotely controlling it using a Telegram bot.
- Clone this repo.
- Create
.env
file in the same directory and putTOKEN=<your_bot_token>
andALLOWED_USERS=<list of userids>
in the file - Activate the virtual environment with
pipenv shell
and install dependencies withpipenv install
. Make surepipenv
is installed. - Download and install the
ffmpeg
library for video processing. Theffmpeg
executable should be available in the path. - Start the bot with
pipenv run bot
- Available commands
/photo
- Take photo/audio
- Take audio/video
- Take video
- A mega account is also needed to upload larger files and accordingly the mega account credentials need to be put in the .env file. (Otherwise just comment out the relavant lines in the
telegramBot.py
file).
NOTE:
- Telegram free account does not allow to share files larger than 50 MB. Thus, for larger recording, file will only be uploaded to Mega server and the link will be shared.
- Proper audio and video sources need to be supplied to the recorder to record video and audio without any issue. To find available audio/video sources in your system, you can checkout this https://koushikphy.github.io/linux/ffmpeg_setup_ubuntu/
- If different devices are used for video and audio recording, then there may be some sync issue.
- Current codebase uses a polling method for the bot to communicate with the telegram server, for a production level solution a webhook should be used.
- A smaple
.env
file is also provided in env_sample (All inputs are imaginary here).