c++ - OpenCV and GoPro - empty frames in VideoCapture stream -


I have Gopiro Hero 3+ (Black) connected to a video capture card (Eveready Game Broadcaster HD). I just want to get the video stream in OpenCV, there is no problem with a Logitech webcam. The code used is below.

  videocapture cap; Cap.open (0); WaitKey (300); //cap.set(CV_CAP_PROP_FRAME_WIDTH, 1280); //cap.set(CV_CAP_PROP_FRAME_HEIGHT, 720); If (cap.isOpened ()) {cout & lt; & Lt; "Identification of cam" & lt; & Lt; Endl; } Named window ("DST", 1); While (1) {mat frame; If (! Cap.read (frame)) {std :: cout & lt; & Lt; "Unable to read frame from video stream" & lt; & Lt; Std :: endl; to continue; } Imshow ("dst", frame); [...]}  

GoPro is accompanied by: OpenCV is able to open VideoCapture ("Cam Identity"), but can not read any frame (just one Gray screen and output: "Unable to read frame from video stream"). I also checked with this frame. Forgiveness ()..

I know that the video capture card works right because Unity opens a webcam architecture with Gopipro stream without any issue. I read about codec problems in OpenCV and so I have already tried to compile OpenCV with FFMPEG support. Now the Gopo's recorded MP4-Video can be displayed but the stream still does not work.

I use OpenCV 2.48, Windows 7, and Visual Studio 2013.


EDIT: Here is the code for LVVLC solution:

  struct ctx {uint8_t * pixeldata; Std :: mutex imagemutex; }; Static zero performance (zero * data, zero * id); Static Zero Unlock (Zero * Data, Zero * Id, Zero * Constant * p_pixels); Fixed zero * lock (zero * data, zero ** p_pixels); Structure CTX CTX; Libvlc_instance_t * inst; Libvlc_media_player_t * mp; Libvlc_media_t * m; Int main (int argc, char * argv []) {ctx.pixeldata = new uint8_t [1280 * 720 * 3]; Char const * vlc_argv [] = {"-vvv", "--no-audio", / * Skip any audio track * / "--no-xlib", / * VLC to not use XLIB Explain; Int vlc_argc = sizeof (vlc_argv) / size (* vlc_argv); Inst = libvlc_new (vlc_argc, vlc_argv); Const char * options [] = {": dshow-vdev = AVerMedia HD capture", ": dshow-adev = none", // ": dshow-size = 1280x720", ": dshow-fps = 24", ": Dshow-chroma = YUY2 ",": dshow-video-input = 1 ",": dshow-video-output = 1 ",": dshow-aspect-ratio = 16 \: 9 ",": live-caching = 80 ",         Zero     }; M = libvlc_media_new_location (inst, "dshow: //"); For (const char ** opt = options; * opt; opt ++) libvlc_media_add_option (m, * opt); MP = libvlc_media_player_new_from_media (m); Libvlc_media_release (m); Libvlc_video_set_callbacks (mp3, lock, unlock, display, and ctx); Libvlc_video_set_format (mp, "RV24", 1280, 720, 1280 * 3); Libvlc_media_player_play (mp); Nominated Window ("All", 1); Mat frame (720, 1280, CV_8UC3); While (1) {ctx.imagemutex.lock (); Memcpy (gesamt.data, ctx.pixeldata, 1280 * 720 * size (uint8_t) * 3); Ctx.imagemutex.unlock (); Imshow ("all", gesamt); If waiting for the 'ASK key' press for 30 (30) of wait (30) == 27) If the 'ASK' key is pressed, then break loop {cout & lt; & Lt; "ASK key is pressed by user" & lt; & Lt; Endl; break; }} Libvlc_media_player_stop (mp); Libvlc_media_player_release (mp); Libvlc_release (inst); Delete [] ctx.pixeldata; Return 0; } Zero performance (zero * data, zero * id) {(zero) data; Emphasis (id == faucet); } Zero unlock (Zero * data, Zero * Id, Zero * Constant * p_pixels) {struct ctx * ctx = (struct ctx *) data; Ctx-> Imagemutex.unlock (); Emphasis (id == faucet); } Zero * lock (Zero * data, Zero ** p_pixels) {struct ctx * ctx = (struct ctx *) data; Ctx-> Imagemutex.lock (); * P_pixels = ctx-> pixeldata; Return tap; }  

I have issues that try to stream a Sony Action Cam EverMedia Capture Card seems to be using a quick fix DVDRive, which uses your capture card output as a webcam, I used it as a workaround.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -