{"id":4650,"date":"2014-03-30T14:18:56","date_gmt":"2014-03-30T14:18:56","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/no-way-to-record-a-live-stream-to-webm-using-ffmpeg-collection-of-common-programming-errors\/"},"modified":"2014-03-30T14:18:56","modified_gmt":"2014-03-30T14:18:56","slug":"no-way-to-record-a-live-stream-to-webm-using-ffmpeg-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/no-way-to-record-a-live-stream-to-webm-using-ffmpeg-collection-of-common-programming-errors\/","title":{"rendered":"No way to record a live stream to WebM using ffmpeg?-Collection of common programming errors"},"content":{"rendered":"<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/dddf3305018066b6962d07163883bd4e?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nFelix<\/p>\n<p>I&#8217;m streaming from an mp4 source and so far I&#8217;ve managed to save clips as ogg (video: libtheora, audio: flac), but I&#8217;d like to save them in the WebM format. Unfortunately, WebM demands libvorbis for audio and when I try to do that:<\/p>\n<pre><code>$ ffmpeg -t 60 -rtsp_transport udp -i rtsp:\/\/192.168.1.142\/video.mp4 -vcodec libvpx -acodec libvorbis -f webm test.webm\nffmpeg version 0.10.5 Copyright (c) 2000-2012 the FFmpeg developers\n  built on Oct  4 2012 19:17:43 with gcc 4.7.2 20120921 (Red Hat 4.7.2-2)\n  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\n  libavutil      51. 35.100 \/ 51. 35.100\n  libavcodec     53. 61.100 \/ 53. 61.100\n  libavformat    53. 32.100 \/ 53. 32.100\n  libavdevice    53.  4.100 \/ 53.  4.100\n  libavfilter     2. 61.100 \/  2. 61.100\n  libswscale      2.  1.100 \/  2.  1.100\n  libswresample   0.  6.100 \/  0.  6.100\n  libpostproc    52.  0.100 \/ 52.  0.100\n[rtsp @ 0xc62ec0] Estimating duration from bitrate, this may be inaccurate\nInput #0, rtsp, from 'rtsp:\/\/192.168.1.142\/video.mp4':\n  Metadata:\n    title           : QStream\n    comment         : QStreaming Media\n  Duration: N\/A, start: 0.000000, bitrate: N\/A\n    Stream #0:0: Video: mpeg4 (Simple Profile), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 30 fps, 30 tbr, 90k tbn, 30 tbc\n    Stream #0:1: Audio: pcm_mulaw, 8000 Hz, 1 channels, s16, 64 kb\/s\nFile 'test.webm' already exists. Overwrite ? [y\/N] y\nw:640 h:480 pixfmt:yuv420p tb:1\/1000000 sar:1\/1 sws_param:\n[libvpx @ 0xc60b60] v1.0.0\n[libvorbis @ 0xc61da0] Unable to set CBR to 128000: not supported\n[libvorbis @ 0xc61da0] oggvorbis_encode_init failed\nOutput #0, webm, to 'test.webm':\n  Metadata:\n    title           : QStream\n    comment         : QStreaming Media\n    Stream #0:0: Video: vp8, yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 200 kb\/s, 90k tbn, 30 tbc\n    Stream #0:1: Audio: vorbis, 8000 Hz, 1 channels, s16, 128 kb\/s\nStream mapping:\n  Stream #0:0 -&gt; #0:0 (mpeg4 -&gt; libvpx)\n  Stream #0:1 -&gt; #0:1 (pcm_mulaw -&gt; libvorbis)\nError while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height\n<\/code><\/pre>\n<p>The only way I found to encode audio in a WebM file using <code>ffmpeg<\/code> is here, but that requires two passes, so I can&#8217;t do it with a live stream. Any clues?<\/p>\n<\/li>\n","protected":false},"excerpt":{"rendered":"<p>Felix I&#8217;m streaming from an mp4 source and so far I&#8217;ve managed to save clips as ogg (video: libtheora, audio: flac), but I&#8217;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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4650","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4650","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4650"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4650\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4650"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4650"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}