RTSP source mp4 FLV streaming

Today, after many months of research and work, i managed to develop a working solution for the following task:

There is an IP camera which acts as an mp4 video RTSP server on a remote location. The requirement, the live stream of the camera has to be embedded into a webpage as flash video source. Unfortunately the previous solution incorporated an unconverted mp4 stream, many disconnections, Darwin Streaming Server, VideoLan software. We had to create a special VideoLan installation for the clients to install the browser plugin as default and set up the RTSP over TCP as default.

I have read not so far away in a mailing list of Motion video surveillance system, that someone has managed to create an RTSP video stream converted to a /dev/video0 source using openRTSP and ffmpeg. Here came the idea, and i created a working prototype of the solution of this task with the help of openRTSP, ffmpeg, and ffserver. The solution is FLV streaming from an RTSP server as source.

Ofcourse i ran into problems, so my first try to feed a converted stream of flv into ffserver failed. The cause of the problem was me. The ffserver only likes FFM as his input format.

The right command which creates a usable source to ffserver is:

openRTSP -v -c -t rtsp://rtsp.server.com/ | \
ffmpeg -r 5 -f m4v -i - http://127.0.0.1:8090/feed1.ffm

The basic config in ffserver.conf is:

Port 8090
BindAddress 0.0.0.0
MaxClients 200
MaxBandwidth 20000
CustomLog /var/log/flvserver/access.log

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

<Stream rtspsource.flv>
Feed feed1.ffm
VideoBitRate 1024
VideoBufferSize 128
Format flv
VideoSize 352x288
VideoFrameRate 5
VideoQMin  3
VideoQMax  3
NoAudio
</Stream>

This article is also available in hungarian version.

Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed and get articles like this delivered automatically to your feed reader.

Comments

Szia!

Többé kevésbé ez alapján lőttem be egy saját megoldást, köszönöm.

Egy dologra nem tudok rájönni:

Az ffmpeg írja alul streamelés közben, hogy

bitrate=3100.4kbits/s

ezt hogyan tudom lejjebb vinni? a -b kapcsoló semmit nem változtat…

KÖSZI

Az amire kérdezel az ffmpeg és az ffserver közötti adatfolyam lesz, és azt a ffmpegbe beáramló adat rátája is befolyásolja.

Nekem is az a gondom, hogy adott egy Axis IP CAM, annak a jelet egy serverre kellene streamelni, majd a felhasznalok egy weboldaon keresztul egy flash player segitsegevel nezhessek a cam kepet.

IPCAM (kicsi net sebesseg)-> SERVER (gigabit net sebesseg – ezert o vegezne az uzenet szorast) -> SOK USER

Sikerult megoldani a problemat? Ha igen tudtok e segiteni…

Segitsegeteket elore is koszonom!

Note to myself live555 compiling on Jaunty needs gcc g++ make atleast

Hi Gergő,

I want to get an rstp video stream and a saparat audio strem live and then multiplex them together and stream it to the network further. is this possible with ffmpeg?

your reply may help me a lot.

Regards,
Mudassar

I have googled around, and i think you need to provide a second -i parameter for the audio stream, examples are in their docs: http://www.ffmpeg.org/ffmpeg-doc.html#SEC20

hi, thank you. I am searching many time to get this tutorial. good job

I hope it is useful, because i often get reactions that in one or other case it wont work, and much depends on the ffmpeg build.
There are cases where console based vlc does the job better, but at the time i wrote the howto, vlc was not capable to do this.

Vélemény, hozzászólás?

(kötelező)

(kötelező)