[FFmpeg-user] ffmpeg and ffserver to transcode and stream rtsm to rtmp? Please Help me.

Ryan Blakeslee rblakeslee at netrinsics.net
Thu May 30 09:54:48 CEST 2013


Hello,

On Debian 6, I am trying to use ffmpeg and ffserver to transcode and
stream an rtsp feed from an IP camera in order for visitors to play via
browser.

It's a brand new camera - I'm struggling to make this work, and I am not
familiar enough with it to know what I am doing wrong.  I have tested the
camera by successfully viewing the rtsp feed in VLC as well as a hosted
streaming provider.  This all works, so I know the camera and rtsp is
functioning.

Flow looks like this:  [IP Cam] --> RSTP h.264 stream
(rtsp://192.168.0.25:554/cam0_0) --> [FFMPEG] --> [FFSERVER] (Port 9999,
Feed1.ffm) --> Web Browser

I am using ffmpeg/ffserver installed from Debian repositories via apt-get
install ffmpeg. It seems as though it's running, but when I either try to
browse to http://host:9999/test.swf or I try to use VLC to open the
network stream, I get a white screen.  When I stop ffmpeg, I get this very
faint, ghostly (near indistinguishable) outline of a still of the video.

I'm working on a project for a customer, and I would like to know how to
do make this work and to be able to repeat it so I can use it in the
future on other projects as well.  I've spend a ridiculous amount of time
on this and I've reached a dead end.  I would be willing to hire an expert
to help me with this if this is possible to do and I can't do it on my
own.  (I don't want to use a solution like Red5 or Wazoo -- I want to know
how to do this and be able to do this with ffmpeg.  Not because I'm cheap
- I'm willing to spend money for help, but I want to have control of the
tools I use for my customers.)

Please help!  ---  Is what I am trying to do even possible in this
configuration?

---

My ffserver.conf file looks like this:

Port 9999
# bind to all IPs aliased or not
BindAddress 0.0.0.0
# max number of simultaneous clients
MaxClients 1000
# max bandwidth per-client (kb/s)
MaxBandwidth 10000
# Suppress that if you want to launch ffserver as a daemon.
NoDaemon

<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 5M
ACL allow 127.0.0.1
</Feed>

<Stream test.swf>
Feed feed1.ffm
Format swf
VideoCodec flv
VideoFrameRate 30
VideoBufferSize 80000
VideoBitRate 100
VideoQMin 1
VideoQMax 5
VideoSize 704x480
PreRoll 0
Noaudio
</Stream>

---

1. I run the following command: ffserver & ffmpeg -i
rtsp://192.168.0.25:554/cam0_0 -vcodec http://localhost:9999/feed1.ffm

1A. (I also run ffserver from one console session and ffmpeg from another
-- same results.)

1B.  I get the following ffmpeg output:


[NULL @ 0x92bd330]non-existing PPS referenced
[h264 @ 0x92bd330]number of reference frames exceeds max (probably corrupt
input), discarding one
Seems stream 0 codec frame rate differs from container frame rate:
180000.00 (180000/1) -> 90000.00 (180000/2)
    Last message repeated 12 times
Input #0, rtsp, from 'rtsp://192.168.0.25:554/cam0_0':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: h264, yuv420p, 704x480, 90k tbr, 90k tbn, 180k tbc
Output #0, ffm, to 'http://localhost:9999/feed1.ffm':
    Stream #0.0: Video: 0x0000, yuv420p, 704x480, q=1-5, 1000k tbn, 90k
tbc
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
frame= 2350 fps=101 q=-1.0 size=    7008kB time=0.03
bitrate=2219927.1kbits/s

1C. I get the following output on ffserver:

ffserver
FFserver version SVN-r0.5.10-4:0.5.10-1, Copyright (c) 2000-2009 Fabrice
Bellard, et al.
  configuration: --extra-version=4:0.5.10-1 --prefix=/usr
--enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib
--enable-libdirac --enable-libgsm --enable-libopenjpeg
--enable-libschroedinger --enable-libspeex --enable-libtheora
--enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping
--disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc
--enable-swscale --enable-x11grab --enable-libfaad --enable-libdc1394
--shlibdir=/usr/lib/i686/cmov --cpu=i686 --enable-shared --disable-static
--disable-ffmpeg --disable-ffplay
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 1 / 52.20. 1
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libavfilter    0. 4. 0 /  0. 4. 0
  libswscale     0. 7. 1 /  0. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Feb 16 2013 10:09:50, gcc: 4.4.5

[NULL @ 0x87832f0]error, non monotone timestamps -829980193100065088 >=
-829980193100065088

Last message repeated 640 times

SWF muxer only supports VP6, FLV1 and MJPEG

---


More information about the ffmpeg-user mailing list