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: FFMPEG: tag is not supported with codec id 12 and format 'mp4 / MP4 #809

Open
alexpavlidespyrra opened this issue May 23, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@alexpavlidespyrra
Copy link

This error happens when calling:

detections = self.video_detector.detectObjectsFromVideo(input_file_path=input_data,
                                        output_file_path=output_video_path,
                                        frames_per_second=frames_per_second,
                                        minimum_percentage_probability=min_percent_prob,
                                        video_complete_function=self.get_output)

I had a look under the hood and this line caused the problem:


output_video = cv2.VideoWriter(output_video_filepath, cv2.VideoWriter_fourcc(*"MP4V"),
                                            frames_per_second,
                                            (frame_width, frame_height))

According to this post https://stackoverflow.com/questions/57792837/opencv-ffmpeg-tag-is-not-supported-with-codec-id-12-and-format-mp4-mp4 changing MP4V to lowercase mp4v fixes the problem. I tried it and it fixed the problem. Please can you make this change? Thanks.

@OlafenwaMoses
Copy link
Owner

@alexpavlidespyrra thanks, will effect this change in next update.

@OlafenwaMoses OlafenwaMoses added the bug Something isn't working label Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants