使用ffmpeg / ffserver的Webm流问题

时间:2014-10-10 12:25:32

标签: html5 ffmpeg ip-camera webm ffserver

我正在尝试在浏览器中播放来自ip camera的流。我正在使用ffmpeg和ffserver堆栈(均为2.4.2)。

现在我可以使用flash在浏览器中轻松播放视频流。但我希望能够在原生的html5播放器中播放它。我需要webm格式才能做到这一点。

ffserver config snippet:

 <Feed 0_webm.ffm>
File /tmp/0_webm.ffm
FileMaxSize 5M
ACL allow localhost
</Feed>

<Stream 0.webm>
Feed 0_webm.ffm
Format webm
NoAudio
</Stream>

<Stream test2.swf>
Feed feed2.ffm
Format swf
VideoCodec flv
VideoFrameRate 30
VideoBufferSize 50000
VideoBitRate 100
VideoQMin 1
VideoQMax 5
VideoSize 352x288
PreRoll 0
Noaudio
</Stream>

我执行此命令从相机获取流并通过ffserver传递给客户端:

ffmpeg -rtsp_transport tcp -i rtsp://admin:admin@192.168.10.76:80 -vcodec libvpx r 10 -f webm http://localhost:8090/0_webm.ffm

但得到&#34;断管&#34;错误消息(完整的ffmeg输出):

ffmpeg version 2.4.2 Copyright (c) 2000-2014 the FFmpeg developers
  built on Oct  6 2014 17:33:05 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  configuration: --prefix=/opt/ffmpeg --libdir=/opt/ffmpeg/lib/ --enable-shared --enable-avresample --disable-stripping --enable-gpl --enable-version3 --enable-runtime-cpudetect --build-suffix=.ffmpeg --enable-postproc --enable-x11grab --enable-libcdio --enable-vaapi --enable-vdpau --enable-bzlib --enable-gnutls --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libfaac --enable-libvo-aacenc --enable-nonfree --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfdk_aac --enable-libopus --enable-pthreads --enable-zlib --enable-libvpx --enable-libfreetype --enable-libpulse --enable-debug=3
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.101 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.100 /  5.  1.100
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
Guessed Channel Layout for  Input Stream #0.1 : mono
Input #0, rtsp, from 'rtsp://admin:admin@192.168.10.76:80':
  Metadata:
    title           : RTSP Session/2.0
  Duration: N/A, start: 0.000000, bitrate: 128 kb/s
    Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709), 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1: Audio: pcm_alaw, 16000 Hz, 1 channels, s16, 128 kb/s
[swscaler @ 0xcf97a0] deprecated pixel format used, make sure you did set range correctly
[libvpx @ 0xd86fc0] v1.3.0
Output #0, webm, to 'http://localhost:8090/0_webm.ffm':
  Metadata:
    title           : RTSP Session/2.0
    encoder         : Lavf56.4.101
    Stream #0:0: Video: vp8 (libvpx), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 200 kb/s, 10 fps, 1k tbn, 10 tbc
    Metadata:
      encoder         : Lavc56.1.100 libvpx
    Stream #0:1: Audio: vorbis (libvorbis), 16000 Hz, mono, fltp
    Metadata:
      encoder         : Lavc56.1.100 libvorbis
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> vp8 (libvpx))
  Stream #0:1 -> #0:1 (pcm_alaw (native) -> vorbis (libvorbis))
Press [q] to stop, [?] for help
av_interleaved_write_frame(): Broken pipe
    Last message repeated 1 times
frame=    2 fps=0.0 q=0.0 Lsize=      40kB time=00:00:00.23 bitrate=1371.2kbits/s    
video:36kB audio:1kB subtitle:0kB other streams:0kB global headers:3kB muxing overhead: 7.514220%
Conversion failed!

如果我在没有-f webm的情况下运行相同的命令,我没有错误,它看起来像工作。但在这种情况下,我无法在浏览器中播放它(例如Chrome)。

有人知道如何修理&#34;破管问题&#34;?很乐意得到您的帮助或建议。提前谢谢。

0 个答案:

没有答案