2015년 7월 21일 화요일

simple rtsp by ffmpeg

vi /etc/ffserver.conf
HTTPPort 7000
RTSPPort 7001
BindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 1000

<Feed test.ffm>
        File /tmp/test.ffm
        FileMaxSize 1M
</Feed>

<Stream test.h264>
        Feed test.ffm
        Format rtp

        VideoSize 640x480
        VideoFrameRate 5
        #VideoBitrate 800
        #VideoBufferSize 40
        #VideoCodec libx264

        NoAudio

        MulticastAddress 239.255.0.1
        MulticastPort 20001
        MulticastTTL 4
        Metadata title "test"
</Stream>

<Stream test.rtsp>
        Feed test.ffm
        Format rtp
        VideoSize 640x480
        NoAudio
        Metadata title "test"
</Stream>

<Stream stat.html>
        Format status
        ACL allow 192.168.0.0 192.168.0.255
</Stream>

## rtsp start
ffserver

## input
ffmpeg -re -i ./source.mp4 -vcodec copy -acodec copy http://rtspip:7000/test.ffm

## recv renderring
rtsp://rtspip:7001/test.rtsp

## status check
http://rtspip:7000/stat.html

## ffmpeg info
ffserver version git-2015-05-25-e48a9ac Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-11)
  configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfreetype --enable-libx264
  libavutil      54. 23.101 / 54. 23.101
  libavcodec     56. 40.100 / 56. 40.100
  libavformat    56. 33.101 / 56. 33.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 16.101 /  5. 16.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100

댓글 없음: