Live Audio Streaming to a browser methods, must be very simple - html

I'm recording a mono audio stream using a PIC at 8-bit 8Khz and streaming it raw to another microprocessor that houses a web server. I'm currently buffering the data and turning it into a wav file that gets played in the browser. What I'd like to be able to do is continuously stream the audio as it's being recorded without putting a lot of encoding overhead on the second processor. I've been searching but most searches turn up just streaming from a stored file, but since the file size isn't known ahead of time I'm not sure how to do this without the overhead of mp3 encoding.

You may find that simply creating a WAV file (or other raw format) that keeps growing will, in most players/browser plugins, cause the file to act as a live stream. This is, I believe, basically how like Ogg streaming and similar works. Because the player begins playing before it is done downloading anyway, it keeps playing and downloading until the end of the file, but the file has no end so it just keeps going.

Vlc media player can stream flv and many other formats.

Related

Real time joining base64 .webm video chunks and play without delay or flicker isues

I'm trying to make a live streaming system without P2P connection by nodejs.
Video chunks are recorded each 3 seconds and sent to server via webrtc and they save simply as .wemb base64 files.
But when the client is trying to see the whole video, there is flickering problem.
Each time a 3 secs video ends the src attribute of video tag changes to next chunk.
I tried to save some upcoming ones to a buffer in order to prevent delays, but still it is considerable.
I used MediaSource API to add source buffer but id didn't work on that specific webm encoding either.
The codes are huge and complicated and doesn't help much, but if they are necessary in order to correct the concept I can put then too.
Thanks.

Is it necessary to convert database of mp3's to ogg and wave to use html audio?

I have thousands of mp3 files in a database and a website that lets people listen to them. I'm using a flash player but want to move to html5 audio player. Does this mean that I need to make ogg and wave versions of all my audio files? What is a good approach to making these files more accessible?
In short, yes you need to support multiple formats. (Assuming you care about decent browser support.)
If you are lacking disk space, don't get a lot of traffic, and don't mind some delay before the data gets to the user, you can convert these on the fly. Just write some code so that on request, it checks the conversion cache to see if you have already converted the file. If not, convert it on the fly (with something like FFMPEG) and write the data to disk at the same time you are writing it to the client.
As Imre pointed out, browser support is changing all the time. Look up what codecs are supported from time to time.

Is it possible to convert an avi file to mp4 in real time?

I have an AVI file that I would like to be played inside Flowplayer. I understand it uses HTML5 which requires movie files to be converted to MP4/OGV, so I was wondering if there was a framework that exists which will convert an AVI file to an MP4 file in real-time (and without necessarily being stored on the server)
...the more I think about this, the more I'm beginning to think this isn't possible. Please prove me wrong.
The video can be transcoded in (sort of) realtime by hardware or even software, but I'ts never a practical aproach since you are spending lot of processing power for each client for each video. This is madness. It's adviceable to cache pages... so videos are needed to be cached.
A simple way is to upload/place the video in a folder in the server, then trigger a transcoding (using FFMPEG) to a file which is the file to be served.

flash: play a movie from half way in

Is it possible to play an MP4/H.264 movie in flash from half way thru?
Currently cant figure out how to seek to a time that hasn't buffered yet. Is there anyway of getting flash to start buffering half way into a movie?
edit:
The moov atom has already been set at the beginning of the MP4 file.
use pseudo-streaming
Normally you need a to use an streaming server which cost $$$ but you can use Pseudo-streaming.
Pseudo-streaming uses server-side scripts/modules where you have the server slice up the movie starting at the point you want to start from and wrap it as an mp4.
Stream your videos with standard HTTP servers
Pseudo-streaming (another article)
Oh yeah, I forgot about red5 as mentioned below in the comments. That is a free media server option for real streaming.
red5.org

html 5 audio streaming faking files. Progressive Download, PCM WAV

As far as i know there is no audio streaming available in html5. Even with the audio tag.
That is, you always have to provide a file instead of passing an audio stream of some sort.
So, we know that most commonly used formats are ogg and mp3(not free). Also wav can be used but due to its size not commonly used.
My question is can I fake a file as if it was a stream, say create the wav file (with the riff header) and specify the PCM format details(freq,channel,blah blah) and pass that as the first few bytes and then send the PCM stream over the wire(actualy audio chunks).
The first issue I see if that RIFF header in the wav files require the chunk sizes which is the length of the file. WELL WE DONT HAVE A LENGTH SINCE IT IS AN AUDIO STREAM.
Any ideas.
Yes, absolutely.
The client doesn't need to know or care that the media it is playing is created live, or being loaded from disk.
You may have challenges depending on the codec used. WAV present the problems you have mentioned with the header, but it should be possible. With MP3, you can generally just send data at any point, and the decoder will sync to the frames on its own.