How to receive MPEG-TS multicast from Windows - windows

We currently have a system with live video encoded to an MPEG-TS multicast stream, being received by televisions with STBs. In addition to televisions we'd like to embed the video in our Windows application.
I know that VLC will receive the stream, but would prefer both a solution that I can embed in an existing application without playing window moving games, and one without licensing problem. I realize that likely means that I'm not looking at a free solution, that's fine, within reason.
Anyone know of a good product for this? Either something easy to use, or a plug-in for WMP.

You'll need to develop a simple DirectShow filter that listens on a given port and just passes down every packet it had received.
I don't have a sample handy, but it's really simple, several hundreds lines of code.
Then you just connect this filter to an MPEG2 Demultiplexer capable of decoding transport stream.
NVidia and Elecard come to mind first, though the former one does not connect under debugger.
Then you connect the demultiplexer to the decoder and finally to the renderer.
The demultiplexers and decoders handle the live stream issues well, you just capture the UDP packets and send down to them.
Due to licensing issues, MPEG2 decoders cannot be free (ffmpeg and VLC violate the license), so you'll have to buy the decoder.
Visit http://elecard.com, they have a nice range of MPEG2 products.

Expanding on Quassnoi's answer...
You might check out the Haali Media Splitter to act as a "MPEG2 Demultiplexer." This is a filter that just pulls the compressed video and sound out of the transport stream, so I'm guessing it doesn't have any licensing issues. Most PCs with a DVD player on them already have a licensed DirectShow MPEG2 decoder, so you can probably just use one that's already installed (or purchase a license from a place like elecard if you really want to be safe).
As you are developing your DirectShow application, you might find Monogram GraphStudio to be a helpful tool in designing the filter chains.

Related

transmit screen buffer of a specific application to a remote system and reproduce image from that (in windows)

I know, there are apps out there like steam, Xbox that streams the game video onto network. What I want is the same thing but i need to make my own code for the purpose (open source), so that I may amend it for different applications without any copyright issues. I know Winsock programming and can transmit sample videos (mp4 files) but this thing of capturing the display on one system and producing it on some remote system is different and much complicated (i suppose). Plus, the streaming needs to be live with minimum delays. I have access to gigabit ethernet to address slow fps issues but first i need to transmit recieve a sample buffer
If someone please guide me on how to go about it
I think gstreamer is the closest thing to what you want. Look here and here for more info.
Also, look at ffmpeg.
The solution I found is OBS studio. It is open source which allows me to edit the source code as to fulfill my needs. However, I had to implement a nginx-rtmp server on the client end to receive the video. I then used vlc media player to stream the video received by the rtmp server. I have Gtx 960m installed so I implemented harware encoding which allowed me to stream 720p #60 fps over 100 Mbps ethernet cable. The results were drastic when I used software encoder (instead of hardware) before streaming.

Can i use SAPI directly to convert Speech to Text from stored audio in real-time

What i really want to achieve is this-->
Suppose i play an audio file(using my application) which can either be streamed from the internet/or accessed directly from the local storage.
Now i want to configure SAPI to listen to this source instead of the microphone and convert the speech from the audio to text like it does normally.
I do not think SAPI supports this itself.
There are some approaches you could use that are "external" to SAPI:
Get a male-to-male miniplug cable and plug your soundcard's output into your soundcard's input
Use Virtual Audio Cable which basically achieves #1 but with virtual soundcard software instead of hardware. It can be very tricky at first to understand how Virtual Audio Cable works, and how to use it, but it does work very well once you figure it out.
Some soundcards have a built-in loopback feature, which allows you to record what the soundcard is playing instead of recording from e.g. a microphone. Here are some good info links: What U Hear and Stereo Mix. Also try Googling those terms for more info.
Only WAV seems to be supported out of the box - See here
Quoting:
The wav file input scenario is special because it uses controlled, reproducible audio input and requires a dedicated SR engine, without interference from other applications (e.g., a shared desktop microphone). The file input scenario should use a generic SAPI audio stream connected to the input wav file and an InProc SR engine.

Can I programatically save the data stream sent to the sound card as a WAV file?

In Windows XP, you can configure your sound card properties via the preloaded windows software. In the recording properties, if "stereo mix" or "wave out" (or something similar) is selected as the recording device, programs that can record audio ("Sound Recorder" in windows for example) record a decent quality wave file of the audio stream. I usually use Goldwave from download.com to do this as an example of a third-party application that functions the same.
Well, I've had trouble getting this scenario to happen on Windows Vista or later in a direct no-bullsh*t manner as described above. It's more than just Vista+, it's also that some sound cards don't have that option at all.
I was just wondering if there is a way to run a windows-friendly program (VB?) that takes your audio output stream and converts it (in realtime, obviously) to a WAV file with the default sampling rate as other WAV files have.
Ideally, it would cool if it worked on any operating system, so is it possible to write a web service that "listens" to your audio card like that without making the computer think it's getting a virus attack or something?
Possibly related question:
How to save web audio streaming to file ( c++ / java )
I'm only aware of one manufacturer of sound cards that enabled that option (Creative). However Vista and beyond support a "loopback" mode which gives you effectively the same functionality. You need to use the low level WASAPI rendering stack but it should work just fine.
https://github.com/rdp/virtual-audio-output-sniffer provides a directshow input device to capture the sum of wave out for vista+
You could use low level waveOut API injection and capture what it receives.
I have SkypeMXrecorder, a software that does just that - inject into any exe and 'sniffs' what's going out from it and into the sound hardware. But, it seems rather complicated to implement...

How to capture PCM data from Wave Out

How would it be possible to capture the audio programmatically? I am implementing an application that streams in real time the desktop on the network. The video part is finished. I need to implement the audio part. I need a way to get PCM data from the sound card to feed to my encoder (implemented using Windows Media Format).
I think the answer is related to the openMixer(), waveInOpen() functions in Win32 API, but I am not sure exactly what should I do.
How to open the necessary channel and how to read PCM data from it?
Thanks in advance.
The new Windows Vista Core Audio APIs have support for this explicitly (called Loopback Recording), so if you can live with a Vista only application this is the way to go.
See the Loopback Recording article on MSDN for instructions on how to do this.
I don't think there is a direct way to do this using the OS - it's a feature that may (or may not) be present on the sound card. Some sound cards have a loopback interface - Creative calls it "What U Hear". You simply select this as the input rather than the microphone, and record from it using the normal waveInOpen() that you already know about.
If the sound card doesn't have this feature then I think you're out of luck other than by doing something crazy like making your own driver. Or you could convince your users to run a cable from the speaker output to the line input :)

Simple audio input API on a Mac?

I'd like to pull a stream of PCM samples from a Mac's line-in or built-in mic and do a little live analysis (the exact nature doesn't pertain to this question, but it could be an FFT every so often, or some basic statistics on the sample levels, or what have you).
What's a good fit for this? Writing an AudioUnit that just passes the sound through and incidentally hands it off somewhere for analysis? Writing a JACK-aware app and figuring out how to get it to play with the JACK server? Ecasound?
This is a cheesy proof-of-concept hobby project, so simplicity of API is the driving factor (followed by reasonable choice of programming language).
The principal framework for audio development in Mac OS X is Core Audio; it's the basis for all audio I/O. There are layers on top of it like Audio Toolbox, Audio Queue Services, QuickTime, and QTKit that you can use if you want a simplified API for common tasks.
To just pull a stream of samples, you'd probably want to use Audio Queue Services; the AudioQueueNewInput function will set up recording of PCM data and pass it to a callback you supply.
On your Mac there's a set of Core Audio examples in /Developer/Examples/CoreAudio/SimpleSDK that includes a use (AQRecord in AudioQueueTools) of the Audio Queue Services recording APIs.
I think portaudio is what you need.
Reading from the mike from a console app is a 10 line C file (see patests in the portaudio distrib).
Apple provides sample code for reading and writing audio data. Additionally there is a lot of good information in the Audio section of the Apple Developer site.

Resources