I looking for read raw h264 streaming video into a web browser.
It is a live flow (so there is no way to convert file), from a raspberry's camera.
I successfully read this flow with vlc with a manipulation (forcing the codec input : https://www.unifore.net/ip-video-surveillance/how-to-play-264-video-files-from-ip-cameras-dvrs.html ).
But h264 raw without a container (like mp4) seems prohibited by browsers.
There no many ressources about this point. And some questions on Stackoverflow.com like this post are asked without answer.
Maybe I do not use the good way, so all suggestions are welcome. :)
Thanks !
Related
I have seen the xbuf from gwan. Not sure when it is not a good use for it. Can it be used for integers or float? When is it not recommended to be used? I am very much inclined to use it as often as possible.
As an application server, G-WAN is expected to generate dynamic contents.
In this case, the server is building a reply served to clients.
Part of these dynamic contents are binary (like pictures) and this is why G-WAN offers a native ultra-fast in-memory GIF, charts, and frame-buffer API. More complex images can be generated with general-purpose libraries like Cairo (used by Internet browsers).
But most dynamic contents are text (like HTML pages, JSON payloads, etc.).
And this is the purpose of the G-WAN xbuffer API which works as an extended snprintf() - supporting strings, integers, floats, base64, hexdump, binary formating (3 => "11") and more.
The loan.c example illustrates very well how relevant, fast and versatile xbuffers are.
when should you not use it?
When sending an empyt reply (HTTP status code 204), or (less likely but still possible) when appending data directly in a previously resized reply buffer. G-WAN examples show how to do that, look at the fractal.c file.
I´m working on an application based on directshow that has to convert an AVI source file to to an mp4-file that can be played back with Quicktime.
Since 3ivx, according to my web research the most popular way to fulfill this task, has become commercial (and my budget is quite limited), I decided to use a solution based on ffdshow.
I created a simple graph in graphedit, using LAME for audio encoding and GDCL MPEG 4 Multiplexor for the muxing, but everytime I try to play the movie with Quicktime, I´m getting an error indicating a wrong "sample description".
Playback with Windows Media Player is working, except that there is no sound.
My guess is that there´s a problem with the muxer, because every time I try to add audio encoding, graphedit automatically adds an decoder after the encoding unit (see picture link).
http://imageshack.us/photo/my-images/39/graphjrgr.png/
Any ideas on how to integrate ffdshow in a better way, tips for alternative mp4 muxers, or a complete different approach are appreciated!
The GDCL muxer has limited number of audio formats that it supports, probably you should check the source code for the muxer to see if the formats you are using are in fact supported. Basically, you need to choose an audio encoder that the mux recognizes as valid. It might be possible to use GraphEdit to choose different properties for the encoder filter that allow things to work better.
I have had some luck with the Monogram x264(video) and AAC(audio) encoders. See http://blog.monogram.sk/janos/directshow-filters/
Finally, try the debug version of the GDCL mp4 muxer.
Also, you must be aware of MPEG-4 LA licensing requirements for x264 http://www.mpegla.com/main/programs/AVC/Pages/FAQ.aspx
Having had a quick look at the Flex docs I can't seem to find any reference to providing audio content to be played from a custom (possibly encrypted - don't worry, it's not that evil) container format. Is this possible and if so, could someone point me in the right direction.
Or if that's not possible, some way to hook into the disk/network (disk is much more important in this case) I/O of the sound playing mechanism to provide a supported container in memory from a custom wrapper.
Since Flash Player 10, it's posible to write PCM / raw audio data to a Sound Object.
Basically, you call play on an "empty" Sound Object and it will start dispatching periodically a SampleDataEvent, requesting data. You then can write to the audio stream through the data ByteArray exposed by the event object.
http://help.adobe.com/en_US/FlashPlatform//reference/actionscript/3/flash/events/SampleDataEvent.html?filter_flex=4
http://www.adobe.com/devnet/flash/articles/dynamic_sound_generation/index.html
Also, if you're interested in good articles and reference for audio programming in Actionscript, you might want to check out Andre Michelle's stuf:
http://blog.andre-michelle.com/
http://lab.andre-michelle.com/
A flash.media.Sound must either be:
constructed/loaded with a URLRequest,
inherit its data through embedding
There currently is no provision for directly piping mp3 (or aac, or video) data to a any "media" object, such as Sound. You can only get the Sound object to download the data for itself. There are people who are upset about this, including myself; you are not alone!
I say "at this stage" because it's not unthinkable that Adobe will update the API to make this possible in a future version. For the now, you're best to go with the decoding-to-a-dynamic-sound workaround mentioned by Juan, if you really need to be able to do this.
And post a feature request at Adobe's bug tracker, or vote on an existing one!
I've been stucked with this requirement for a long time.And how can I do that?Any suggestions would be appreciated!
I think that there are several options
a)Do the processing on the Flash Player (skip frames) - I think it is inefficient and I do not think that you will have a good user experience - but you can give it a try
b)Write a plugin for your streaming server (in FMS you can do it in C++) which is doing the same thing - skipping frames in order to obtain the desired effect.
c)Encode your video files in several formats: 1x, 2x, 4x etc and switch the stream from the flash player accordingly. I think this is the easiest solution.
I have a legacy file format that contains sounds embedded in it (in various encodings). I would like to be able to play these sounds in Flash (Air?) by reading the sound bytes out of the file and instantiating a Sound object with them.
If the sound is unencoded (e.g., raw pcm), I've found that I can use the new flex 4 SampleDataEvent.SAMPLE_DATA event to play the sound.
However, if the sound is encoded (e.g., mp3), then I'm at a loss. The sound expected by SampleDataEvent.SAMPLE_DATA has to be raw pcm. From what I've seen, encoded Sounds can only be instantiated by [Embed]ing them, or by using a URLRequest with Sound.load().
Surely there's a third way? AMF or e4x?
There are really only two routes for you to go. The first is to write a decoder in ActionScript. You may be able to use Alchemy to port over some C/C++ code to make this job significantly easier (and possibly more performant). This is exactly how I got Ogg Vorbis playback to work with Flash.
The other option is to dynamically create a valid SWF inside of a ByteArray. That SWF could contain an embedded sound object that was made up of your sound data. A number of folks have pulled off similar hacks in the past before Flash Player 10 was available. I believe you can find a good place to start in Andre Michelle's and Joa Ebert's PopForge codebase.