输入 :
"C:/server/ffmpeg/bin/ffmpeg.exe" -y -i C:\server\websites\ps\public_www/media/com_hwdmediashare/files/50/4f/37/4185216cb9bb234fd47ee43bf2122e4f.avi -strict experimental -acodec aac -ac 2 -ab 192k -s 480x360 -aspect 16:9 -r 24000/1001 -vcodec libx264 -b:v 1000k -minrate 800k -maxrate 1000k -bufsize 800K -crf 18 -preset veryslow -f mp4 -threads 0 -movflags +faststart C:\server\websites\ps\public_www/media/com_hwdmediashare/files/50/4f/37/de8324ea7b8fe7a28ccc701f0ae757c8.mp4 2>&1
输出 :
ffmpeg version N-65916-g9e8ab36 Copyright (c) 2000-2014 the FFmpeg developers
built on Aug 26 2014 22:10:59 with gcc 4.8.3 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-decklink --enable-zlib
libavutil 54. 7.100 / 54. 7.100
libavcodec 56. 0.101 / 56. 0.101
libavformat 56. 3.100 / 56. 3.100
libavdevice 56. 0.100 / 56. 0.100
libavfilter 5. 0.103 / 5. 0.103
libswscale 3. 0.100 / 3. 0.100
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 0.100 / 53. 0.100
[avi @ 0000000002c5c2c0] non-interleaved AVI
[mp3 @ 0000000002b2b220] Header missing
Input #0, avi, from 'C:\server\websites\ps\public_www/media/com_hwdmediashare/files/50/4f/37/4185216cb9bb234fd47ee43bf2122e4f.avi':
Duration: 00:06:46.47, start: 0.000000, bitrate: 1144 kb/s
Stream #0:0: Video: mpeg4 (DX50 / 0x30355844), yuv420p, 512x384 [SAR 1:1 DAR 4:3], 1106 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 30k tbc
Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 11025 Hz, stereo, s16p, 31 kb/s
[libx264 @ 0000000002b87da0] using SAR=4/3
[libx264 @ 0000000002b87da0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0000000002b87da0] profile High, level 3.1
[libx264 @ 0000000002b87da0] 264 - core 142 r2453 ea0ca51 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=16 deblock=1:0:0 analyse=0x3:0x133 me=umh subme=10 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=24 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=8 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=60 rc=crf mbtree=1 crf=18.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=1000 vbv_bufsize=800 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
[aac @ 0000000002b88de0] Too many bits per frame requested
Output #0, mp4, to 'C:\server\websites\ps\public_www/media/com_hwdmediashare/files/50/4f/37/de8324ea7b8fe7a28ccc701f0ae757c8.mp4':
Stream #0:0: Video: h264 (libx264), yuv420p, 480x360 [SAR 4:3 DAR 16:9], q=-1--1, 1000 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc
Metadata:
encoder : Lavc56.0.101 libx264
Stream #0:1: Audio: aac, 0 channels, 128 kb/s
Metadata:
encoder : Lavc56.0.101 aac
Stream mapping:
Stream #0:0 -> #0:0 (mpeg4 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (mp3 (native) -> aac (native))
Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height
我看不出转换过程中出了什么问题,也许有人可以帮助我?
答案1
-acodec aac -strict experimental
当尝试强制为给定的音频速率设置过高的比特率时,这是本机 FFmpeg AAC 编码器 () 产生的错误。
我能想到七种解决这个问题的方法:
- 降低音频比特率,例如
-ab 64k
(您可能需要进行实验),或者 - 用于
-aq 10
VBR 音频,而不是-ab
,或 - 提高音频速率,例如
-ar 44100
,或 - 使用不同的 AAC 音频编码器,例如
-acodec libvoaac_enc
,或 - 管道传输
ffmpeg
到外部独立 AAC 编码器,然后与 重新混合ffmpeg
,或者 - 流复制(重新混合)使用 的音频
-acodec copy
,或 - 输出为不同的音频格式,例如 MP3
-acodec libmp3lame
不幸的是,分布式版本ffmpeg
通常只提供原生 AAC 编码器和 libvoaac_enc,但 FFmpeg 支持更好的 AAC 编码器,例如 libfdk_aac,但你必须编译ffmpeg
以获得对此的支持。
查看FFmpeg AAC 音频编码指南更多细节。