Bug 987905 - GStreamer Theora error with VideoWriter in Python
GStreamer Theora error with VideoWriter in Python
Product: Fedora
Classification: Fedora
Component: opencv (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Nicolas Chauvet (kwizart)
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-07-24 07:55 EDT by Jan Sedlák
Modified: 2014-08-19 02:52 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-08-19 02:52:03 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jan Sedlák 2013-07-24 07:55:38 EDT
Description of problem:
When I try to use VideoWriter in Python and I use Theora as a codec, it shows traceback:

>>> vw = cv2.VideoWriter("test.ogv", cv2.cv.CV_FOURCC('T', 'H', 'E', 'O'), 2, (1024, 768), True)
OpenCV Error: Unspecified error (GStreamer: cannot link elements
) in CvVideoWriter_GStreamer::open, file /builddir/build/BUILD/opencv-2.4.5/modules/highgui/src/cap_gstreamer.cpp, line 552
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
cv2.error: /builddir/build/BUILD/opencv-2.4.5/modules/highgui/src/cap_gstreamer.cpp:552: error: (-2) GStreamer: cannot link elements
 in function CvVideoWriter_GStreamer::open

I don't really know what codec I should use for VideoWriter, because Theora doesn't work and MPEG is proprietary.

How reproducible:

Steps to Reproduce:
1. Install opencv-python bindings.
2. Start python console, import cv2.
3. Run "cv2.VideoWriter("test.ogv", cv2.cv.CV_FOURCC('T', 'H', 'E', 'O'), 2, (1024, 768), True)"

Actual results:
It shows "unspecified error".

Expected results:
It should work.
Comment 1 Nicolas Chauvet (kwizart) 2013-07-24 08:42:00 EDT
I don't why it doesn't work with THEO, maybe related to the content or size expected by the encoder ?
Now it seems to work with VP80, please verify to have the libvpx gstreamer plugin.
Comment 2 Jan Sedlák 2013-07-24 10:28:38 EDT
It may be problem in GStreamer and not in cv2, but I don't know. Are you able to create VideoWriter using THEO? Anyway, VP8, as it seems, works.
Comment 3 Nicolas Chauvet (kwizart) 2013-07-24 11:23:31 EDT
No I cannot create a VideoWriter with THEO either.
Comment 4 Jan Sedlák 2013-07-30 04:21:56 EDT
To be honest, I am still unable to create video using VideoWriter and VP80 codec. I create VideoWriter using "vw = cv2.VideoWriter("out.webm", cv2.cv.CV_FOURCC(*"VP80"), 2, (1024, 768), True)", load several 1024x768 PNG images with cv2.imread() and write them using "vw.write(image)", but out.webm is somehow corrupted and it seems that "vw.write(image)" doesn't really write images into output file.
Comment 5 Nicolas Chauvet (kwizart) 2013-10-01 17:33:09 EDT
Did you tried with others codec ?
Comment 6 Jan Sedlák 2013-10-02 04:50:43 EDT
I am able to create output video file using XVID, but I think that I had to install something from rpmfusion to be able to do it.
Comment 7 Nicolas Chauvet (kwizart) 2013-10-02 05:00:22 EDT
Using additional dependencies would have been expected, because the encoder and even the decoder are not in fedora. But it should work on free codec provided that the encoder is installed (which might not be done by default)

Note You need to log in before you can comment on or make changes to this bug.