0

我必须在 android 上通过 ffmpeg 将 yuv 转换为 mp4。当我将 wav 转换为 mp4 时效果很好。但是当我将 yuv 或 yuv + wav 转换为 mp4 时,我收到错误消息说

Error decoding AAC frame header

有人知道发生了什么吗?

以下是完整的调试日志

transferYUV2MP4() enter
__transfer_yuv_to_mp4() enter
__transfer_yuv_to_mp4() argv[00/17] = ffmpeg
__transfer_yuv_to_mp4() argv[01/17] = -loglevel
__transfer_yuv_to_mp4() argv[02/17] = debug
__transfer_yuv_to_mp4() argv[03/17] = -y
__transfer_yuv_to_mp4() argv[04/17] = -i
__transfer_yuv_to_mp4() argv[05/17] = /sdcard/111.yuv
__transfer_yuv_to_mp4() argv[06/17] = -i
__transfer_yuv_to_mp4() argv[07/17] = /sdcard/3.wav
__transfer_yuv_to_mp4() argv[08/17] = -c:a
__transfer_yuv_to_mp4() argv[09/17] = aac
__transfer_yuv_to_mp4() argv[10/17] = -strict
__transfer_yuv_to_mp4() argv[11/17] = experimental
__transfer_yuv_to_mp4() argv[12/17] = -b:a
__transfer_yuv_to_mp4() argv[13/17] = 56k
__transfer_yuv_to_mp4() argv[14/17] = -preset
__transfer_yuv_to_mp4() argv[15/17] = ultrafast
__transfer_yuv_to_mp4() argv[16/17] = /sdcard/111.mp4
__run_ffmpeg_main() enter
__run_ffmpeg_main() handle=0xb000f7f8
__run_ffmpeg_main() dlfunc=0x4b5a2728
ffmpeg version 1.2.2
 Copyright (c) 2000-2013 the FFmpeg developers
  built on Aug 10 2013 16:34:45 with gcc 4.6 (GCC) 20120106 (prerelease)
  configuration: --target-os=linux --prefix=./android/armv7-a --sysroot=/Users/pht/android/ndks/android-ndk-r9/platforms/android-8/arch-arm/ --enable-gpl --enable-version3 --disable-shared --enable-static --disable-ffprobe --disable-ffplay --disable-ffserver --disable-network --enable-avformat --enable-avcodec --enable-cross-compile --arch=arm --cc=/Users/pht/android-standalone-toolchain/bin/arm-linux-androideabi-gcc --nm=/Users/pht/android-standalone-toolchain/bin/arm-linux-androideabi-nm --cross-prefix=/Users/pht/android-standalone-toolchain/bin/arm-linux-androideabi- --extra-cflags=' -I../fdk-aac/include -I../x264 -O3 -fpic -DANDROID -DHAVE_SYS_UIO_H=1 -Dipv6mr_interface=ipv6mr_ifindex -fasm -Wno-psabi -fno-short-enums -fno-strict-aliasing -finline-limit=300 -mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=armv7-a ' --extra-ldflags=' -L../fdk-aac/lib -L../x264 -Wl,-rpath-link=/Users/pht/android/ndks/android-ndk-r9/platforms/android-8/arch-arm//usr/lib -L/Users/pht/android/ndks/android-ndk-r9/platforms/andr
  libavutil      52. 18.100 / 52. 18.100
  libavcodec     54. 92.100 / 54. 92.100
  libavformat    54. 63.104 / 54. 63.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 42.103 /  3. 42.103
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Splitting the commandline.
Reading option '-loglevel' ...
 matched as option 'loglevel' (set libav* logging level) with argument 'debug'.
Reading option '-y' ...
 matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-i' ...
 matched as input file with argument '/sdcard/111.yuv'.
Reading option '-i' ...
 matched as input file with argument '/sdcard/3.wav'.
Reading option '-c:a' ...
 matched as option 'c' (codec name) with argument 'aac'.
Reading option '-strict' ...
 matched as AVOption 'strict' with argument 'experimental'.
Reading option '-b:a' ...
 matched as option 'b' (video bitrate (please use -b:v)) with argument '56k'.
Reading option '-preset' ...
 matched as AVOption 'preset' with argument 'ultrafast'.
Reading option '/sdcard/111.mp4' ...
 matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set libav* logging level) with argument debug.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file /sdcard/111.yuv.
Successfully parsed a group of options.
Opening an input file: /sdcard/111.yuv.
Format aac detected only with low score of 1, misdetection possible!
File position before avformat_find_stream_info() is 0
get_buffer() failed
Error decoding AAC frame header.
channel element 2.12 is not allocated
More than one AAC RDB per ADTS frame is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
channel element 3.4 is not allocated
channel element 2.2 is not allocated
Number of scalefactor bands in group (44) exceeds limit (40).
channel element 2.10 is not allocated
channel element 1.15 is not allocated
channel element 3.6 is not allocated
channel element 2.0 is not allocated
channel element 3.3 is not allocated
Sample rate index in program config element does not match the sample rate index configured by the container.
channel element 2.8 is not allocated
Sample rate index in program config element does not match the sample rate index configured by the container.
channel element 3.2 is not allocated
Reserved bit set.
channel element 2.6 is not allocated
channel element 2.1 is not allocated
Dependent coupling is not supported together with LTP
Dependent coupling is not supported together with LTP
Dependent coupling is not supported together with LTP
Dependent coupling is not supported together with LTP
Dependent coupling is not supported together with LTP

并且“依赖耦合...”行循环数千次

4

1 回答 1

0

我在编译 ffmpeg 时没有打开 rawvideo 和 yuv4 编码器/解码器和复用器/解复用器。我添加它们后,它已解决。

于 2013-08-10T13:14:45.600 回答