Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm streaming from an mp4 source and so far I've managed to save clips as ogg (video: libtheora, audio: flac), but I'd like to save them in the WebM format. Unfortunately, WebM demands libvorbis for audio and when I try to do that:

$ 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

The only way I found to encode audio in a WebM file using ffmpeg is here, but that requires two passes, so I can't do it with a live stream. Any clues?

share|improve this question
    
Have you tried specifying various bitrates for audio? –  peterph Nov 17 '12 at 22:53
    
Not really, since I wouldn't really know what to use. I'll try to come up with something, though. –  Felix Nov 19 '12 at 9:19
    
well, 128kb/s seems to be quite a lot for 8kHz, mono stream - it's basically uncompressed stream rate. I would try something like 16 or 32 kb/s. Or a different codec. –  peterph Nov 19 '12 at 11:14
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.