Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opencv error ? need help #20

Open
otrebor4 opened this issue May 5, 2022 · 11 comments
Open

opencv error ? need help #20

otrebor4 opened this issue May 5, 2022 · 11 comments

Comments

@otrebor4
Copy link

otrebor4 commented May 5, 2022

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

@sonykurian96
Copy link

sonykurian96 commented Nov 7, 2022

@otrebor4, @pchinea how to run this library? Can you please share the code?

@pchinea
Copy link
Owner

pchinea commented Nov 7, 2022

@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.

@pchinea
Copy link
Owner

pchinea commented Nov 7, 2022

@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.

@sonykurian96
Copy link

@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 🤝.

@otrebor4
Copy link
Author

otrebor4 commented Nov 14, 2022 via email

@otrebor4
Copy link
Author

otrebor4 commented Nov 14, 2022 via email

@otrebor4
Copy link
Author

otrebor4 commented Nov 14, 2022 via email

@otrebor4
Copy link
Author

otrebor4 commented Nov 14, 2022 via email

@otrebor4
Copy link
Author

otrebor4 commented Nov 15, 2022 via email

@otrebor4
Copy link
Author

otrebor4 commented Nov 17, 2022 via email

@ebuwiz
Copy link

ebuwiz commented Apr 24, 2024

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants