FFmpeg streaming using H.264 (with audio) - Red5 media server (Ubuntu OS)

依然范特西╮ 提交于 2019-12-09 20:05:38

问题


I'm trying to stream my webcam with FFmpeg to my Red5 server using RTMP. I've done this successfully using FLV format with the following line:

ffmpeg -f video4linux2 -i /dev/video0 -f flv rtmp://localhost/live/livestream

I'm new to FFmpeg and live streaming, and I've tried to stream using H.264/MPEG-4. But my knowledge is a bit limited with the FFmpeg options (which I did find here: http://man.cx/ffmpeg%281%29).

So, my questions would be:

  1. How can I use H.264/MPEG-4 to stream to my Red5 server?

  2. What are the options to stream audio as well?

  3. And one final issue is:

I'm having a delay of about 5 seconds when I play the content with JWPlayer in Mozilla Firefox (on Ubuntu). Can you please help me out to solve this problem? Any suggestions why this might be?

Many thanks


回答1:


There is no need to use ffmpeg for streaming H.264/MPEG-4 files because red5 has build in support for this. Using ffmpeg will only put an unnecessary load on your CPU usage. Red5 will recognize the file type automatically, you only have to specify the mp4 file in your JWPlayer.

About the delay, as far as I know JWPlayer has a buffer of 3 seconds by default. You can try to lower this (property bufferlength or something like that). And maybe JWPlayer has a "live" property as well to stream with minimal delay, but I am not sure about that. Removing ffmpeg will probably speed up the process also.



来源:https://stackoverflow.com/questions/14719721/ffmpeg-streaming-using-h-264-with-audio-red5-media-server-ubuntu-os

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