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


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.
16.04 webcam c++ opencv code-blocks
add a comment |Â
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.
16.04 webcam c++ opencv code-blocks
Can anyone please help? I mean this place is full of geniuses.. what is going on?
â Winbuntu
May 2 at 12:51
add a comment |Â
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.
16.04 webcam c++ opencv code-blocks
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.
16.04 webcam c++ opencv code-blocks
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
add a comment |Â
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
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Can anyone please help? I mean this place is full of geniuses.. what is going on?
â Winbuntu
May 2 at 12:51