我正在使用以下命令旋转视频-
{"-y", "-ss", "" + startMs / 1000, "-t", "" + (endMs - startMs) / 1000, "-i", inputPath, "-vf", "transpose=" + type,"-c:a", "copy", outputPath}
我在Android Oreo中收到以下失败消息-
“ 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/Download/dolbycanyon.3gp”:\n元数据:\ n
major_brand:3gp4 \ nminor_version:512 \ n
compatible_brands:isomiso23gp4 \ n持续时间:00:00:38.07,开始于: 0.006250,比特率:402 kb / s \ n流#0:0(und):视频:h263(s263 / 0x33363273),yuv420p,704x576 [SAR 12:11 DAR 4:3],384 kb / s,29.97 fps,29.97 tbr,30k tbn,29.97 tbc(默认)\ n元数据:\ n
handler_name:VideoHandler \ n流#0:1(und):音频:amr_nb (samr / 0x726D6173),8000 Hz,单声道,flt,12 kb / s(默认)\ n
元数据:\ n handler_name:SoundHandler \ n [libx264 @ 0xf64e5400]使用SAR = 11/12 \ n [libx264 @ 0xf64e5400]使用cpu 功能:无!\ n [libx264 @ 0xf64e5400]配置文件高级别 3.1 \ n [libx264 @ 0xf64e5400] 264-核心148-H.264 / MPEG-4 AVC编解码器-Copyleft 2003-2015-http://www.videolan.org/x264.html-选项: cabac = 1 ref = 3解块= 1:0:0分析= 0x3:0x113 me = hex subme = 7 psy = 1 psy_rd = 1.00:0.00 mixed_ref = 1 me_range = 16 chroma_me = 1格= 1 8x8dct = 1 cqm = 0死区= 21,11 fast_pskip = 1 chroma_qp_offset = -2 线程= 12 lookahead_threads = 2 sliced_threads = 0 nr = 0抽取= 1 隔行= 0 bluray_compat = 0 constrained_intra = 0 bframes = 3 b_pyramid = 2 b_adapt = 1 b_bias = 0直接= 1 weightb = 1 open_gop = 0 weightp = 2 keyint = 250 keyint_min = 25 scenecut = 40 intra_refresh = 0 rc_lookahead = 40 rc = crf mbtree = 1 crf = 23.0 qcomp = 0.60 qpmin = 0 qpmax = 69 qpstep = 4 ip_ratio = 1.40 aq = 1:1.00 \ n [mp4 @ 0xf64a8600]在以下位置找不到编解码器amr_nb的标签 流#1,容器当前不支持编解码器\ n输出#0,mp4, 到'/storage/emulated/0/Movies/rotate_video4.mp4':\n元数据:\ n
major_brand:3gp4 \ nminor_version:512 \ n
compatible_brands:isomiso23gp4 \ n编码器:Lavf57.25.100 \ n 流#0:0(und):视频:h264(libx264)([33] [0] [0] [0] / 0x0021), yuv420p,576x704 [SAR 11:12 DAR 3:4],q = -1--1,29.97 fps,30k tbn, 29.97 tbc(默认)\ n元数据:\ n handler_name:VideoHandler \ n编码器:Lavc57.24.102 libx264 \ n侧面 数据:\ n未知边数据类型10(24字节)\ n流 0:1(und):音频:amr_nb(samr / 0x726D6173),8000 Hz,单声道,12 kb / s(默认)\ n元数据:\ n handler_name:SoundHandler \ nStream 映射:\ n流#0:0->#0:0(h263(本机)-> h264(libx264))\ n 流#0:1->#0:1(复制)\ n无法为输出文件#0写入标头 (错误的编解码器参数?):无效的参数\ n“
为什么会出现此错误,我该如何解决?
答案 0 :(得分:1)
MP4并不正式支持amr_nb音频。仍然要强制使用
{"-y", "-ss", "" + startMs / 1000, "-t", "" + (endMs - startMs) / 1000, "-i", inputPath, "-vf", "transpose=" + type,"-c:a", "copy", "-atag","samr", outputPath}
但是建议您另存为.3gp。
或者,您可以通过放下"-c:a", "copy"