Important Message from Foscam Digital Technologies Regarding US Sales & Service

Foscam.US (aka Foscam Digital Technologies and now Amcrest Technologies) is an independent United States based distributor of "Foscam" branded products. We have been offering telephone support, US local warranty and building the Foscam brand in the US for the past 7 years. Based on our experiences with Foscam and feedback from end users we have launched our own new and improved line of wireless IP cameras and security systems under the Amcrest brand. Working in partnership with the second largest security camera manufacturer in the world, Amcrest was founded with a deep commitment to end-user privacy and security, highly reliable software and hardware as well a seamless and intuitive user experience. For more information, please visit www.Amcrest.com

If you are having trouble with your Foscam cameras, we sincerely apologize for this inconvenience and would love to help. For technical support, response to inquiries and for obtaining replacements for any Foscam IP Cameras or NVR products, please reach out to tech@foscam.com or call 1-844-344-1113.

If you are interested in exchanging your Foscam camera for an Amcrest camera, we can offer you a massive loyalty discount, even if you are out of warranty. Please send an email to support@amcrest.com, sales@amcrest.com or call 1-888-212-7538

If you are subscribed to Foscam Cloud (www.foscamcloud.com), please contact cloud@foscam.us for support.

If you currently use the manufacturer's cloud service (www.myfoscam.com or linked in any way to www.foscam.com), you will need to contact them directly for support, at www.myfoscam.com.


Sample code to decode and play audio on Windows

Users can ask and answer questions regarding Foscam IP Cameras

Moderators: mycam, FOSCAM

Sample code to decode and play audio on Windows

Postby Andrea » Tue Apr 09, 2013 8:03 pm

Hi,
I have a FI8910W camera and I'm looking into write a C# app.
I'm looking for a sample source code to read and play the audio stream in in C# for .NET or WinRT. Nice to find a sample to send an audio stream to the camera too.

If there are no C# sample code available, do you have a C++ sample or an abstract from the ActiveX source code?

Thank you in advance
Andrea
Andrea
 
Posts: 3
Joined: Tue Apr 09, 2013 7:50 pm

Re: Sample code to decode and play audio on Windows

Postby TheUberOverLord » Tue Apr 09, 2013 8:37 pm

Andrea wrote:Hi,
I have a FI8910W camera and I'm looking into write a C# app.
I'm looking for a sample source code to read and play the audio stream in in C# for .NET or WinRT. Nice to find a sample to send an audio stream to the camera too.

If there are no C# sample code available, do you have a C++ sample or an abstract from the ActiveX source code?

Thank you in advance
Andrea


Please see this:

http://foscam.us/forum/interfacing-fi8910w-to-windows-8-t4008.html?hilit=audio#p19005

It's not a code example. But. It does have a link to the audio protocol format and structure, for the MJPEG based, IP cameras.

Additionally. Using tools like Wireshark:

http://www.wireshark.org/

While using the IE ("Internet Explorer") browser and the ActiveX interface for the camera, using the standard camera interface that comes with the camera.

You can trace the request/response data packets. While sending/receiving audio with the camera. To trace how those request/response data packets are formatted.

As mentioned in the contents of my first link, in this post. These low level data packets can also be used for many other things, such as, one example. Moving the cameras position as well.

The more extensive document, that goes into more details about the low level interface beyond the audio interface. Is in Chinese. Whereas the document linked to, about the low level audio interface. Is in English.

Full Low Level Protocol Documentation Translated to English from Chinese:

http://translate.google.com/translate?sl=zh-CN&tl=en&js=n&prev=_t&hl=en&ie=UTF-8&eotf=1&u=http%3A%2F%2Fwww.saveontelephonebills.com%2Fcamera%2FMJPEGLowLevelChinese.pdf&act=url

Full Low Level Protocol Documentation in Chinese ("Original Documentation")

http://www.saveontelephonebills.com/camera/MJPEGLowLevelChinese.pdf

Here is an example C++ project that includes a pre-compiled binary .exe ("ipcam_sample.exe") That is in .rar format. Because there is some Chinese included and .zip does not do well, when compressing Chinese:

http://www.saveontelephonebills.com/camera/FOSCAM_%20SDK_AudioVideo.rar

The above example ("older") C++ project. Does not include using the low level protocol to send audio to the camera or control camera movement. It does however, include logging into the camera and processing both video and audio received from the camera. Using the low level protocol.

Don
TheUberOverLord
 
Posts: 13110
Joined: Fri Jun 22, 2012 11:52 pm

Re: Sample code to decode and play audio on Windows

Postby Andrea » Tue Apr 09, 2013 9:26 pm

Thank you Don, I'm asking a code sample, I saw the documentation.
It is too costly to write the audio decoder from the documentation.
Andrea
 
Posts: 3
Joined: Tue Apr 09, 2013 7:50 pm

Re: Sample code to decode and play audio on Windows

Postby TheUberOverLord » Tue Apr 09, 2013 9:35 pm

Andrea wrote:Thank you Don, I'm asking a code sample, I saw the documentation.
It is too costly to write the audio decoder from the documentation.

You are very welcome.

Please re-read my prior post here. I have edited it and added a code example. That also includes a pre-compiled binary .exe.

AFAIK. There are no C# or other .NET based language examples or newer versions of C++ examples of the audio low level interface, in the public domain.

Also. I have not seen all this information about the complete low level interface to the MJPEG based cameras, located in one place, as it is now, in my prior post here. Prior to me posting it here, as well.

IMHO. The reason why this is the case. Is that the vast majority of developers that create low level interfaces to the MJPEG based cameras, create software for sale. So, it makes no sense for them to create free "Open Source" code examples. All that would do, is create potential competition.

The documentation, in my prior post here. Is very clear and complete, once translated. It should be easy to create an interface by using it.

As stated earlier. You can also use Wireshark to validate your request/response data packets and compare them to the same functions and features that the ActiveX standard camera interface data request/response data packets use, for those same functions and features.

Don
TheUberOverLord
 
Posts: 13110
Joined: Fri Jun 22, 2012 11:52 pm

Re: Sample code to decode and play audio on Windows

Postby Andrea » Wed Apr 10, 2013 3:08 pm

MJEPG looks very common across all IP Cameras, for that matter you can easily found the open source C# MJPEG decoder see http://mjpeg.codeplex.com/

Bidirectional Audio seams not standards and certainly a differentiated feature of the FOSCAM camera I bought.

If you are in the business of increasing the usage and adoption of FOSCAM cameras I think you should help developers in using the unique features of FOSCAM products and not the industry standard.

my 2 cents
Andrea
 
Posts: 3
Joined: Tue Apr 09, 2013 7:50 pm

Re: Sample code to decode and play audio on Windows

Postby TheUberOverLord » Wed Apr 10, 2013 4:45 pm

Andrea wrote:MJEPG looks very common across all IP Cameras, for that matter you can easily found the open source C# MJPEG decoder see http://mjpeg.codeplex.com/

Bidirectional Audio seams not standards and certainly a differentiated feature of the FOSCAM camera I bought.

If you are in the business of increasing the usage and adoption of FOSCAM cameras I think you should help developers in using the unique features of FOSCAM products and not the industry standard.

my 2 cents

Foscam was and is ("Not") the author of ("Any") of the MJPEG based camera firmware. Foscam also was not the author of any firmware for prior H.264 based cameras.

In fact. Foscam just started to create their own firmware, for the newer H.264 based cameras series. Such as the FI9821W/FI9801W/FI9802W camera series.

Firmware, for prior Foscam models, was created and modified, by a 3rd party. Foscam would make a change request and the 3rd party would be responsible for making that change and creating a new firmware version.

More details about this here: http://foscam.us/forum/fi9821w-issue-list-t3967-500.html?hilit=firmware#p24436

So. It's extremely important to know, the facts first. Prior to speculating. As you are and have been.

Bidirectional Audio is supported by the vast majority of MJPEG based cameras, that support the low level audio interface. Including Foscam models. Again. It's knowing how to use the low level protocol audio interface. Which is why I provided that documentation, as a stand-alone document, at first here.

Example. This camera is not a Foscam model. It however, does support Bidirectional Audio as the vast majority of MJPEG based cameras that have audio do:

http://www.openipcam.com/forum/index.ph ... mkalgmg8o2

In order to support Bidirectional Audio, you ("Must") use the low level interface to the camera. Which is what the ActiveX interface, that is included with the standard camera interface is using with IE ("Internet Explorer") based browsers, is using, on some Windows based systems, as well as the code example provided here.

While you could process the .asf output of the camera, using a URL for the camera, to provide received audio and video from the camera. In order to send audio to the camera. It would still require you to use the low level interface to support Bidirectional Audio. So. There is no way around that, other then deciding to only deal with received audio from the camera.

You also need to have some knowledge of PCM and ADPCM methods as well:

http://en.wikipedia.org/wiki/Pulse-code_modulation

http://en.wikipedia.org/wiki/Adaptive_differential_pulse-code_modulation

This can be much more complex, than simply processing a JPEG image from a camera URL, provided by the camera. This is because you will need to route microphone and speaker data from/to the devices in question ("If there is more than one device for each, you may need to offer which device to use, or simply use the default devices for both") vs. simply taking a image and displaying it in some window in your application. Of course you will need to also process the audio buffers from/to the camera and make sure they are in the correct audio formats as well.

Because of these more complicated requirements. Many developers avoid dealing with camera audio, in general. Which is why there are fewer examples of open source code, for processing Bidirectional Audio for MJPEG based cameras.

Much like your current MJPEG example does. Which completely avoids the use of the low level protocol, to even process video. Which gets you virtually nowhere closer, in your quest, to also support Bidirectional Audio.

Your thread here, never mentioned, you had any need to process MJPEG for the camera. In fact. This is your first mention of anything here, to do with MJPEG.

The title of your thread here is:

"Sample code to decode and play audio on Windows".

Since the low level protocol, is used to interface to the audio of the camera. Initially I provided a document for the low level interface, for audio only, based on the topic of your post. Since I know of no stand-alone, audio only code example.

The MJPEG interface you now suddenly reference. Does not support all Windows Platforms: http://channel9.msdn.com/coding4fun/art ... EG-Decoder

Additionally. It has no audio support as well. Also. It is not using the low level interface to the camera and is in fact using a URL to interface to the camera. So I am truly missing your point about it:

http://IPorDDNS:PortForCamera/video.cgi

Especially, since I have provided a code example, which includes a full C++ project, including ALL source code and a pre-compiled .exe from that project, that uses no .dll, is 48KB small and supports both video and audio, alone or combined with each other. Whereas, this above example. Is and can never be, as is. Anything but MJPEG video only.

Your initial post here was:

Andrea wrote:Hi,
I have a FI8910W camera and I'm looking into write a C# app.
I'm looking for a sample source code to read and play the audio stream in in C# for .NET or WinRT. Nice to find a sample to send an audio stream to the camera too.

If there are no C# sample code available, do you have a C++ sample or an abstract from the ActiveX source code?

Thank you in advance
Andrea

This low level interface documentation, does and will work, not only with all Windows platforms. But any and all devices that support TCP/IP interfaces.

After only supplying the low level audio interface documentation. You responded with:

Andrea wrote:Thank you Don, I'm asking a code sample, I saw the documentation.
It is too costly to write the audio decoder from the documentation.

Because of your response. I then included not only the audio interface documentation of the low level protocol in a separate document, but also another document, documenting the entire low level protocol as well as a code example.

The code example, which includes a FULL C++ project, with FULL source code and a pre-compiled .exe from that project, which I provided here. Supports both audio and video. Which is why I also added an additional low level interface document. So that after reviewing that code example. You would have more details on other things the low level protocol supports besides the initial audio only low level interface documentation, that I initially supplied here.

Code Example ("Please note the Foscam logo in the example")
Image

All documentation provided here, as well as the code example, which I provided here. Are and were created specifically, for Foscam MJPEG based cameras.

If needed, please re-review them.

Because your statement of "I think you should help developers in using the unique features of FOSCAM products and not the industry standard" Is not correct.

While the things posted here and linked to here, are and were created for Foscam camera models. Because other brands and models and clones of MJPEG based cameras, use similar firmware. The low level interface documented here. Works with many different MJPEG based cameras.

One can use the pre-compiled .exe, located in the code example, for a MJPEG based camera, to verify if the camera, supports the low level interface, documented here. With no development effort required.

I posted all of this here, in this thread, not just for you. But for others, that may request this Information in the future.

So that it's all here. Complete. In one place. Where I and others can reference it, for others, here. If needed. In the future.

Also:

1. I donate my time here.

2. I do not work for Foscam.

3. I am not in any business of increasing the usage and adoption of Foscam cameras.

4. Please see the "About Me" link in my signature in my posts, to learn more about me vs. speculating about me and giving your
"2 cents" about me, based on your speculations about me or who you may think, I am.

5. Hopefully. You now have more facts and less fiction about things you may have been thinking were correct assumptions.

6. Any coding effort to support Bidirectional Audio will not be a minor project. Because you already are saying that it's "Too Costly" to simply code by the low level protocol specification. IMHO. You might wish to reevaluate, if you even wish to start the project. It can be done. But I have no idea of what your budget constraints are.

7. Based on what you have told me so far. It might be a better idea, to use the .asf URL for the camera, to be able to process the audio/video received from the camera, using some kind of VLC like interface and then use the low level interface to only send audio to the camera. This would allow you to cut down on the size of custom code required to create a functional Bidirectional Audio application.

More here as an example: a-how-to-for-mjpeg-cameras-use-vlc-to-play-and-record-video-t3870.html#p18278

8. It should be noted, that I am very familiar with creating audio interfaces and processing audio buffers. Here is one example, which I created for Skype developers, on how to process DTMF digits received in Skype and PSTN calls:

http://devforum.skype.com/t5/Desktop-API/Example-C-code-for-Skype-DTMF-and-IVR-Menu/td-p/9476

Just wanted to make sure you know that I am not making this up as I go along here. I do know about the timelines and development efforts, required to implement both audio and video interfaces.

So. As you can see. I do other things, to also help developers. Again, with my donated time. That don't only include or are only limited to "IP Cameras":

http://devforum.skype.com/

Thanks

Don
TheUberOverLord
 
Posts: 13110
Joined: Fri Jun 22, 2012 11:52 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 3 guests