ffmpeg rtmp流媒体问题
我正在尝试使用 ffmpeg 将网络摄像头视频流式传输到 Linux 上的 wowza 媒体服务器。
ffmpeg -re -f video4linux2 -i /dev/video0 -acodec libfacc -vcodec libx264 -f h264 rtmp://localhost:1935/live/test
这是我使用的命令,由于某种原因它似乎不起作用,因为我无法运行 wowza 附带的示例。我尝试使用 Flash Media Live Encoder 将 rtmp 发送到我的 wowza 服务器,它可以工作。
有关如何解决此问题的任何指示。
我使用以下配置从他们的 git 存储库构建 ffmpeg
--enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab
ffmpeg -protocols 说它有 rtmp 输入/输出支持
I am trying to stream my webcam video using the ffmpeg to wowza media server on linux..
ffmpeg -re -f video4linux2 -i /dev/video0 -acodec libfacc -vcodec libx264 -f h264 rtmp://localhost:1935/live/test
This is the command I used for some reason it doesn't seem to work as I am not able to run the example that came with wowza. I tried using flash media live encoder to send a rtmp to my wowza server and it works.
Any pointers on how to solve this problem.
I build ffmpeg from their git repo with the following config
--enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab
ffmpeg -protocols says it has rtmp input/output support
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用这些构建选项,我的 FFMPEG 构建确实可以接收和解码 rtsp 流
--enable-network --enable-protocol=tcp --enable-demuxer=rtsp --enable-decoder=h264
我在这里回答了类似的问题 FFMPEG API:如何使用 av_open_input_file 连接到 RTSP 流?
With these build options my FFMPEG build does receive and decode rtsp streams
--enable-network --enable-protocol=tcp --enable-demuxer=rtsp --enable-decoder=h264
I have answered a similar question here FFMPEG API: How to connect to RTSP stream using av_open_input_file?
对于容器格式,第二个 -f 开关应该是 mp4 而不是 h264。 H264 是编解码器而不是容器格式
Your second -f switch, for the container format, should be mp4 not h264. H264 is a codec not a container format
为了流式传输到 rtmp,应该选择“flv”输出格式,如下所示:
In order to stream to rtmp, one should select 'flv' output format like this: