h.264 live stream

时光毁灭记忆、已成空白 提交于 2020-05-28 08:01:36

问题


After reasearching for a few days, i m still lost with this issue:

I have a webcam connected over WiFi to my Android device. I wrote an Android app to connect to a specified Socket of the webcam (IP and port). From this Socket i get an InputStream which is already encoded in H.264. Then i redirect this InputStream from the android device to my server, where i managed to decode it to images/frame by using Xuggler.

I would like to stream my webcam live to the internet to a flash player or something. I know i have to use Wowza, FMS or RED5 for this.

My problem is, that i dont understand how to proceed with the InputStream i have. All examples i ve read need a mp4/flv or other container file to stream from... but i have a continuous live InputStream. Some other examples consider using Flash Encoder. But my InputStream is already encoded in H.264.

This is a general understanding question. Please advise me on how to solve this.

Thank you


回答1:


you have following options -

  1. Encode in flv container. Yes you can transmit live stream using using flv container. You can set the 'duration' field in the header to be arbitrary long. e.g youtube use this trick for live streaming.

  2. you can encode the stream into RTMP. ffmpeg has code for rtmp code which can be used for understand, or i believe there are other opensource rtmp muxers available.

  3. convert the stream into HLS, there are flash based HLS player available.




回答2:


why flash if I may ask, hope you know that HTML5 video tag now directly accepts h264 encoded videos.



来源:https://stackoverflow.com/questions/14339145/h-264-live-stream

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!