Frequently requested FFMPEG command examples for Wowza

Example commands and information for using FFmpeg as a live video/audio encoder with Wowza Media Server.

Updated for FFmpeg Build git-a85b4a5 64-bit Static (2012-07-30)

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 FFmpeg support through their forums or wiki.

The information collected here is a brief overview of common FFmpeg solutions. It is intended for an intermediate-level streaming technician who has previous experience with FFmpeg. Feel free to post solutions and hints, but please refer to the FFmpeg documentation for configuration information.

On Linux you will have to compile from source to add support for certain codecs. The Ubuntu instructions linked here include the AAC codec libfaac instead of libvo_aacenc. In the following examples replace "libvo_aacenc" with "libfaac".

Usage

A basic ffmpeg command is of the following form:

ffmpeg [INPUT OPTIONS] -i [INPUT] [OUTPUT OPTIONS] [OUTPUT]

Parameters placed before the input apply to the input. For example, if the source is a file, prefix with the "-re" option to limit reading the input (and hence writing the output) to the encoded bitrate.

ffmpeg -re -i [INPUT] [OUTPUT OPTIONS] [OUTPUT]

FFmpeg supports some protocols that can be push-published directly to a Wowza application and are available for viewing automatically: RTMP, RTSP. The OUTPUT URL looks like this:

[protocol]://[wowza-ip-address]/[application]/[streamName]

Other protocols such as MPEG-TS, or RTP with SDP, must be "started" manually using the StreamManager, automatically using StartupStreams.xml, or programmatically with the StreamClass API. OUTPUT URL format:

[protocol]://[wowza-ip-address]:[dstport]

Inputs

1. Some VOD file path examples:

"%WMSAPP_HOME%/content/sample.mp4"

/usr/local/WowzaMediaServer/content/bigbuckbunny_1500.mp4

myRecording.mp3

streamcapture.ts

myStream.flv

2. RTSP/RTP camera:

rtsp://192.168.1.22/mycamera

3. MPEG-TS stream:

udp://localhost:1234

4. Native RTP stream SDP file:

unicast.sdp

5. RTMP source:

rtmp://[Streaming-Server-IP]:1935/vod/mp4:sample.mp4

6. Hardware device:

-f dshow -i video="Integrated Webcam"

7. Linux X11 Desktop:

-f x11grab -s wxga -r 25 -i :0.0 -sameq

Outputs

Note: Refer to the corresponding tutorial for your chosen live output stream type.