facebookresearch / facebookresearch/detectron2

Could not find encoder for codec_id=27, error: Encoder not found

Open
#4,119 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
34.7k
Forks
7.9k
PR merge metrics
No merged PRs in 30d

Description

I am getting an Encoder not found and I am not sure how to proceed.

## Instructions To Reproduce the 🐛 Bug:
1. Full runnable code or full changes you made:

I made no chan ges
2. What exact command you run:

python demo.py --config-file /scratch/aa7858/temp2/detectron2/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml \
--video-input /scratch/aa7858/temp2/VIRB0008.MP4 --output output.mp4 --opts MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl"
~
4. __Full logs__ or other relevant observations:

^[[32m[04/01 14:47:04 detectron2]: ^[[0mArguments: Namespace(config_file='/scratch/aa7858/temp2/detectron2/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml', webcam=False, video_input='/scratch/aa7858/temp2/VIRB0008.MP4', input=None, output='output.mp4', confidence_threshold=0.5, opts=['MODEL.WEIGHTS', 'detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl'])
^[[32m[04/01 14:47:27 fvcore.common.checkpoint]: ^[[0m[Checkpointer] Loading from detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl ...
^[[32m[04/01 14:47:27 fvcore.common.checkpoint]: ^[[0mReading a file from 'Detectron2 Model Zoo'
[ERROR:0@39.591] 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@39.591] global /io/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp (2839) open VIDEOIO/FFMPEG: Failed to initialize VideoWriter
[ERROR:0@39.627] global /io/opencv/modules/videoio/src/cap.cpp (595) open VIDEOIO(CV_IMAGES): raised OpenCV exception:

OpenCV(4.5.5) /io/opencv/modules/videoio/src/cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): /state/partition1/job-16997621/video_format_testeulao3rh/test_file.mkv in function 'icvExtractPattern'

5. please simplify the steps as much as possible so they do not require additional resources to
run, such as a private dataset.

## Expected behavior:

I expect it to run detection 2 without any issues. And give us the output that you will see in the sample videos. It seems like this error occurs when it is trying to analyze the video and will just output the original video.

If there are no obvious error in "full logs" provided above,
please tell us the expected behavior.

## Environment:

Provide your environment information using the following command:
```
wget -nc -q https://github.com/facebookresearch/detectron2/raw/main/detectron2/utils/collect_env.py && python collect_env.py
```

If your issue looks like an installation issue / environment issue,
please first try to solve it yourself with the instructions in
https://detectron2.readthedocs.io/tutorials/install.html#common-installation-issues

Contributor guide

Open the contributing guide

Research direction

Start with demo.py's video-input and output handling, then review the logged OpenCV VideoWriter failure. Reproduce with the supplied command and collect the missing environment details using collect_env.py, comparing them with the installation guide's common issues. Done would require a confirmed, reproducible fix or a documented explanation of the environment problem.

Written by the indexing model from the issue text.

Assessment

Tech stack
opencv, python
Domain
computer-vision
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.