Monday, January 31, 2011

Live Transcoding using Xuggler with Wowza

I tried to use xuggler for live transcoding with Wowza. Good startpoint is explained at here. Finnaly, it works, but I struggled for a day.

The problem I had was that the ffmpeg do not publish any stream. I saw the Wowza log and found that it connected to server and started getting the stream. But the publishing did not happen.

I used command "ffprobe" to find the issue that ffmpeg did not find audio codec. Followings were messages when I run it. It took around 10 minutes to see the error message.
> ffprobe rtmp://127.0.0.1/live/myStream
FFprobe version SVN-r26402-xuggle-4.0.revision.sh, Copyright (c) 2007-2011 the FFmpeg developers
  built on Jan 31 2011 15:10:13 with gcc 4.1.2 20080704 (Red Hat 4.1.2-48)
  configuration: --prefix=/usr/local/xuggler --extra-version=xuggle-4.0.revision.sh --extra-cflags=-I/usr/local/xuggler/include --extra-ldflags=-L/usr/local/xuggler/lib --enable-shared --enable-gpl --enable-nonfree --enable-version3 --enable-libx264 --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-pthreads
  libavutil     50.36. 0 / 50.36. 0
  libavcore      0.16. 1 /  0.16. 1
  libavcodec    52.108. 0 / 52.108. 0
  libavformat   52.93. 0 / 52.93. 0
  libavdevice   52. 2. 3 / 52. 2. 3
  libavfilter    1.74. 0 /  1.74. 0
  libswscale     0.12. 0 /  0.12. 0
[flv @ 0xf816210] Estimating duration from bitrate, this may be inaccurate
Input #0, flv, from 'rtmp://127.0.0.1/live/myStream':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: flv, yuv420p, 320x240, 1k tbr, 1k tbn, 1k tbc
    Stream #0.1: Audio: [0][0][0][0] / 0x0000, 0 channels
Unsupported codec (id=0) for input stream 1

Oh, I got it. I'm not streaming audio when I start publishing video. And that is the reason why ffmpeg do not start publish any stream. So, I start publishing audio and video at the same time. Yes, it works.

> ffprobe rtmp://127.0.0.1/live/myStream 
FFprobe version SVN-r26402-xuggle-4.0.revision.sh, Copyright (c) 2007-2011 the FFmpeg developers
  built on Jan 31 2011 15:10:13 with gcc 4.1.2 20080704 (Red Hat 4.1.2-48)
  configuration: --prefix=/usr/local/xuggler --extra-version=xuggle-4.0.revision.sh --extra-cflags=-I/usr/local/xuggler/include --extra-ldflags=-L/usr/local/xuggler/lib --enable-shared --enable-gpl --enable-nonfree --enable-version3 --enable-libx264 --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-pthreads
  libavutil     50.36. 0 / 50.36. 0
  libavcore      0.16. 1 /  0.16. 1
  libavcodec    52.108. 0 / 52.108. 0
  libavformat   52.93. 0 / 52.93. 0
  libavdevice   52. 2. 3 / 52. 2. 3
  libavfilter    1.74. 0 /  1.74. 0
  libswscale     0.12. 0 /  0.12. 0
[flv @ 0x10056210] Estimating duration from bitrate, this may be inaccurate
Input #0, flv, from 'rtmp://127.0.0.1/live/myStream':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: flv, yuv420p, 320x240, 1k tbr, 1k tbn, 1k tbc
    Stream #0.1: Audio: nellymoser, 11025 Hz, mono, s16

Hm, the issue remains is how to support muting mic. Maybe some tricks are required.

No comments:

Post a Comment