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.
Related
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.
Is there any available open-source (preferred) or commercial library for on-fly segmenting and streaming of video to iPhone / iPad?
Also, is there any open-source/commercial server (alternative to Wowza) which supports this?
Apple offers mediastreamsegmenter:
https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/UsingHTTPLiveStreaming/UsingHTTPLiveStreaming.html
You might also want to peek at Best Practices for Creating and Deploying HTTP Live Streaming Media for the iPhone and iPad:
https://developer.apple.com/library/content/technotes/tn2224/_index.html
There's also Darwin Streaming Server, but you may not need it.
Your first preoccupation should be to try to peek a good segmenter (video speaking): Apple's one is fine.
Then, if you wan't in-memory segmenting, mount the input source folder to a RAMdisk...
Take a look at following link;
http://developer.apple.com/library/ios/#samplecode/MoviePlayer_iPhone/Introduction/Intro.html
This example will show how to play videos from a network based URL.
For more details about playing videos;
You can check red5(java & opensource).
Check lastest beta, or code in svn (as lot hav changed since last officeial release).
It may or may not be able to do that out-of-the-box, if not you can code your red5 app and/or check others people code built arround red5...
I have a video stream that I used in an iPhone application. I'm now working to port the application to Android so I want to use the same stream.
As Apple requiered, I created a HTTP Live Streaming (media segmenter, m3u8 file, etc.). You can find the stream here: http://envue.insa-lyon.fr/smartphone/aloun_stream/prog_index.m3u8 .
I want to use this same stream on Android. Did someone have the same a resembling experience?
Honeycomb/Android 3.0 has limited support for HLS. Anything before that does not have built in support, but there are supposed to be third party SDKs that will do it, but searching shows a lot of people that can't ge a hold of the third party dev.
Check the Android dev docs to find out what is not supported.
I've given up on the m3u8 stream. I just used mp4-s with android-streaming capabilities.
you have to use webscoket to continuously get TS files as Apple defines, and send to a player to decode the H.264+AAC within TS packet
Check android 4.0 - it claims to support HTTP Live Streaming 3.0 fully, including HTTPS. For older versions I've seen some people reommening it,but haven't tried myself
I am building this iphone app for a client and they have a large set of flash video files that they need to play/stream to the iphone. I understand that the iphone doesnt natively support flv playback but isnt there anything I can do to get around this problem?
In case it helps, they are using the akamai flash player on their website to play these video files.
Thanks in advance.
Yes! - You can convert all the videos to m4v format.
There's a javascript hack available, but it will only work if it's installed on the clients web server. It's also pretty clunky and slow and will likely murder battery life.
A workaround, since you're working with video, is to convert to mp4 format.
Short answer: no flash, but conversion will do what you need.
akamai actually supports "auto-packaging" of h.264 content which may be your best option here. By uploading 1 or more h.264 files you can use those to both serve your Flash player, and akamai will also auto-package them for iPhone (chunking them into .ts files and creating an .m3u8 reference file for dynamic mobile streaming).
This allows you to not have separate encodes for mobile and web, thus saving money and time so you can leverage your existing archive.
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!