Skip to content

cv2.VideoWriter crashes with SIGSEGV on unknown fourcc #15088

@dniku

Description

@dniku
System information (version)
  • OpenCV => 4.1.0-2 from Arch repository
  • Operating System / Platform => Manjaro (fully updated)
Detailed description

In the Python wrapper, unknown fourcc causes cv2.VideoWriter to segfault.

Steps to reproduce
import cv2

fourcc = cv2.VideoWriter_fourcc(*'aaaa')
print(fourcc)
writer = cv2.VideoWriter('/tmp/test.avi', fourcc, 30.0, (320, 240))
$ python test.py
1633771873
OpenCV: FFMPEG: tag 0x61616161/'aaaa' is not found (format 'avi / AVI (Audio Video Interleaved)')'
fish: “python test.py” terminated by signal SIGSEGV (Address boundary error)
Desired solution

Python exception should be thrown. There should also be a way to check whether a fourcc is available without triggering the exception.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions