找不到使用ffmpeg-moov atom的音频视频合并错误

时间:2019-02-05 06:56:29

标签: android video ffmpeg android-ffmpeg video-editing

我正在使用以下命令合并音频和视频-

"-i", videoFileAbsolutePath, "-i", audioFileAbsolutePath, "-c:v", "copy", "-c:a", "aac", "-map", "0:v:0", "-map", "1:a:0", "-shortest", destinationFileAbsolutePath

对于一些视频,我的错误率低于-

  

ffmpeg版本n3.0.1版权所有(c)2000-2016 FFmpeg开发人员\ n   使用gcc 4.8(GCC)\ n配置构建:--target-os = linux   --cross-prefix = / home / vagrant / SourceCode / ffmpeg-android / toolchain-android / bin / arm-linux-androideabi-   --arch = arm --cpu = cortex-a8 --enable-runtime-cpudetect --sysroot = / home / vagrant / SourceCode / ffmpeg-android / toolchain-android / sysroot   --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg -config = / home / vagrant / SourceCode / ffmpeg-android / ffmpeg-pkg-config --prefix = / home / vagrant / SourceCode / ffmpeg-android / build / armeabi-v7a --extra-cflags ='-I / home / vagrant / SourceCode / ffmpeg-android / toolchain-android / include   -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE = 2 -fno-strict-overflow -fstack-protector-all'--extra-ldflags ='-L / home / vagrant / SourceCode / ffmpeg-android / toolchain-android / lib   -Wl,-z,relro -Wl,-z,现在-pie'--extra-libs ='-lpng -lexpat -lm'--extra-cxxflags = \ n libavutil 55. 17.103 / 55. 17.103 \ n libavcodec 57. 24.102 / 57. 24.102 \ n libavformat 57. 25.100 /   57. 25.100 \ n libavdevice 57. 0.101 / 57. 0.101 \ n libavfilter 6. 31.100 / 6. 31.100 \ n libswscale 4. 0.100 / 4. 0.100 \ n libswresample 2. 0.101 / 2. 0.101 \ n libpostproc 54. 0.100 /   54. 0.100 \ n输入#0,mov,mp4,m4a,3gp,3g2,mj2,来自'/ storage / emulated / 0 / keepvid / Amar_Akbar_Anthony_(HD)_-__ Hindi_Full_Movie _-_ Amitabh_Bachchan,_Vinod_Khanna,_Rishi': \ n   元数据:\ n major_brand:破折号\ n minor_version:0 \ n
  compatible_brands:iso6avc1mp41 \ n创建时间:2018-10-23   19:02:47 \ n持续时间:02:46:52.04,开始:0.000000,比特率:1528   kb / s \ n流#0:0(und):视频:h264(高)(avc1 / 0x31637661),   yuv420p(tv,bt709),1920x1080 [SAR 1:1 DAR 16:9],0 kb / s,25 fps,25   tbr,90k tbn,50 tbc(默认)\ n元数据:\ n creation_time:   2018-10-23 19:02:47 \ n handler_name:   VideoHandler \ n [mov,mp4,m4a,3gp,3g2,mj2 @ 0xeb62d600] 格式   仅以低分1检测到mov,mp4,m4a,3gp,3g2,mj2   可能会误检测!\ n [mov,mp4,m4a,3gp,3g2,mj2 @ 0xeb62d600]   找不到Moov原子\ n / storage / emulated / 0 / keepvid / Amar_Akbar_Anthony_(HD)_-_ Hindi_Full_Movie _-_ Amitabh_Bachchan,_Vinod_Khanna,_Rishi_Kapoor,_1080P.m4a :   处理输入时发现无效数据

在创建水印时我也遇到了类似的错误-

"-i", videoFileAbsolutePath, "-i", imageFileAbsolutePath, "-filter_complex", "overlay=" + position, dest.getAbsolutePath()
  

ffmpeg版本n3.0.1版权所有(c)2000-2016使用gcc 4.8(GCC)构建的FFmpeg开发人员\ n配置:--target-os = linux --cross-prefix = / home / vagrant / SourceCode / ffmpeg-android / toolchain-android / bin / arm-linux-androideabi- --arch = arm --cpu = cortex-a8 --enable-runtime-cpudetect --sysroot = / home / vagrant / SourceCode / ffmpeg-android / toolchain-android / sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-调试--disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared-启用静态--pkg-config = / home / vagrant / SourceCode / ffmpeg-android / ffmpeg-pkg-config --prefix = / home / vagrant / SourceCode / ffmpeg-android / build / armeabi-v7a --extra-cflags ='-I / home / vagrant / SourceCode / ffmpeg-android / toolchain-android / include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE = 2 -fno-strict-overflow -fstack-protector-all '--extra-ldflags ='-L / home / vagrant / SourceCode / ffmpeg-android / toolchain-android / lib -Wl,-z,relro -Wl,-z,now -pie'-extra-libs =' -lpng -lexpat -lm'--extra-cxxflags = \ n libavutil 55. 17.103 / 55. 17.103 \ n libavcodec 57. 24.102 / 57. 24.102 \ n libavformat 57. 25.100 / 57. 25.100 \ n libavdevice 57. 0.101 / 57. 0.101 \ n libavfilter 6. 31.100 / 6. 31.100 \ n libswscale 4. 0.100 / 4. 0.100 \ n libswresample 2. 0.101 / 2. 0.101 \ n libpostproc 54. 0.100 / 54. 0.100 \ n输入#0,mov, mp4,m4a,3gp,3g2,mj2,来自“ / storage / emulated / 0 / WhatsApp业务/媒体/ WhatsApp业务视频/VID-20190215-WA0016.mp4”:\n元数据:\ n major_brand:mp42 \ n minor_version: 1 \ ncompatible_brands:mp41mp42isom \ n creation_time:2019-02-14 11:53:37 \ n持续时间:00:00:45.56,开始:0.000000,比特率:1444 kb / s \ n流#0:0(und) :视频:h264(基线)(avc1 / 0x31637661),yuv420p(tv,bt709),848x480,1382 kb / s,29.98 fps,29.97 tbr,600 tbn,1200 tbc(默认) \ n元数据:\ n creation_time:2019-02-14 11:53:37 \ n handler_name:Core Media Video \ n流#0:1(und):音频:aac(LC)(mp4a / 0x6134706D),44100 Hz ,立体声,fltp,59 kb / s(默认)\ n元数据:\ n creation_time:2019-02-14 11:53:37 \ n handler_name:Core Media Audio \ n [mov,mp4,m4a,3gp,3g2, mj2 @ 0xf0e30600]仅以低分1检出格式mov,mp4,m4a,3gp,3g2,mj2的格式,可能会导致错误检测!\ n [mov,mp4,m4a,3gp,3g2,mj2 @ 0xf0e30600] 没有moov原子找到 \ n / storage / emulated / 0 / Movies / IMG-20190225-WA0030.jpg.mp4:处理输入时发现无效数据 \ n

我该如何解决此错误?

1 个答案:

答案 0 :(得分:0)

如果您想要具有与输入格式相同的输出格式,并且我们假设视频文件不包含任何音频流,则可以将以下FFmpeg命令改编为android:

ffmpeg -i video.mp4 -i audio.wav -c:v copy -c:a aac -strict experimental output_merged.mp4

如果一个流比另一个流长,则可以添加-shortest选项,以便FFmpeg在一个文件结束时将停止编码。