Results 1 to 3 of 3

Thread: Frequently requested FFMPEG command examples for Wowza

  1. #1

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

    Table of Contents

    Required Wowza Application Tutorials

    Note: In order stream to Wowza using FFmpeg you must create a Wowza live application corresponding to your chosen FFmpeg output protocol. RTMP is recommended.

    1. RTMP
    2. RTSP
    3. RTP with SDP
    4. MPEG-TS

    Installation Instructions

    Windows Installation:
    1. Download the latest static build from
    2. Unzip and copy the contents of the included folder to C:\Program Files (x86)\ffmpeg\
    3. Add "C:\Program Files (x86)\ffmpeg\bin" to your System "PATH" environment variable:
    a. Go to: Start Button -> All Programs -> Accessories. Right-click on "Command Prompt". Left-click "Run as Administrator".
    b. In the CMD window enter: setx /M PATH C:\Program Files (x86)\ffmpeg\bin\;"%PATH%"
    c. Close this CMD window.

    Linux Installation:
    Official Ubuntu Linux guide for compiling from source.
    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".


    A basic ffmpeg command is of the following form:

    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:

    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:


    1. Some VOD file path examples:

    2. RTSP/RTP camera:

    3. MPEG-TS stream:

    4. Native RTP stream SDP file:

    5. RTMP source:

    6. Hardware device:
    -f dshow -i video="Integrated Webcam"

    7. Linux X11 Desktop:
    -f x11grab -s wxga -r 25 -i :0.0 -sameq


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

    1. RTMP:
    -f flv rtmp://

    2. RTSP:
    -f rtsp -muxdelay 0.1 rtsp://

    3. RTSP (with publish password):
    -f rtsp -muxdelay 0.1 rtsp://username:secretword@

    4. RTP with SDP:
    -f rtp rtp:// > "%WMSAPP_HOME%/content/10000.sdp"
    -This will write an .sdp file to the Wowza content directory which can be started in Stream Manager.

    5. MPEG-TS (requires .stream file and Stream Manager):
    -vbsf h264_mp4toannexb -f mpegts udp://


    1. Output RTMP without transcoding:
    ffmpeg -re -i "%WMSAPP_HOME%/content/sample.mp4" -c:v copy -c:a copy -f flv rtmp://
    2. RTSP low bandwidth baseline stream:
    -H.264/AAC, Baseline profile, level 1.2, 12FPS, keyframe at least every 96 frames (8 seconds), 110kbps video, 212x120 resolution, 40kbps audio, 22.05khz, mono

    ffmpeg -re -i sample.mp4 -c:v libx264 -profile:v baseline -level:v 1.2 -r 12 -g 96 -vb 110000 -s 212x120 -c:a libvo_aacenc -ab 40000 -ar 22050 -ac 1 -f rtsp -muxdelay 0.1 rtsp://
    3. RTSP with publish password:
    -H.264/AAC, Baseline profile, level 3.0, 24FPS, 2sec keyframe exactly, 350kbps stream, 44.1khz, stereo

    ffmpeg -re -i sample.mp4 -c:v libx264 -profile:v baseline -level 3.0 -r 24 -g 48 -keyint_min 48 -sc_threshold 0 -vb 310k -c:a libvo_aacenc -ab 40k -ar 44100 -ac 2 -f rtsp -muxdelay 0.1 rtsp://username:secretword@
    4. MPEG-TS:
    -H.264/AAC, Main profile, level 3.1, 24FPS, 4sec max keyframe interval, 404kbps constant bitrate video, 96kbps audio, 48khz, stereo

    ffmpeg -re -i sample.mp4 -c:v libx264 -profile:v main -level 3.1 -r 24 -g 96 -maxrate 404000 -minrate 404000 -bufsize 125k -c:a libvo_aacenc -ab 96000 -ar 48000 -ac 2 -vbsf h264_mp4toannexb -f mpegts udp://
    5. RTP with SDP:
    -Capture local hardware devices, generate SDP file in current directory. Set 15FPS source framerate, 12bit color.

    ffmpeg -y -f dshow -s 640x480 -r:v 15 -i video="Integrated Webcam":audio="Microphone (Realtek High Defini" -c:v libx264 -pix_fmt yuv420p -vb 450 -an -map 0:0 -f rtp rtp:// -flags +global_header -c:a libvo_aacenc -vn -map 0:1 -f rtp rtp:// > 10000.sdp

    Miscellaneous FFMPEG Hints

    1. Show VOD or Live stream encoding parameters for troubleshooting:
    ffprobe -show_streams [media]

    2. List available hardware device names such as webcams and microphones, for use as FFmpeg inputs:
    ffmpeg -list_devices true -f dshow -i dummy

    3. When testing short videos you may want loop your command to generate a constant test stream:
    Windows: FOR /L %% IN (0) DO YourCommand

    4. Convert .ts file (or any FFmpeg compatible input) to .mp4 container for use with Wowza VOD playback:
    ffmpeg -i input.ts -c:v copy -c:a copy output.mp4

    5. Check VOD files for keyframe alignment (Linux):
    ffprobe -output_format csv -show_frames [media] |grep I
    -For each file in your multibitrate rendition ensure the PTS and/or DTS timestamps are identical for each corresponding I-frame.

    6. Generate keyframe aligned multi-bitrate VOD rendition (Linux):

    Use this media source for testing.
    ffmpeg -y -i bigbuckbunny_1500.mp4 -c:a libfaac -ac 2 -ab 64k -c:v libx264 -preset:v veryfast -threads 0 -r 24 -g 48 -keyint_min 48 -sc_threshold 0 -x264opts no-mbtree:bframes=1 -pass 1 -b:v 286k -s 384x216 bigbuck-350k.mp4
    ffmpeg -y -i bigbuckbunny_1500.mp4 -c:a libfaac -ac 2 -ab 64k -c:v libx264 -preset:v fast -threads 0 -r 24 -g 48 -keyint_min 48 -sc_threshold 0 -x264opts no-mbtree:bframes=1 -pass 2 -b:v 286k -s 384x216 bigbuck-350k.mp4
    ffmpeg -y -i bigbuckbunny_1500.mp4 -c:a libfaac -ac 2 -ab 64k -c:v libx264 -preset:v fast -threads 0 -r 24 -g 48 -keyint_min 48 -sc_threshold 0 -x264opts no-mbtree:bframes=1 -pass 2 -b:v 836k -s 640x360 bigbuck-900k.mp4

    Version .08
    Last edited by randall; 10-08-2012 at 05:34 AM.

  2. #2
    Join Date
    Jun 2011

    Default Publish Video Stream using ffmpeg Converter


    I am making app using flash and wowza server in which need to publish stream using camera (as3 )from client side and need to connect with ffmpeg so
    can convert the multi streams at a time .
    My question is how to set the path rtmp to ffmpeg during publish time so can convert the streams during publish time on server .My ffmpeg on wamp sever under bin.


  3. #3
    Join Date
    Dec 2007


    connect with ffmpeg so can convert the multi streams at a time
    How does FFmpeg fit in? What is the goal?

    Can you diagram that?

    Webcam > Wowza > FFmpeg > client ?

    Webcam > FFmpeg > Wowza > client ?


Similar Threads

  1. Replies: 1
    Last Post: 07-09-2014, 02:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts