Could not find encoder for codec id 27: Encoder not found
See original GitHub issueWhen attempting to output a video from the system (an mp4), on initialisation it prints the !!! TYPE message followed by Could not find encoder for codec id 27: Encoder not found then proceeds as normal.
At the end of processing it will error with AttributeError: 'NoneType' object has no attribute '__array_interface__'.
I believe this is caused by opencv-python pip package not being shipped with x264 (open-source h264 encoder), due to GPL issues? (see skvark/opencv-python#81)
Suggestion is to potentially catch this issue before processing lengthy videos. I did a search of the issues here and didn’t find anything related, so hopefully there’s enough here that others may find the reason for their issue.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:5
Top Results From Across the Web
Save video in opencv with H264 codec - python - Stack Overflow
I can solve my problem in the ubuntu:20.04 docker. The important thing you should notice is that you should install OpenCV via apt-get...
Read more >Generating MP4's Using opencv-python With the AVC1 Codec
VideoWriter("movie.mp4", fourcc, 5, (5,5)) Could not find encoder for codec id 27: Encoder not found. For licensing reasons , opencv-python ...
Read more >opencv: ffmpeg: tag 0x00000021/'!???' is not found (format ...
VideoWriter("movie.mp4", fourcc, 5, (5,5)) Could not find encoder for codec id 27: Encoder not found - For licensing reasons,opencv-python does not ship ...
Read more >Output video using OpenCV h264 mp4s on Streamlit Sharing
The mp4v codec encodes the video properly, doesn't show the video ... open Could not find encoder for codec_id=27, error: Encoder not found...
Read more >FFmpeg
The design and implementation is based on the snow video codec, which uses OBMC. ... The native FFmpeg AAC encoder has seen extensive...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I had the same two problems. To fix it, I made the following changes to yolo.py:
On line 177, change:
video_FourCC = int(vid.get(cv2.CAP_PROP_FOURCC))tovideo_FourCC = cv2.VideoWriter_fourcc(*"mp4v")This definitely works with .mp4 and .mov file types, possibly other types too.Immediately after line 190, add:
Thanks. However, I want h264 encode, so mp4v cannot solve my problem