Open source RTMP streaming - streaming

I am trying to do the following:
PC 1 - Small computer in an office
A webcam output is captured by ffmpeg and ffmpeg outputs an RTMP stream.
PC 2 - Fast computer, > 1 GBPS bandwidth
The PC grabs the stream and makes it available to the world
Website
Using JWPlayer, each visitor's client is pulling the stream from PC 2.
I looked at a few commercial solutions (wowza, etc) but I am thinking there may be an open source way to do this as well. I stumbled across OBS studio, but I don't know yet if it is capable to do it.
btw, the high bandwidth server has to be Windows.

Related

Hololens 2 audio stream from Desktop

I'm currently developing an app for the HoloLens 2 that needs to stream audio from a desktop PC.
The idea is to send control information (position, orientation, etc.) to a Cycling'74 Max/Msp application running on a Windows 10 computer to process audio for 3D audio playback. I now need to somehow stream the resulting sound to the Unity app running on the HoloLens. Both devices run on the same network.
At the moment I've achieved something using mrtk webrtc for unity in combination with a virtual cable as input. My issue is that this seems to be optimized for microphone use as it applies some options like noise reduction and smaller bandwidth. I can't find a way to set the options for webrtc to stream what I need (music) with better quality.
Does anyone know how to change that on mrtk webrtc or has a better solution for the audio streaming to the hololens?
WebRTC project for Mixed Reality is deprecated and it is designed for real-time communication. If your requirement is media consumption, you need other workaround solutions.
For dedicated media streaming, you can set up a DLNA server on your PC for media access.
You may also set up Samba or NFS on your PC if you need to access files in other formats.

Need troubleshooting advice for H.264 stream (works in PC VLC, but not on CumulusTV App)

I have an HDMI source connected to a Chinese HD HDMI Encoder box. Playback to VLC on my PC works (open network stream http://192.168.0.150:80/hdmi)
Stream is NOT leaving my local network (on purpose)
I cannot get a signal to display on my Google Nexus Player or my NVidia Shield via Cumulus TV app. (The point being to integrate the feed into the Google Live Channels app) I have tried adjusting several of the settings to no avail. Should I be trying a specific format? I tried the Fiddler (didn't see anything descriptive in that tool) but still have no definitive answers. I am pretty sure this device only produces a H.264 bitstream, which works in the PC version of VLC, but I have no luck on my androidTV devices (to include VLC). I can also get playback on my android PHONE in VLC...
seeking help/ troubleshooting advice...
main stream settings are:
H.264 Level: high profile Encoding frame rate: 30[5-30]
Bitrate control:vbr Key interval: 30[5-200]
Encoded size: auto MinQp: 3[1-51] MaxQp: 32[MinQp-51]
MaxBitrate: 8000[16-12000]
Audio bitrate:192000 Audio channel:L+R
Audio Codec:AAC Resample:Disable Package:B HTTP: Enable /hdmi (begin with "/")
HTTP Port:80[1-65535] Change TS ID:Disable
transport_stream_id: 300[256-3800]pmt_start_pid: 480[256-3800]
stream_start_pid: 481[256-3800]RTSP: Disable Multicast IP: Disable
RTMP server ip: Disable ONVIF:Disable Enable
It looks like your encoder can stream three different formats:
Http - probably HLS
RTMP
RTP/RTSP
Now the question is which formats do your clients support and is the format on the above list.
You could install Fiddler on your PC (web app debugger) to verify that your streaming box actually serves HLS.
Since you know that VLC plays your stream you could try to install VLC on your Google Nexus player: https://play.google.com/store/apps/details?id=org.videolan.vlc

Over the web and over the lan streaming with WAMP

I want to set up a little website from which i can stream video/audio to my android phone. I'm wondering will the WAMP server stream through LAN when both the phone and the pc are on the same network or will it still go through the web. I have low upload speed it's high enough to stream videos but i prefer the server to stream through lan when we're on the same network and over the web when we're not. So will the server do this by himself or should i look in another variant.
Yes it will stream through the LAN.
There are no special things you need. The only thing is that the media won't actually stream. Whatever your media is will only play after completely downloading.

Using VLC, is it possible to encode 30 to 40 IP based webcams on same computer?

I am the IT guy for a small chain of preschools. Each school current has about 30-40 Axis IP webcams each, ranging from the old Axis 205,206 models, up to the Axis M1011. These cams allow parents to log into a website to view their kid's classrooms throughout the day. The IP cams are on a local network, streaming on port 80. Each school has one public ip address, on which is a reverse-proxy HTTP server. We directly serve the MJPEG from the Axis webcams by basically doing a URL rewrite to allow the client viewing app direct access to the cam via the Axis HTTP API.
This has worked fine for years, and even worked on iPhone, up until recently. In fact, it still works on iPhone, but only when connected Wifi. When the iPhone is connected via 3G, the MJPEG stream no longer works. The carrier is AT&T.
I have done quite a bit of research the past few days, and know that I have to move towards HTTP Live Streaming for Apple devices, so I'm just trying to get my head around the various parts of the puzzle I have to solve to make it work.
My mix of Axis cams may be a problem. The Axis 205 and 206 are MJPEG only, but the M1011 can serve h.264, but apparently only via RTSP. I'm willing to swap out the older Axis cams for the M1011 if that is required or helpful to the overall solution.
From my understanding so far, the first thing I have to sort out is getting my 30 to 40 Axis M1011 h.264 streams (re)encoded / chunked as MPEG-2 (.m3u8 and .ts files).
Question #1
Is it possible and/or feasible to setup one computer, with a "batch" file of VLC command lines, to start and encode 30 to 40 input streams, coming from Axis webcams, into MPEG-2, ready to serve up to iPhone? I'm wondering about the stability, hardware requirements, etc. to handle that many webcams. This same computer would have a HTTP server (probably IIS) and a public IP address, so no need to get the MPEG-2 files any farther than the local computer.
Question #2
For the older Axis models (205, 206) that only serve MJPEG, is is possible to use VLC to encode those to MPEG-2 as well? Am I correct in assuming that (re)encoding or re-packaging .h264 into MPEG-2 is a lot less "work" than encoding MJPEG into MPEG-2, or is it about the same amount of CPU, etc? I have installed the latest version of Videolan and it was easy enough to connect to the Axis M1011 .h264 stream via it's RTSP URL, so I know that much works.
Question #3
Can anyone share any specific VLC command lines or configuration, for either side of my given configuration: Axis M1011 .h264 and/or Axis MJPEG as inputs, and for the output, MPEG-2 (.m3u8 and .ts files), "chunked" into the size as required by Apple iPhone, especially when connected 3G.
Question #4
Finally, if anyone has another suggested approach (different encoder, Media Server that would work better, etc. ) I would like to hear those suggestions as well.
If you have enough network capability to recieve the input stream and enough CPU power and RAM to encode it is possible. There is no inherent limitation otherwise on using a single machine for multiple instances of vlc or ffmpeg.
If you have a camera feeding in 512 kbps input for 30 streams you need 30x512 = 15 Mbps network capability which should be quite fine for a modern machine.
The difficult part is getting 30 transcodes for iPhone output. The output is a MPEG2 TS container but internally it has to have mpeg4 or h.264 encoded content. H.264 encoding is expensive but requires lesser outgoing bandwidth for same quality at MPEG4 [ballpark ~30% less]
Assuming it is ok for you to view a 320x240 which for decent quality with mpeg4 should be decent quality at 256 kbps output.
For h.264 you could go to 192 kbps [baseline for 3GS and below]
Trouble now is do you have the horsepower to do the transcoding. Here is how you check
Take one video file representative of your input. Check the input frame rate. Transcode it to the output you need. Check the fps you are getting from ffmpeg for encoding. Notice the multiple of input rate it is at. Remove 5-10% for handling multiple simultaneous streams. that is the maximum you are getting on your machine.
ffmpeg can take input from a http or rtsp source and create an output which is segmented. See this for understanding how to use ffmpeg to create segments. You still need to write a small program to generate the m3u8 files I guess.
It is non trivial here but you will enjoy it. It can be done.
EDIT: Another thing is you only need transcoding to happen when someone is viewing it. So at a given time if someone is not viewing 10 cameras, you dont have to do those transcodings. So perhaps you should first find out statistically how many cameras are viewed at a given time. Look at your history. Then you need a less powerful machine.
EDIT: If you can handle some programming instead of command lines look at: this
ffmpeg might be a possible alternative for you. It's command line based, cross platform and you'll be able to control quality, formats as well as stream. The encoding/re-encoding quality basically controls the processing speed of your application, taken the throughput neccessary to grab the data out of the loop.

flv stream decoding, 3gp encoding

Are there any open source projects in any language and other recourses that I need to look at in order to implement flv to 3gp conversion? It's better to be streaming, I mean return first portion of 3gp before last portion of flv is downloaded.
Or are there any similar services already implemented - my goal is to have something like
http://converter.org?source=sourceUrl.flv&targetFormat=3gp that I can feed to 3gp player, in my case - on iPhone, and not wait until server downloads entire flv.
UPDATE: ffmpeg does really good job here, just
ffmpeg -i input.flv output.mp4
and that's it. But output file can be used only after conversion is done. Streaming is still an open question. There is ffserver that does some sort of streaming but I could not make it work.
I'm not sure if it is possible, but if there's one thing that should do it.
it's http://www.ffmpeg.org/ ..
it can convert anything to anything on an online platform. don't know if it supports streaming but definitely the best solution for online video conversion
Well this one might be a little late to the party but to stream video online you'll need a Media Streaming Server to deliver the video over a specific streaming protocol (i.e. HTTP,HTTPS,RTSP,RTMP). I've also been looking for such a "real-time" transcoding service but the closest thing I've found so far is the Video CDN's which are quite pricy, and also limited in formats/support. What would be really nice is for one of the media servers to add in a real-time transcoding feature. At the time of this writing no such service exists that I know of.
The top 10 most popular options for Media Streaming Servers are (IMHO):
VideoLAN - VLC Media Player (good for quick tests and proof-of-concept)
Kaltura - Open Source video platform
Real Media - Helix Universal Streaming Server (may be best bet for 3GP over RTSP)
Apple - Darwin Streaming Server / Quicktime (Live) Broadcaster (best for iPhone/iPad)
Red5 - Open Source Flash Streaming Server
Adobe - Flash Streaming Server
Wowza - Media Server
FluMotion - Open Source Multimedia Streaming
Microsoft - Windows Media Server (AVI, WMV, Silverlight & other formats)
FreeCast - An OGG Theoris (video) and OGG (audio) streaming/conversion platform
As you can see there are many options for streaming and you can start as simply as hosting the video on the same server and delivering to Desktop computer browsers via HTTP (the easiest way to get started with this is trial & error). Each offers different features in terms of protocols supported and transcoding, but none are truly real-time as you mention where you could feed in a source video and get an output video in the format of you choosing (i.e. 3GP). My personal choice would be to start with VLC for small-scale tests on a home network, since it is basically a swiss-army knife for desktop video that can also act as a server for any of the formats it can playback (though it may be more complicated to get this to stream to the public internet and even harder to go all the way to a single device on a private carrier network, some info is available from people who've tried):
http://forum.videolan.org/viewtopic.php?f=4&t=45782
Some basic transcoding instructions to go to MP4 (required for iPhone/iPad/iPods):
http://wiki.videolan.org/MPEG-4
I also agree about FFMPEG being by far the best solution for video conversion, as it also supports 3GP and you can at least start playing around with conversion on your own test server, you might want to try the following PHP Classes project:
http://www.phpclasses.org/package/5977-PHP-Manipulate-video-files-using-the-ffmpeg-program.html
In my experience that was an excellent contribution to speed web interaction with FFMPEG's mostly command-line and sometimes clunky interface. Who knows, maybe you'll build the first real-time transcoding service, I'd be the first to signup as a customer and/or as a contributor to help you on that!