Accessing an IP camera in Ubuntu through Code::Blocks IDE

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












I am working on a task in which I have to access live stream of an IP Camera (Edimax IC-3110P) using OpenCV 3. My Host system is Windows 10 and I have used Virtualbox to run Ubuntu 16.04 (Xenial) 64-bit. I am using C++ and Code::Blocks(IDE).



Finally I was able to access the livestream through Microsoft Visual Studio(in Windows 10) with the following program.



#include <stdio.h>
#include <opencv2/opencv.hpp>
#include <iostream>

int main(int, char**)
cv::VideoCapture vcap;
cv::Mat image;

// This works on a D-Link CDS-932L

const std::string videoStreamAddress =
"http://admin:1234@192.168.2.3/mjpg/video.mjpg";
//open the video stream and make sure it's opened

if(!vcap.open(videoStreamAddress))
std::cout << "Error opening video stream or file" << std::endl;
return -1;


for(;;)
if(!vcap.read(image))
std::cout << "No frame" << std::endl;
cv::waitKey();

cv::imshow("Output Window", image);

if(cv::waitKey(1) >= 0) break;





However, in Ubuntu with the same program in Code::Blocks it shows "Error loading stream video or file."



This camera doesn't support Linux OS but I can access the livestream through a browser's address bar(in Ubuntu) but not through my program.







share|improve this question






















  • Can anyone please help? I mean this place is full of geniuses.. what is going on?
    – Winbuntu
    May 2 at 12:51














up vote
0
down vote

favorite












I am working on a task in which I have to access live stream of an IP Camera (Edimax IC-3110P) using OpenCV 3. My Host system is Windows 10 and I have used Virtualbox to run Ubuntu 16.04 (Xenial) 64-bit. I am using C++ and Code::Blocks(IDE).



Finally I was able to access the livestream through Microsoft Visual Studio(in Windows 10) with the following program.



#include <stdio.h>
#include <opencv2/opencv.hpp>
#include <iostream>

int main(int, char**)
cv::VideoCapture vcap;
cv::Mat image;

// This works on a D-Link CDS-932L

const std::string videoStreamAddress =
"http://admin:1234@192.168.2.3/mjpg/video.mjpg";
//open the video stream and make sure it's opened

if(!vcap.open(videoStreamAddress))
std::cout << "Error opening video stream or file" << std::endl;
return -1;


for(;;)
if(!vcap.read(image))
std::cout << "No frame" << std::endl;
cv::waitKey();

cv::imshow("Output Window", image);

if(cv::waitKey(1) >= 0) break;





However, in Ubuntu with the same program in Code::Blocks it shows "Error loading stream video or file."



This camera doesn't support Linux OS but I can access the livestream through a browser's address bar(in Ubuntu) but not through my program.







share|improve this question






















  • Can anyone please help? I mean this place is full of geniuses.. what is going on?
    – Winbuntu
    May 2 at 12:51












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am working on a task in which I have to access live stream of an IP Camera (Edimax IC-3110P) using OpenCV 3. My Host system is Windows 10 and I have used Virtualbox to run Ubuntu 16.04 (Xenial) 64-bit. I am using C++ and Code::Blocks(IDE).



Finally I was able to access the livestream through Microsoft Visual Studio(in Windows 10) with the following program.



#include <stdio.h>
#include <opencv2/opencv.hpp>
#include <iostream>

int main(int, char**)
cv::VideoCapture vcap;
cv::Mat image;

// This works on a D-Link CDS-932L

const std::string videoStreamAddress =
"http://admin:1234@192.168.2.3/mjpg/video.mjpg";
//open the video stream and make sure it's opened

if(!vcap.open(videoStreamAddress))
std::cout << "Error opening video stream or file" << std::endl;
return -1;


for(;;)
if(!vcap.read(image))
std::cout << "No frame" << std::endl;
cv::waitKey();

cv::imshow("Output Window", image);

if(cv::waitKey(1) >= 0) break;





However, in Ubuntu with the same program in Code::Blocks it shows "Error loading stream video or file."



This camera doesn't support Linux OS but I can access the livestream through a browser's address bar(in Ubuntu) but not through my program.







share|improve this question














I am working on a task in which I have to access live stream of an IP Camera (Edimax IC-3110P) using OpenCV 3. My Host system is Windows 10 and I have used Virtualbox to run Ubuntu 16.04 (Xenial) 64-bit. I am using C++ and Code::Blocks(IDE).



Finally I was able to access the livestream through Microsoft Visual Studio(in Windows 10) with the following program.



#include <stdio.h>
#include <opencv2/opencv.hpp>
#include <iostream>

int main(int, char**)
cv::VideoCapture vcap;
cv::Mat image;

// This works on a D-Link CDS-932L

const std::string videoStreamAddress =
"http://admin:1234@192.168.2.3/mjpg/video.mjpg";
//open the video stream and make sure it's opened

if(!vcap.open(videoStreamAddress))
std::cout << "Error opening video stream or file" << std::endl;
return -1;


for(;;)
if(!vcap.read(image))
std::cout << "No frame" << std::endl;
cv::waitKey();

cv::imshow("Output Window", image);

if(cv::waitKey(1) >= 0) break;





However, in Ubuntu with the same program in Code::Blocks it shows "Error loading stream video or file."



This camera doesn't support Linux OS but I can access the livestream through a browser's address bar(in Ubuntu) but not through my program.









share|improve this question













share|improve this question




share|improve this question








edited Apr 30 at 14:39









Karl Richter

2,25073361




2,25073361










asked Apr 30 at 13:44









Winbuntu

11




11











  • Can anyone please help? I mean this place is full of geniuses.. what is going on?
    – Winbuntu
    May 2 at 12:51
















  • Can anyone please help? I mean this place is full of geniuses.. what is going on?
    – Winbuntu
    May 2 at 12:51















Can anyone please help? I mean this place is full of geniuses.. what is going on?
– Winbuntu
May 2 at 12:51




Can anyone please help? I mean this place is full of geniuses.. what is going on?
– Winbuntu
May 2 at 12:51















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1030128%2faccessing-an-ip-camera-in-ubuntu-through-codeblocks-ide%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1030128%2faccessing-an-ip-camera-in-ubuntu-through-codeblocks-ide%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

GRUB: Fatal! inconsistent data read from (0x84) 0+xxxxxx

`kcmshell` modules relation with `/usr/share/applications`

How to enroll fingerprints to Ubuntu 17.10 with VFS491