Audio Stream from PC/Mac to Android/iPhone - streaming

Firstly, as this is essentially a multi-disciplinary question, please feel free to submit answers which only answer one part of the post - I will upvote answers which satisfy any of the questions below.
Hi, we are putting together an installation in which:
Audio comes in through a microphone to an FM transmitter
Transmitted to receiver
Receiver is plugged into computer's Line In
Audio is recorded/streamed as an .m3u stream, or recorded, and then uploaded(?)
Stream is accessible by scanning QR code on iPhone/Android.
I have a few questions around the subject that I was wondering if people could help with.
This is kind of a minor first question, if you are able to answer the second question, but is the best way to deal with incoming audio to record it 'before' uploading it, resulting in a delay, or is it to stream it?
I'm not sure of the best way to host the upload, as I suppose that it would be either an .m3u stream or some kind of progressive .mp3 that would need to be uploaded somewhere that supported this. Any advice? Is this kind of thing possible with free webhosting solutions? It would preferably be above 128kbps, too.
Initially, I presumed that the easiest way to have an audio stream linked to a URL that allowed for QR code linking was to build a very simple webpage with a media player on it, so that the end user wouldn't have to download any external application, and it could be done through the Android/iPhone browsers. Is this the case? Is the easiest way of doing this with something like <video> or <audio>, or is the HTML5 support for the mobile browsers not yet good enough? What are the alternatives? Something like jPlayer looks like it would work?
Thank you for your responses, I can give any necessary technical information you may find relevant, but these are quite broad questions. We can run the stream from either OSX 10.7 or Windows 7, as we have both, so recommendations for suitable software for either platform are welcomed.
Thanks again!
EDIT: Information from jPlayer.org -
HTML5 Audio Streams
HTML5 browsers and their support for audio streams. (Note that, jPlayer's Flash fall-back for non-HTML5 browsers works with MP3 streams.)
Audio streams work on:
Firefox (OSX, Win): OGA
Safari (OSX): MP3
Mobile Safari (iOS4 iPad/iPhone/iPod): MP3
Opera (OSX, Win): OGA
Chrome (OSX, Win): MP3, OGA
IE9 (Win): MP3
No mention of iOS5 or Android, but I used my android phone to check out the jplayer 1.2 stream demo they have up on their site, and it works. Seems like this could be the answer, but I need to know a little more about hosting, and perhaps iOS5 compatibility, though I'm sure it must work going forward. Anyone?

I recommend going with a standard SHOUTcast/Icecast setup.
First, you need an encoder. I recommend Edcast if you're doing this under Windows. The encoder is responsible for listening to your sound card, and encoding/compressing the raw PCM data into MP3, or whatever format(s) you need.
Next, you need a server. Again, SHOUTcast or Icecast will work great for you. No, you typically cannot host this on any free web hosting provider. Fortunately, hosting for SHOUTcast streams is cheap, and readily available. You can also host the server yourself, if you have the necessary bandwidth. It doesn't take much CPU/RAM.
Finally, you need a player. Your jPlayer will work just fine. For iOS, I usually just link to the playlist file and let it play. On Android, you can do a Flash player. HTML5 compatibility is there though, and jPlayer would be the way to do it.
Also note that there is no such thing as a ".m3u stream". A .m3u file is nothing but a playlist file, that contains the URL to the streaming audio. That's all.
For the QR code, just link to a web page URL that contains your player. That's all you have to do.
If you have more specific questions as you go, you should post them as separate questions here.

Related

How to play all video formats in a Chrome Packaged App?

I'm writing an Chrome Packaged App that needs to be able to play a lot of local video files. I can use the tag to play files encoded in h.264 and mp3, but not much else. I'll require playback of at least DivX videos and AC3 audio. Is there any way to do this using the HTML5 platform or otherwise using some kind of plugin?
There are alternatives, but in my opinion the final solution is not going to be very good.
1 - You can try to use a plug-in, for example:
VLC Plug-in - sorry, I have not enough reputation to post more than 2 links :(
Divx Web Player - sorry, I have not enough reputation to post more than 2 links :(
But then you need to rely on the user installing the plug-in. For VLC, the plug-in is not compatible with the latest versions of Mac OS X.
2 - Encode to H.264 or VP8 from a server with an ffmpeg or using a cloud video provider.
3 - Encode from the client side using JavaScript! There is a port of the ffmpeg on javascript (http://bgrins.github.io/videoconverter.js/). I didn't try this method with large files.
4 - Encode from the client side using a Native Client component (https://developers.google.com/native-client/dev/). But seems a daunting task to me.
If you are going to go with the first option, assure that your audience is going to install/configure your player and that their OS are supported.
VLC ported to NaCL would be a great first step.
According to a poster on https://forum.videolan.org/viewtopic.php?f=5&t=107178, libVLC has been ported to NaCL, but I am not familiar with VLC internals so I could not say how far this gets you in terms of being able to decode different streams.

Video streaming solutions

I am attempting to stream a video, in a format unity3d can access, like an mjpg. I have gone through several possible solutions, including gstreamer(only does client side as far as I could tell by the examples), yawcam(I couldn't find a way to access the image directly), and silverlight(due to simply not being able to find how the heck webcam streaming was doable) I am currently just looking for any more methods of getting video over from one side to the other. Could I possibly simply read the images into a byte array and send it over a socket? Maybe I missed something in the previous three possible solutions?
If you are looking to stream video from a server than you can use Ogg encoding + WWW.movie to map it to a texture. Assuming you have a Pro license, as I think this is a Pro only feature. If this is a local file, either bundled with the app or in external folder, we use the brilliant AVPro Windows Media or AVPro QuickTime. MJPEG does offers super smooth scrubbing with AVPro but generates enormous files. Definitely not ideal for streaming or even download!
Finally RenderHead also has a Live Camera capture plugin that could meet your needs.

Live Video Chat for iPhone and HTTP Live Streaming

So generally, I want to make an app which has video chat functionality for iPhone. But after many searches, I am still not able to find any successful results. Is there any public or even for that matter, private API available for doing this on iPhone??? If you have an YES answer, please help me.
Basically, what I want is to read the streams of the video on both the devices connected for chatting. Thanks a lot in advance and please help me if you can.
p.s - I have already checked iDoubs but it failed and always shows some unknown problem and for that reason, doesn't allow me to connect to anyone.
ALSO : The suggested method I have found is via HTTP Live Streaming. But, in that too, I have multiple doubts.
1.) I need to find how do I upload my video from iPhone to the HTTP server from where I would be broadcasting?
2.) Can you please post something related to setting up the server? How do I feed the video to the FFMPEG Server?
Mainly, I need to find the upload method. I am right now simply sending hex-code in the form of NSDATA to the server and I am stuck there. The main problem is, It is live. How do I handle that?
It would be best, if you could help me make the iDoubs work properly.
Thank you so much for any kind of support!
have a look on this how to implement video chat in iphone But before starting you must have a IMS server up & running.
here is the live video chat framework what you are looking for. Its easy and simple to implement for face to face video chat. I have already tried this. Its working very fine. Great thing about this framework is multiple platform support.
Tokbox : https://tokbox.com/platform
https://tokbox.com/opentok/tutorials/
Sample Code:
https://github.com/opentok/opentok-ios-sdk-samples/
Edit:
Here is the article explaining opentok using parse.
http://www.iphonegamezone.net/ios-tutorial-create-iphone-video-chat-app-using-parse-and-opentok-tokbox/
HTTP live streaming is primarily an approach for adaptive streaming from server-to-client. For client-to-server rather go for traditional streaming. There exists an open library for streaming, see this question.
Whilst it is possible to facetime to do two-way chat, it is not certain that you will be able to using public iOS APIs. That said, I have implemented one-way live streaming for iPhone and the difficult part was not the core streaming itself, but encoding of the payload. You will be able to do H264 in hardware and AAC / iLBC in software.
How you want to feed this to the FFMPEG depends on your transport, possibly changing from 'file' H264 frames to 'streaming' H264. Check out the H264 frame types if you implement frame dropping; reconfiguring the H264 encoder on-the-fly is not possible to my knowledge, but restarting with fresh parameters typically does not take more than a second or so.
Did you attempt to play back a live resource while capturing? That is a good starting point. If you come across an open API for H264 encoding, please post it here ;-)

RTSP stream on native iphone app/website

Making a native website iPhone app (converting a website to an iphone app) I want to stream this rtsp link: rtsp://67.85.223.199:110/cgi-bin/rtspStream/1 (there is no file extension I don't know why) if you enter that as a url on quick time it works. I can't embed it correctly for the iphone for it to work. I figure if I can stream it to a browser without active x it should be compatible for the iPhone. Tried a bunch of way to do this, hoping someone out there as the answer :)
-Mike
Judging by your URL, you are streaming with an IP camera. That can easily be restreamed to iPhone, Flash players, Android, anything, really. You may need to make sure your camera can stream H264 and AAC if you want audio. Our company is doing something similar with NetroMedia. http://www.netromedia.com/

iPhone: HTTP live streaming without any server side processing

I want to be able to (live) stream the frames/video FROM the iPhone camera to the internet. I've seen in a Thread (streaming video FROM an iPhone) that it's possible using AVCaptureSession's beginConfiguration and commitConfiguration. But I don't know how to start designing this task. There are already a lot of tutorials about how to stream video TO the iPhone, and it is not actually what I am searching for.
Could you guys give me any ideas which could help me further?
That's a tricky one. You should be able to do it, but it won't be easy.
One way that wouldn't be live (not answering your need, but worth mentioning) is to capture from the camera and save it to a video file. see the AV Foundation Guide on how to do that. Once saved you can then use the HTTP Live Streaming segmenter to generate the proper segments. Apple has applications for Mac OSX, but there's an open source version as well that you could adapt for iOS. On top of that, you'd also have to run an http server to serve those segments. Lots of http servers out there you could adapt.
But to do it live, first as you have already found, you need to collect frames from the camera. Once you have those you want to convert them to h.264. For that you want ffmpeg. Basically you shove the images to ffmpeg's AVPicture, making a stream. Then you'd need to manage that stream so that the live streaming segmenter recognized it as a live streaming h.264 device. I'm not sure how to do that, and it sounds like some serious work. Once you've done that, then you need to have an http server, serving that stream.
What might actually be easier would be to use an RTP/RTSP based stream instead. That approach is covered by open source versions of RTP and ffmpeg supports that fully. It's not http live streaming, but it will work well enough.