Ask Your Question

aleksejs.fomins's profile - activity

2017-09-27 12:38:14 -0600 received badge  Student (source)
2017-09-27 10:12:39 -0600 commented answer ViderWriter does not work with fourcc=-1

Thanks. MJPG and PIM1 and such all seem to work, only -1 does not work. I guess I can live without it :)

2017-09-27 10:11:38 -0600 received badge  Supporter (source)
2017-09-27 10:11:37 -0600 marked best answer ViderWriter does not work with fourcc=-1

Hi,

I'm trying to run OpenCV 3.3 under Ubuntu 16.04, compiled from sources using cmake. Here's a simple example program

#include "opencv2/opencv.hpp"

int main() {
  cv::VideoWriter outputVideo;
  int fps = 30;
  int fourcc = 0;
  cv::Size S = cv::Size(1024, 768);
  outputVideo.open("trollz.avi", fourcc, fps, S, true);
  if (!outputVideo.isOpened())  { std::cerr << "Could not open the output video" << std::endl; }

  return(0);
}

When fourcc=0, the program runs and produces an empty movie trollz.avi, as expected.

The tutorial in the documentation, namely,

http://docs.opencv.org/3.3.0/d7/d9e/t...

states that, when fourcc=-1, a window must open that would allow the user to select the extension from a list. However, in my case, when fourcc=-1, I get a runtime error:

OpenCV: FFMPEG: tag 0xffffffff/'����' is not found (format 'avi / AVI (Audio Video Interleaved)')'
OpenCV Error: Unsupported format or combination of formats (Gstreamer Opencv backend does not support this codec.) in CvVideoWriter_GStreamer::open, file /home/aleksejs/work/inst/OpenCV/opencv-3.3.0/modules/videoio/src/cap_gstreamer.cpp, line 1522
VIDEOIO(cvCreateVideoWriter_GStreamer (filename, fourcc, fps, frameSize, is_color)): raised OpenCV exception:

/home/aleksejs/work/inst/OpenCV/opencv-3.3.0/modules/videoio/src/cap_gstreamer.cpp:1522: error: (-210) Gstreamer Opencv backend does not support this codec. in function CvVideoWriter_GStreamer::open

Could not open the output video

Please help

2017-09-27 10:11:36 -0600 received badge  Scholar (source)
2017-09-27 10:04:26 -0600 asked a question ViderWriter does not work with fourcc=-1

ViderWriter does not work with fourcc=-1 Hi, I'm trying to run OpenCV 3.3 under Ubuntu 16.04, compiled from sources usi