无法使用 ffmpeg 将直播流录制到 WebM?

无法使用 ffmpeg 将直播流录制到 WebM?

我从 mp4 源进行流式传输,到目前为止,我已成功将剪辑保存为 ogg(视频:libtheora,音频:flac),但我想将它们保存为 WebM 格式。不幸的是,WebM 需要 libvorbis 来提供音频,当我尝试这样做时:

$ ffmpeg -t 60 -rtsp_transport udp -i rtsp://192.168.1.142/video.mp4 -vcodec libvpx -acodec libvorbis -f webm test.webm
ffmpeg version 0.10.5 Copyright (c) 2000-2012 the FFmpeg developers
  built on Oct  4 2012 19:17:43 with gcc 4.7.2 20120921 (Red Hat 4.7.2-2)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-libass --enable-libcdio --enable-libcelt --enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
  libavutil      51. 35.100 / 51. 35.100
  libavcodec     53. 61.100 / 53. 61.100
  libavformat    53. 32.100 / 53. 32.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 61.100 /  2. 61.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
  libpostproc    52.  0.100 / 52.  0.100
[rtsp @ 0xc62ec0] Estimating duration from bitrate, this may be inaccurate
Input #0, rtsp, from 'rtsp://192.168.1.142/video.mp4':
  Metadata:
    title           : QStream
    comment         : QStreaming Media
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: mpeg4 (Simple Profile), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 30 fps, 30 tbr, 90k tbn, 30 tbc
    Stream #0:1: Audio: pcm_mulaw, 8000 Hz, 1 channels, s16, 64 kb/s
File 'test.webm' already exists. Overwrite ? [y/N] y
w:640 h:480 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param:
[libvpx @ 0xc60b60] v1.0.0
[libvorbis @ 0xc61da0] Unable to set CBR to 128000: not supported
[libvorbis @ 0xc61da0] oggvorbis_encode_init failed
Output #0, webm, to 'test.webm':
  Metadata:
    title           : QStream
    comment         : QStreaming Media
    Stream #0:0: Video: vp8, yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 200 kb/s, 90k tbn, 30 tbc
    Stream #0:1: Audio: vorbis, 8000 Hz, 1 channels, s16, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg4 -> libvpx)
  Stream #0:1 -> #0:1 (pcm_mulaw -> libvorbis)
Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height

我发现在 WebM 文件中编码音频的唯一方法ffmpeg这里,但这需要两次通过,所以我无法通过直播来做到这一点。有什么线索吗?

答案1

也许考虑通过“-an”选项不使用音频?

相关内容