宜昌本地软件开发与弱电工程服务商
项目咨询 · 快速响应
您当前的位置: > 博客2 > Wowza教程

[wowza]基于ffmpeg软件推流到wowza应用(ffmpeg与wowza的结合应用

2016-10-13 00:16:48 点击量:29 标签: 收藏本文

一步一步教你使用ffmpeg基于wowza media server做视频音频的直播

Step by step instructions for using FFmpeg as a live video/audio encoder with Wowza Media Server.

Updated for FFMpeg build r25705 (22 November 2010)

Note: Wowza Media Systems provides these instructions on as "AS-IS" basis. FFmpeg is not a Wowza Media Systems product. If you have problems getting FFmpeg to work properly it is best to contact the FFmpeg through their forums or wiki.

To get started, download and install FFmpeg for your platform on the same machine running Wowza Media Server. We will be re-streaming the sample filesample.mp4. The following tutorial is for Windows only. I used the most recent daily build of FFmpeg from this site:

http://ffmpeg.arrozcru.org/autobuilds/ (编译好的windows版FFmpeg下载地址)

FFmpeg Setup (Windows)

In the root the C: drive create the following directory structure:
Code:
C:/usr/local/share/ffmpeg
Copy all the files from the presets folder of the FFmpeg package into this new directory.
Open a command prompt and change directory to the FFmpeg bin folder.
Enter the following FFmpeg command which will re-streaming the file sample.mp4 from the [install-dir]/content folder of the Wowza Media Server 2 installation:
Code:
ffmpeg -i "%WMSAPP_HOME%/content/sample.mp4" -re -vcodec libx264 -vpre default -vpre baseline -g 60 -vb 150000 -strict experimental -acodec aac -ab 96000 -ar 48000 -ac 2 -vbsf h264_mp4toannexb -f mpegts udp://127.0.0.1:10000?pkt_size=1316

上面的代码有误,应该为:

ffmpeg -i "%WMSAPP_HOME%/content/sample.mp4" -re -vcodec libx264 -fpre C:\usr\local\share\ffmpeg\libx264-ipod640.ffpreset -g 60 -vb 150000 -strict experimental -acodec aac -ab 96000 -ar 48000 -ac 2 -vbsf h264_mp4toannexb -f mpegts udp://127.0.0.1:10000?pkt_size=1316

使用ffmpeg实时转码mms直播流有问题,官方文档使用mmst(mms over tcp)或者mmsh(mms over http),使用时均报错。待解决。

解决办法:开启wms的http功能,在根节点上开启。使用播放地址:mmsh://220.189.247.171/yswh,mmst播放有问题。

ABOUT US
宜昌农人网络科技有限公司

我们是一家提供综合软件外包与弱电工程服务的技术公司。

业务涵盖定制软件、管理系统、网站、小程序、APP、系统集成、网络布线、监控安防、门禁、机房建设及长期技术维护。

公司地址:湖北省宜昌市伍家岗区东站二路6号三峡(宜昌)大数据产业园海洋馆二楼A203室