音频视频合并使用ffmpeg- moov atom not found错误

问题描述 投票:3回答:1

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

"-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-archarch = 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 =' - 我/ home / vagrant / SourceCode / ffmpeg-android / toolchain-android / include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE = 2 -fno-strict-overflow -fstack-protector-all' - e xtra-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/keepvid/Amar_Akbar_Anthony_(HD)_-Hindi_Full_Movie_-_Amitabh_Bachchan,_Vinod_Khanna,_Rishi_Kapoor,_1080P.mp4':\n元数据:\ n major_brand:dash \ n minor_version: 0 \ n compatible_brands:iso6avc1mp41 \ n creation_time: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]格式mov,mp4,m4a,3gp,3g2,mj2检测结果只有低分1,误检可能!\ [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 FFmpeg开发人员\ n用gcc 4.8(GCC)构建\ n配置: - target-os = linux --cross-prefix = / home / vagrant / SourceCode / ffmpeg- android / toolchain-android / bin / arm-linux-androideabi-archarch = 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 =' - 我/ home / vagrant / SourceCode / ffmpeg-android / toolchain-android / include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE = 2 -fno-strict-overflow -fstack-protector-all' - e xtra-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 \ n compatible_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:核心媒体视频\ 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]格式为mov,mp4,m4a,3gp,3g2,mj2仅检测到低分1,错误检测可能!\ n [mov,mp4,m4a,3gp,3g2,mj2 @ 0xf0e30600]未找到moov原子\ n / storage / emulated / 0 / Movies / IMG-20190225-WA0030.jpg.mp4:处理时发现无效数据输入\ n

我该如何解决这个错误?

android video ffmpeg android-ffmpeg video-editing
1个回答
0
投票

如果您希望输入格式与输入格式相同,并且我们假设视频文件不包含任何音频流,您可以将以下FFmpeg命令调整为android:

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

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

© www.soinside.com 2019 - 2024. All rights reserved.