ffmpeg stream ip cam from rtsp to http

时间:2017-03-15 20:33:42

标签: http ffmpeg stream rtsp ip-camera

我正在尝试将ip camera从家庭网络重新播放到网页(wordpress中的视频播放器)。我有相机的rtsp url,我想在http中输出。现在困扰我2天了,我不确定我错过了什么...... 我的ffserver.conf文件:

HTTPPort 8090                      # Port to bind the server to
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 10000             # Maximum bandwidth per client
RTSPPort 8002

                             # set this high enough to exceed stream bitrate
CustomLog -

<Feed cam.ffm>
     File /tmp/cam.ffm
     FileMaxSize 10G
     ACL allow 192.168.0.0 192.168.255.255
  </Feed>


<Stream cam.mpg>
     Feed cam.ffm
     Format mpeg
     VideoCodec libx264
     VideoSize 1280x720
     VideoFrameRate 6
     VideoBufferSize 40
     AVOptionVideo flags +global_header
     PreRoll 15
     StartSendOnKey
     VideoBitRate 4096
     NoAudio
</Stream>

<Stream status.html>            # Server status URL
   Format status
   # Only allow local people to get the status
   ACL allow localhost
   ACL allow 192.168.0.0 192.168.255.255
</Stream>

<Redirect index.html>    # Just an URL redirect for index
   # Redirect index.html to the appropriate site
   URL url/
</Redirect>

当我输入ffserver -f /etc/ffserver.conf时,我得到:

root@test:/tmp# ffserver -f /etc/ffserver.conf
ffserver version 2.6.9 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.9.2 (Debian 4.9.2-10)
  configuration: --prefix=/usr --extra-cflags='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security ' --extra-ldflags='-Wl,-z,relro' --cc='ccache cc' --enable-shared --enable-libmp3lame --enable-gpl --enable-nonfree --enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --disable-stripping --enable-libvpx --enable-libschroedinger --disable-encoder=libschroedinger --enable-version3 --enable-libopenjpeg --enable-librtmp --enable-avfilter --enable-libfreetype --enable-libvo-aacenc --disable-decoder=amrnb --enable-libvo-amrwbenc --enable-libaacplus --libdir=/usr/lib/x86_64-linux-gnu --disable-vda --enable-libbluray --enable-libcdio --enable-gnutls --enable-frei0r --enable-openssl --enable-libass --enable-libopus --enable-fontconfig --enable-libpulse --disable-mips32r2 --disable-mipsdspr1 --disable-mipsdspr2 --enable-libvidstab --enable-libzvbi --enable-avresample --disable-htmlpages --disable-podpages --enable-libutvideo --enable-libfdk-aac --enable-libx265 --enable-libiec61883 --enable-vaapi --enable-libdc1394 --disable-altivec --shlibdir=/usr/lib/x86_64-linux-gnu
  libavutil      54. 20.100 / 54. 20.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 25.101 / 56. 25.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 11.102 /  5. 11.102
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
/etc/ffserver.conf:30: Setting default value for video bit rate tolerance = 1024000. Use NoDefaults to disable it.
/etc/ffserver.conf:30: Setting default value for video rate control equation = tex^qComp. Use NoDefaults to disable it.
/etc/ffserver.conf:30: Setting default value for video max rate = 8192000. Use NoDefaults to disable it.
Wed Mar 15 20:23:41 2017 FFserver started.

当我输入ffmpeg -i rtsp://<ip of camera>:8002 http://<ip of this machine-server>:8090/cam.ffm时,什么也没发生。

我也可以http://<ip of my server>:8090/status.html,但http://<ip of my server>:8090/cam.mpg没有运气。

有什么建议吗?

谢谢!

0 个答案:

没有答案