Receive WebRTC in VLC/FFMPEG or other application - c++

We would like to receive WebRTC stream.
The stream is sent from a browser and the receiver can be VLC or FFMPEG or some other application.
Is there a way to achieve this goal?
If so, how?
Is there a way to get the raw data?
Thanks,
Ronen

Try this: https://github.com/aiortc/aiortc/tree/main/examples/server
I won't copy/paste code here - aiortc is a python package you can install through pip, and then you can run the example - it worked out of the box for me.
Big thanks to the author of aiortc.

Related

How to stream sound on MAC OS using QT?

I want to develop an application to play sounds from web radio streams.
I first did it using the following code :
mRequest.setUrl(QUrl(QString("http://dummy.com/file.mp3")));
mPlayer.setMedia(mRequest);
mPlayer.play();
It works fine but I want to do it passing a custom QIODevice because I have to process the stream in a specific way before playing it.
I found some example describing how to do that but it seems not to work.
I then found an interesting link here describing an issue with streaming on MAC OS using Qt (QMediaplayer streaming from a custom QIODevice with encryption on Mac OS (10.9)) and what seems to explain the problem (Supported media player features).
So, assuming I want to get a stream from a web radio, process specific received bytes before playing, what QT class do you advice me to use ?
Thanks in advance for your help.

Send or execute internet direction without downloading annything

I have a wireless IP cam that play sounds. I know how to play this sounds because i know the direction and the command. I tried it with this Terminal command: http://192.168.0.90/axis-cgi/playclip.cgi?clip=6
The problem is wget command download the clip and i only want to reproduce it. Beacuse i want to do into a program.
Any option to do it in terminal. Or directly from a C++ program.
Thanks in advance.
mplayer or vlc will stream the URL and play it as if it was a local file. As for doing it in C++, you have much more work to do (find an HTTP library, read the contents, decode it and reproduce it. Maybe the ffmpeg library can help you here.

Reading Zebra printer status via USB on Ubuntu

After a lot of posts in SO and Google, I could not find an answer to my problem. Most of similar questions are Windows/VB/.Net/C#/Java centric.
I need to send an ESC command to a Zebra USB printer (TTP2130) and get the status back using C/C++ . I am able to print fine (with Zebra generic driver set as default printer) using:
$ lpr file.prn
Used Zebra Toolbox to communicate in Windows and generate *.prn files with ESC commands.
But if I sent a file with a command that needs response from printer, nothing happens.
What would be the best approach to accomplish this? Maybe using libusb1.0 directly?
Thanks for any help!
Found a solution after searching for 'Swecoin'. This is the old manufacturer of Zebra's TTP line of printers. Swecoin on Wikipedia.
This guy made a simple and direct app to communicate with TTP printers (ttputil): http://www.rainbow-software.org/linux/
After downloading and compiling, I was able to send commands directly:
sudo ./ttputil enquiry sensor /dev/usblp0
I will modify its code to fit my needs.
Unfortunately, I haven't found a way to contact (and thank) the original developer from his website.
Well I had a similar issue and in the end this post helped me a lot: https://blog.peter.skarpetis.com/archives/2005/04/07/getting-a-handle-on-usbprintsys/ it is Windows centric but the principle is the same also on Linux and Mac.

Creating a livestream website

We already have a functionality of Video uploading in our webapplication[built using python with Django framework]. Now we are in the process of building a livestream site where people are able to use their webcam to record the live event and it's live streamed to different participants at the sametime.
I am wondering if somebody has any idea of how to go about building a functionality like this or any pointers that would be really helpful.
I sort of looked into this same question a while ago. The dominant solution seems to be Adobes Flash Media Server. It is closed source of course and quite pricey. There are companies who run it as a service, lowering the cost of entry. And there are open source contenders, the main one being Red5, which of course also relies on flash being available on the client side.
In the future we'll probably see viable HTML5 alternatives but if you're doing something right now my feeling is that the flash route is the simplest solution and has the largest install base.
I did a video vlc record with python and it was quite simple. VLC have a stream recorder and as I know you could launch a vlc stream with a simple python code who manage the video ans the stream. I think all you need is to manage the sources and then, doing a small script who takes care about the vlc stream.
VLC stream will be launch on a different port, so I think you've to search a good server.
see vlc docs :
https://wiki.videolan.org/Documentation:Streaming_HowTo/Command_Line_Examples/
Enjoy :)
Check VLC or Flumotion...
Probably Photolab as well..
The latter one doesn't support audio...
Gee

Play RTP video stream using Qt?

I want to create a Qt widget that can play incoming RTP streams where the video is encoded as H264 and contains no audio.
My basic plan for implementation is this:
Create a Phonon MediaSource object (Stream type).
Connect it with a QIODevice subclass that provides the data
Obtain the video data using either:
The JRTPLIB client library
The GStreamer gstrtpbin plugin. This plugin takes care depayloading the packages and decoding the video. Maybe this improves the chances that Phonon will recognize the data.
My environment:
Ubuntu 9.10
Qt 4.6
My questions:
Is my approach a good one? Perhaps I'm overlooking a more obvious or simple solution?
I'm currently experiencing this issue: when trying to play the video stream the state of the MediaObject turns to ErrorState with errorType FatalError. Can anyone tell me what I'm doing wrong?
Edit
One solution I found is using libVLC in combination with Qt, which I learned about in this thread. Here's a code sample for the interested.
I'm still looking for a Phonon-based solution.
Ideally I would only need to provide an SDP file and job is done.
I was able to get it to work using the libVLC solution. I can't garantuee that this is the best solution though as I simply stopped looking after that.
Here's a link to the libVLC sample.
The way I understand Phonon works at least in Windows is that QT provides a phonon backend plugin for DirectShow (\plugins\phonon_backend\phonon_ds94.dll) and GStreamer in your case. Then you would either obtain or write your own DirectShow filter which can accept RTP streams as a source. DirectShow takes care of the decoding, and Phonon will take care of the rendering.
So if the backend works, the application code is as simple as:
Phonon::MediaObject *media = new Phonon::MediaObject();
Phonon::VideoWidget *video = new Phonon::VideoWidget();
Phonon::createPath(media, video);
media->setCurrentSource(source);
media->play();
Seems that the problem lies with the GStreamer backend accepting RTP as a source. Can you playback that source in standalone GStreamer without any problems?