Open otrebor4 opened 2 years ago
@otrebor4, @pchinea how to run this library? Can you please share the code?
@otrebor4 I'm very very sorry, github didn't notify me about this issue and I just see this.
Those messages are absolutely normal, it is checking if the H.264 codec is available (in your case that codec is not available). If you are seeing these messages, the script was able to connect to both Telegram and your camera, so theoretically it is working correctly.
In any case, try setting the BOT_LOG_LEVEL variable to INFO and see what it displays.
@sonykurian96 This is not a library, it is a standalone application, you don't need any code. Please, follow the instructions in the README file.
@pchinea Thank you very much for the response. But I'm bit confused on how to properly run this project(I'm getting some errors). It would be really helpful for me as well as many others if you could do a simple tutorial on how to run your project from the source code 🤝.
Hi Pablo, thanks for your attention.
What test can i perform in order to make this tool to work for me?
For example disabling the video part and let work only the foto part?
///
On 11/7/22 17:10, Pablo Chinea wrote:
@otrebor4 https://github.com/otrebor4 I'm very very sorry, github didn't notify me about this issue and I just see this.
Those messages are absolutely normal, it is checking if the H.264 codec is available (in your case that codec is not available https://github.com/pchinea/telegram-surveillance-bot#h264-encoding). If you are seeing these messages, the script was able to connect to both Telegram and your camera, so theoretically it is working correctly.
In any case, try setting the BOT_LOG_LEVEL variable to INFO and see what it displays.
— Reply to this email directly, view it on GitHub https://github.com/pchinea/telegram-surveillance-bot/issues/20#issuecomment-1305841213, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZA7JAX6DKTWCBMPVQXTXG3WHESWRANCNFSM5VFHSDRQ. You are receiving this because you were mentioned.Message ID: @.***>
-- CordialitĂ / LG / regards RB
Hi again;
ok for now i will increaase the BOT_LOG_LEVEL variable to INFO and post here the result.
Thanks for now!
///
On 11/7/22 17:10, Pablo Chinea wrote:
@otrebor4 https://github.com/otrebor4 I'm very very sorry, github didn't notify me about this issue and I just see this.
Those messages are absolutely normal, it is checking if the H.264 codec is available (in your case that codec is not available https://github.com/pchinea/telegram-surveillance-bot#h264-encoding). If you are seeing these messages, the script was able to connect to both Telegram and your camera, so theoretically it is working correctly.
In any case, try setting the BOT_LOG_LEVEL variable to INFO and see what it displays.
— Reply to this email directly, view it on GitHub https://github.com/pchinea/telegram-surveillance-bot/issues/20#issuecomment-1305841213, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZA7JAX6DKTWCBMPVQXTXG3WHESWRANCNFSM5VFHSDRQ. You are receiving this because you were mentioned.Message ID: @.***>
-- CordialitĂ / LG / regards RB
Hi Pablo, Hi all;
her the output of surveillance_bot with BOT_LOG_LEVEL=INFO
@. global /io/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp (2767) open Could not find encoder for codec_id=27, error: Encoder not found @. global /io/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp (2839) open VIDEOIO/FFMPEG: Failed to initialize VideoWriter 2022-11-14 18:30:50,394 - surveillance_bot.bot - INFO - Surveillance Bot started
and nothing is working...
/*/
@otrebor4 https://github.com/otrebor4 I'm very very sorry, github didn't notify me about this issue and I just see this.
Those messages are absolutely normal, it is checking if the H.264 codec is available (in your case that codec is not available https://github.com/pchinea/telegram-surveillance-bot#h264-encoding). If you are seeing these messages, the script was able to connect to both Telegram and your camera, so theoretically it is working correctly.
In any case, try setting the BOT_LOG_LEVEL variable to INFO and see what it displays.
— Reply to this email directly, view it on GitHub https://github.com/pchinea/telegram-surveillance-bot/issues/20#issuecomment-1305841213, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZA7JAX6DKTWCBMPVQXTXG3WHESWRANCNFSM5VFHSDRQ. You are receiving this because you were mentioned.Message ID: @.***>
-- CordialitĂ / LG / regards RB
Hi Pablo, Hi all;
her the output of surveillance_bot with BOT_LOG_LEVEL=INFO
@. global /io/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp (2767) open Could not find encoder for codec_id=27, error: Encoder not found @. global /io/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp (2839) open VIDEOIO/FFMPEG: Failed to initialize VideoWriter 2022-11-14 18:30:50,394 - surveillance_bot.bot - INFO - Surveillance Bot started
sorry, i wrote nothing but actually it is NOT making surveillance and not taking foto/video by motion in front of the camera BUT if i press /get_photo or /get_video on the telegram bot page it makes a foto or a video.
So the motion thing is not working so far....
/*/
@otrebor4 https://github.com/otrebor4 I'm very very sorry, github didn't notify me about this issue and I just see this.
Those messages are absolutely normal, it is checking if the H.264 codec is available (in your case that codec is not available https://github.com/pchinea/telegram-surveillance-bot#h264-encoding). If you are seeing these messages, the script was able to connect to both Telegram and your camera, so theoretically it is working correctly.
In any case, try setting the BOT_LOG_LEVEL variable to INFO and see what it displays.
— Reply to this email directly, view it on GitHub https://github.com/pchinea/telegram-surveillance-bot/issues/20#issuecomment-1305841213, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZA7JAX6DKTWCBMPVQXTXG3WHESWRANCNFSM5VFHSDRQ. You are receiving this because you were mentioned.Message ID: @.***>
-- CordialitĂ / LG / regards RB
Hi Pablo;
now it is runnung - no detection but it takes foto and video if i command it from telegram; plus i got this error:
2022-11-14 23:26:38,867 - telegram.ext.updater - ERROR - Error while getting Updates: Bad Gateway 2022-11-14 23:26:38,885 - surveillance_bot.bot - WARNING - Update "None" caused error "Bad Gateway" 2022-11-14 23:26:38,885 - telegram.ext.dispatcher - ERROR - An uncaught error was raised while handling the error. Traceback (most recent call last): File "/home/roylenovo/.local/lib/python3.8/site-packages/telegram/ext/dispatcher.py", line 536, in process_update self.dispatch_error(None, update) File "/home/roylenovo/.local/lib/python3.8/site-packages/telegram/ext/dispatcher.py", line 810, in dispatch_error callback(update, context) File "/home/roylenovo/.local/lib/python3.8/site-packages/surveillance_bot/bot.py", line 181, in _error chat_id=update.effective_chat.id, # type: ignore AttributeError: 'NoneType' object has no attribute 'effective_chat'
/*/
@otrebor4 https://github.com/otrebor4 I'm very very sorry, github didn't notify me about this issue and I just see this.
Those messages are absolutely normal, it is checking if the H.264 codec is available (in your case that codec is not available https://github.com/pchinea/telegram-surveillance-bot#h264-encoding). If you are seeing these messages, the script was able to connect to both Telegram and your camera, so theoretically it is working correctly.
In any case, try setting the BOT_LOG_LEVEL variable to INFO and see what it displays.
— Reply to this email directly, view it on GitHub https://github.com/pchinea/telegram-surveillance-bot/issues/20#issuecomment-1305841213, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZA7JAX6DKTWCBMPVQXTXG3WHESWRANCNFSM5VFHSDRQ. You are receiving this because you were mentioned.Message ID: @.***>
-- CordialitĂ / LG / regards RB
Hi Pablo et all;
now surprisingly the surveillance has been working after pressing on /surveillance_start and immediately, whitout any motion, this error displayed (no video was produced:
Traceback (most recent call last): File "/home/roylenovo/.local/lib/python3.8/site-packages/telegram/ext/dispatcher.py", line 536, in process_update self.dispatch_error(None, update) File "/home/roylenovo/.local/lib/python3.8/site-packages/telegram/ext/dispatcher.py", line 810, in dispatch_error callback(update, context) File "/home/roylenovo/.local/lib/python3.8/site-packages/surveillance_bot/bot.py", line 181, in _error chat_id=update.effective_chat.id, # type: ignore AttributeError: 'NoneType' object has no attribute 'effective_chat' 2022-11-17 01:58:36,162 - telegram.vendor.ptb_urllib3.urllib3.connectionpool - WARNING - Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<telegram.vendor.ptb_urllib3.urllib3.connection.VerifiedHTTPSConnection object at 0x7ffa86588820>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /bot5311185340:AAHLVEEsGbxiIf1arRY_qIxsJAbSGPpylZ8/getUpdates 2022-11-17 01:58:41,178 - telegram.vendor.ptb_urllib3.urllib3.connectionpool - WARNING - Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<telegram.vendor.ptb_urllib3.urllib3.connection.VerifiedHTTPSConnection object at 0x7ffa854955e0>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /bot5311185340:AAHLVEEsGbxiIf1arRY_qIxsJAbSGPpylZ8/getUpdates 2022-11-17 04:01:18,649 - telegram.vendor.ptb_urllib3.urllib3.connectionpool - WARNING - Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<telegram.vendor.ptb_urllib3.urllib3.connectionpool.HTTPSConnectionPool object at 0x7ffa871ae5e0>, 'Connect timed out. (connect timeout=5.0)')': /bot5311185340:AAHLVEEsGbxiIf1arRY_qIxsJAbSGPpylZ8/getUpdates 2022-11-17 04:01:46,002 - telegram.vendor.ptb_urllib3.urllib3.connectionpool - WARNING - Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<telegram.vendor.ptb_urllib3.urllib3.connectionpool.HTTPSConnectionPool object at 0x7ffa871ae5e0>, 'Connect timed out. (connect timeout=5.0)')': /bot5311185340:AAHLVEEsGbxiIf1arRY_qIxsJAbSGPpylZ8/getUpdates 2022-11-17 04:02:09,720 - telegram.vendor.ptb_urllib3.urllib3.connectionpool - WARNING - Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<telegram.vendor.ptb_urllib3.urllib3.connectionpool.HTTPSConnectionPool object at 0x7ffa871ae5e0>, 'Connect timed out. (connect timeout=5.0)')': /bot5311185340:AAHLVEEsGbxiIf1arRY_qIxsJAbSGPpylZ8/getUpdates 2022-11-17 04:02:16,937 - telegram.vendor.ptb_urllib3.urllib3.connectionpool - WARNING - Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<telegram.vendor.ptb_urllib3.urllib3.connectionpool.HTTPSConnectionPool object at 0x7ffa871ae5e0>, 'Connect timed out. (connect timeout=5.0)')': /bot5311185340:AAHLVEEsGbxiIf1arRY_qIxsJAbSGPpylZ8/getUpdates 2022-11-17 18:35:31,830 - surveillance_bot.bot - INFO - Surveillance mode start 2022-11-17 18:36:36,450 - surveillance_bot.bot - WARNING - Update "{'message': {'chat': {'username': 'AlienRoy', 'last_name': 'B.', 'id': 80151241, 'type': 'private', 'first_name': 'Rob'}, 'entities': [{'type': 'bot_command', 'length': 19, 'offset': 0}], 'photo': [], 'caption_entities': [], 'supergroup_chat_created': False, 'new_chat_photo': [], 'channel_chat_created': False, 'new_chat_members': [], 'group_chat_created': False, 'delete_chat_photo': False, 'date': 1668706531, 'message_id': 290, 'text': '/surveillance_start', 'from': {'first_name': 'Rob', 'username': 'AlienRoy', 'last_name': 'B.', 'is_bot': False, 'id': 80151241, 'language_code': 'en'}}, 'update_id': 529602758}" caused error "urllib3 HTTPError ('Connection aborted.', timeout('The write operation timed out'))" 2022-11-17 18:36:46,328 - telegram.vendor.ptb_urllib3.urllib3.connectionpool - WARNING - Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<telegram.vendor.ptb_urllib3.urllib3.connectionpool.HTTPSConnectionPool object at 0x7ffa871ae5e0>, 'Connect timed out. (connect timeout=5.0)')': /bot5311185340:AAHLVEEsGbxiIf1arRY_qIxsJAbSGPpylZ8/sendMessage
Honestly it would be fine to have just the fotos....
-- CordialitĂ / LG / regards RB
@otrebor4 Tried today... installed ubuntu server 22.04.2 LTS..
1Âş It cant access to /dev/video0 for the user so... sudo useradd "youruser" video sudo chmod 777 /dev/video0 reboot...
2Âş error open Could not find encoder for codec_id=27, error: Encoder not found solution: change codec order (yes, opencv installed through pip has a bug) in surveillance-bot/camera.py change for codec in ['avc1', 'mp4v']: to for codec in ['mp4v', 'avc1']:
Solved, it runs... but on iPhone videos cannot be playable, only on windows/android....
@pchinea opencv installed through pip has a bug with codecs... so one way is build opencv yourself or change that codec order in your code
Hi there! i have installed this interesting piece of sw but this is the error i get - it does not work - there must be something which i forgot to install or something.... any help appreciated.
[ERROR:0@1.013] global /io/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp (2767) open Could not find encoder for codec_id=27, error: Encoder not found [ERROR:0@1.014] global /io/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp (2839) open VIDEOIO/FFMPEG: Failed to initialize VideoWriter
My system is: Linux abcd 5.10.0-11-amd64 #1 SMP Debian 5.10.92-1 (2022-01-18) x86_64 GNU/Linux