无法将 webm 视频和音频转换为 mp4

无法将 webm 视频和音频转换为 mp4

我正在尝试使用 RecordRTC 在画布中录制视频和音频并将其转换为 mp4,但出现以下错误。请向我推荐 ffmpeg 命令来修复此问题。

Received command: -i video.webm -i audio.webm -c:v mpeg4 -c:a aac -b:v 6400k -b:a 4800k -strict experimental output.mp4.  Processing with 268435456 bits.
configuration: --cc=emcc --enable-cross-compile --target-os=none --arch=x86_32 --cpu=generic --disable-ffplay --disable-ffprobe --disable-ffserver --disable-a`enter code here`sm --disable-doc --disable-devices --disable-pthreads --disable-w32threads --disable-network --disable-hwaccels --disable-parsers --disable-bsfs --disable-debug --disable-zlib --disable-protocols --disable-indevs --disable-outdevs --enable-protocol=file --enable-pic --enable-small
libavutil      52. 52.100 / 52. 52.100
libavcodec     55. 41.100 / 55. 41.100
libavformat    55. 21.100 / 55. 21.100
libavdevice    55.  5.100 / 55.  5.100
libavfilter     3. 90.102 /  3. 90.102
libswscale      2.  5.101 /  2.  5.101
libswresample   0. 17.104 /  0. 17.104
[vp8 @ 0xcba330] Warning: not compiled with thread support, using thread emulation
Input #0, matroska,webm, from 'video.webm':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0(eng): Video: vp8, yuv420p, 300x400, SAR 1:1 DAR 3:4, 1k tbr, 1k tbn, 1k tbc (default)
Metadata:
alpha_mode      : 1
Guessed Channel Layout for  Input Stream #1.0 : stereo
Input #1, matroska,webm, from 'audio.webm':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #1:0(eng): Audio: opus, 48000 Hz, stereo (default)
[graph 1 input from stream 1:0 @ 0xccf4c0] Invalid sample format (null)
Error opening filters!
Finished processing (took 3688ms)
{"type":"done","data":[{"name":"output.mp4","data":{}}],"time":3688}
{"name":"output.mp4","data":{}}

答案1

您的 ffmpeg 太老了。您省略了版本信息,但它似乎是 2013 年末或 2014 年初的。那时还没有 Opus 解码器。

FFmpeg 开发非常活跃,因此您错过了许多功能和错误修复。更新到现代版本,它应该可以正常工作。

相关内容