저는 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" 옵션을 통해 오디오를 사용하지 않는 것을 고려해 보세요.