使用H.264(带有音频)的FFmpeg流媒体-Red5媒体服务器(Ubuntu OS) [英] FFmpeg streaming using H.264 (with audio) - Red5 media server (Ubuntu OS)

查看:127
本文介绍了使用H.264(带有音频)的FFmpeg流媒体-Red5媒体服务器(Ubuntu OS)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用RTMP将带有FFmpeg的网络摄像头流式传输到Red5服务器.我已成功使用FLV格式并通过以下代码行完成了此操作:

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

我是FFmpeg和实时流媒体的新手,并且我尝试使用H.264/MPEG-4进行流媒体传输.但是我对FFmpeg选项的了解有限(我确实在这里找到了它: http://man.cx /ffmpeg%281%29 ).

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).

所以,我的问题是:

  1. 如何使用H.264/MPEG-4流式传输到Red5服务器?

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

还有哪些流音频选项?

最后一个问题是:

在Mozilla Firefox(在Ubuntu上)中使用JWPlayer播放内容时,我有大约5秒钟的延迟.您能帮我解决这个问题吗?有什么建议为什么会这样?

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?

非常感谢

推荐答案

无需使用ffmpeg来流式传输H.264/MPEG-4文件,因为red5内置了对此的支持.使用ffmpeg只会给您的CPU使用量带来不必要的负担. Red5将自动识别文件类型,您只需在JWPlayer中指定mp4文件即可.

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.

关于延迟,据我所知,JWPlayer默认具有3秒的缓冲区.您可以尝试降低此值(属性缓冲区长度或类似的值).也许JWPlayer也具有实时"属性,可以以最小的延迟进行流传输,但是我不确定.删除ffmpeg可能也会加快该过程.

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.

这篇关于使用H.264(带有音频)的FFmpeg流媒体-Red5媒体服务器(Ubuntu OS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆