Wowza Community

Streaming mp3 to wowza RTMP server fails while streaming flv works

I am facing an issue when trying to stream an mp3 audio file to the Wowza RTMP server.

In one terminal window, I am using this command:

$ ffmpeg -re -i input_file.mp3 -c copy -f mp3 rtmp://ec2-xx-xxx-xx-xxx.compute-1.amazonaws.com/live/mystream

This is the output:

ffmpeg version git-2013-11-22-ffe31c6 Copyright (c) 2000-2013 the FFmpeg developers
  built on Nov 22 2013 23:20:36 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu8)
  configuration: --prefix=/home/subuntu/ffmpeg/ffmpeg_build --extra-cflags=-I/home/subuntu/ffmpeg/ffmpeg_build/include --extra-ldflags=-L/home/subuntu/ffmpeg/ffmpeg_build/lib --bindir=/home/subuntu/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab
  libavutil      52. 54.100 / 52. 54.100
  libavcodec     55. 44.100 / 55. 44.100
  libavformat    55. 21.101 / 55. 21.101
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 91.100 /  3. 91.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mp3, from 'Downloads/Tor - Aperture.mp3':
  Metadata:
    title           : Aperture
    artist          : Tor
    album           : Drum Therapy
    track           : 5
  Duration: 00:04:03.67, start: 0.000000, bitrate: 128 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s
Output #0, mp3, to 'rtmp://ec2-xx-xxx-xx-xxx.compute-1.amazonaws.com/live/mystream':
  Metadata:
    TIT2            : Aperture
    TPE1            : Tor
    TALB            : Drum Therapy
    TRCK            : 5
    TSSE            : Lavf55.21.101
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help

In another terminal window, I try to play the RTMP stream using ffplay:

$ ffplay -i rtmp://ec2-xx-xxx-xx-xxx.compute-1.amazonaws.com/live/mystream

This is the output:

ffplay version git-2013-11-22-ffe31c6 Copyright (c) 2003-2013 the FFmpeg developers
  built on Nov 22 2013 23:20:36 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu8)
  configuration: --prefix=/home/subuntu/ffmpeg/ffmpeg_build --extra-cflags=-I/home/subuntu/ffmpeg/ffmpeg_build/include --extra-ldflags=-L/home/subuntu/ffmpeg/ffmpeg_build/lib --bindir=/home/subuntu/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab
  libavutil      52. 54.100 / 52. 54.100
  libavcodec     55. 44.100 / 55. 44.100
  libavformat    55. 21.101 / 55. 21.101
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 91.100 /  3. 91.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
[rtmp @ 0xb0e00bc0] Server error: Failed to play mystream; stream not found.
rtmp://ec2-xx-xxx-xx-xxx.compute-1.amazonaws.com/live/mystream: Operation not permitted
    nan    :  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0

I am unable to fathom why I am getting the errors “stream not found” and “Operation not permitted”.

Just to compare, I tried streaming the audio file as an ‘flv’ stream like this:

$ ffmpeg -re -i input_file.mp3 -c copy -f flv rtmp://ec2-xx-xxx-xx-xxx.compute-1.amazonaws.com/live/mystream

This works beautifully. I can play it using the ffplay command in the other terminal without any problem.

Does the ‘live’ application on the server not handle mp3 streams? If not, can someone help me understand why the mp3 stream is failing with “stream not found” and “Operation not permitted” errors, while the flv stream doesn’t?

Thanks in advance!