Retrieve network camera stream URL in Linux - c

I am trying to retrieve rtsp URLs of cameras on my network. I can do this using Onvif Device Manager on Windows but how to do this on Linux using C/C++ or command line tool. I have tried various libs e.g. onvifc (OpenCVR) and onvifcpplib but none of them could compile on Linux, neither they have API documentation. Any suggestions please!

I was able to find a gsoap-onvif solution from https://github.com/tonyhu/gsoap-onvif. This programs successfully retrieves parameters from most of the Onvif complaint cameras.

you can have a try with python onvif, some feature you can use, may be other feature such as PTZ you can use .
also, you can have a try with opencvr's another project, https://github.com/veyesys/h5stream, if you can't compile,you can download from sourceforge.
Good luck.

Related

HINTERNET InternetOpenUrl() on linux C

I am a native windows programmer and I was just starting to develop some applications on linux. I was wondering if there is a linux function similar to InternetOpenUrl(). I wanted to use this so I could open the Speakeasy speed test to download random images according to size to "speed test" internet connections. If there isn't a similar command does anyone have some C code for initiating a http socket to a server to download a file (or code to do the same on a ftp although i rather not use ftp). I would rather use the InternetOpenUrl() alternative if there is one but i am also open to other methods as well.
You're looking for libcurl, which incidentally also works on Windows.

using libcurl to create a standalone site-polling program

I am creating a standalone (no DLLs) windows C/C++ program that uses HTTP POST to periodically send data to an HTTP server. I identified libCURL as the HTTP client library as it seems simple and reliable.
I still need to identify the environment (an IDE) which I can use to develop my project. My program has:
poller- which checks the status of the connection
a file writer when polled link is down
a component which POSTs the file when link is up
What is the appropriate IDE for this project? I heard endorsements for DevC++ and Visual C.
I am a newb to coding and this site. Pardon me if I am unclear in anything.
Any IDE will fit your need. Just install one of them and start coding.
Try CodeBlocks. It is light, more easy to work with and has more features than Dev C++.

Cache Outgoing Data from browser

This might be a very broad question. But this is what i want. I open a website and enter some details in the website like my credentials to login or it may be any data that pass from my browser to the website. Now what i want is that i should cache ( write to a temp file ) whatever that i send to that website. How can this be done? I tried to extract the data present in the packets that are flowing out of my machine but i find only junk characters in that (may be header). any ideas are welcomed. I am using Ubuntu Linux and would like to achieve this using shell script/C/C++
One option would be to use the Fiddler Web Debugger which is scriptable (C#).
Although it's a Win32 program, it can act as a proxy for any Linux machine. See Debug traffic from another machine (even a Mac or Unix box) for details.
There's also a native Linux app called dsniff which can be used to log all HTTP traffic to a file.

How to download web content using C?

I have to write a C parser for online blogs and different word manipulation features.
I know how to parse / tokenise stings in C, but how would you on execution download the pages content to a local /tmp directory as an HTML file so I can save the information (the blogs) into a string using I/O?
Or, just grab the block of text directly from the page I am viewing...
My system could be either Ubuntu or Windows 7, so I dont think wget will cut it. Please help.
Take a look at libcurl:
libcurl is a free and easy-to-use client-side URL transfer library, supporting [...] HTTP, HTTPS, [...]
libcurl is highly portable, it builds and works identically on numerous platforms, including [...] Linux, [...] Windows, [...]
Alternatively you can make use of system to execute wget
And there is libsoup too.
MSDN: URLDownloadToFile

Getting proxy information on Linux programmatically

I am currently using libproxy to get the proxy information (if any) on RedHat and Debian Linux. It doesn't work all that well, but it's the only way I know I can use to get the proxy information from my code.
I need to stop using the lib since in most cases it doesn't recognize the proxy.
Is there any way to acquire the proxy information? What i mean is, is there a file (or group of files) i can read, or an env variable or an API or system call that i can use to get the information?
Gnome based code is OK, KDE might help as well but i am looking for something more generic.
The code is C.
Now, before anyone asks, I don't want to use libproxy anymore. Period. I don't want to start investigating why it doesn't work. I don't really want to know whether there is a new version of that lib. I know it might work, I just don't want to use it. i can't use it (just because). So please don't point me that way.
Code is appreciated.
thanks.
In linux, the "global proxy setting" is typically just environment variables that are usually set in /etc/profile. You can examine those variables to see what proxy is set.
The variables are:
http_proxy - the proxy for HTTP connections
ftp_proxy - the proxy for FTP connections
Using the Network Proxy Preferences tool under Gnome saves information in the GConf database. The path to the keys are /system/http_proxy and /system/proxy. You can read about the detail in those trees at this page.
You can access the GConf database using the library API. Note that GConf is based on GObject. To examine the contents of this tree using the command line, try the following:
gconftool-2 -R /system/http_proxy
This will provide a "name = value" listing of the tree, which may be usable in your application. Note that this requires a system() call, so it's not recommended for a deployed application, but it might help you get started.
GNOME has its own place to store the Proxy settings, and I am sure KDE or any other DE has its own place too. May be you can look for any mention of where Proxy settings should be store in the Linux Standard Base. That could hint you a standard of doing it irrespective of Distro or DE.
DE -> Desktop Environment
char* proxy = getenv("all_proxy");
This statement puts the value of the environment variable called all_proxy, which is used by the system as a global proxy, in your C variable.
To print it in bash, try env | grep 'all_proxy' | cut -d= -f 2.

Resources