FFMpeg命令不适用于4.0-39-gda39990版本,但适用于3.0.1版本

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

我在FFmpeg命令下面运行,以使用4.0-39版本剪切视频-

{"-y","-i","/storage/emulated/0/Movies/g3cm1tt7qtd41.mp4.mp4", "-ss", "10", "-t", "53", "-c", "copy","/storage/emulated/0/Movies/cut_video10.mp4"}

它以以下响应返回成功,但是无法播放输出视频!但是,使用较旧版本的FFMpeg 3.0.1时,相同的命令可以正常运行,并且可以播放输出视频!

输出成功:ffmpeg版本n4.0-39-gda39990版权所有(c)2000-2018年FFmpeg开发人员使用gcc 4.9.x(GCC)20150123(预发行版)构建配置:--target-os = linux --cross-prefix = / root / bravobit / ffmpeg-android / toolchain-android / bin / arm-linux-androideabi---arch = arm --cpu = cortex-a8 --enable-runtime-cpudetect --sysroot = / root / bravobit / ffmpeg-android / toolchain-android / sysroot --enable-pic --enable-libx264 --enable -ffprobe --enable-libopus --enable-libvorbis --enable-libfdk-aac --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-libvpx --enable-libass- -enable-yasm --enable-pthreads --disable-debug --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-linux-perf --disable-doc --disable-shared- enable-static --enable-runtime-cpudetect --enable-nonfree --enable-network --enable-avresample --enable-avformat --enable-avcodec --enable-indev = lavfi --enable-hwaccels --enable -ffmpeg --enable-zlib --enable-gpl --enable-small --enable-nonfree --pkg-config = pkg-config --pkg-config-flags =-静态--prefix = / root / bravobit / ffmpeg-android / build / armeabi-v7a --extra-cflags ='-I / root / bravobit / ffmpeg-android / toolchain-android / include-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE = 2 -fno-strict-overflow -fstack-protector-all'--extra-ldflags ='-L / root / bravobit / ffmpeg-android / toolchain-android / lib -Wl,-z,relro- WL,-Z,现在-PIE'--extra-cxxflags =libavutil 56. 14.100 / 56. 14.100libavcodec 58. 18.100 / 58. 18.100libavformat 58. 12.100 / 58. 12.100libavdevice 58. 3.100 / 58. 3.100libavfilter 7. 16.100 / 7. 16.100libavresample 4. 0. 0 / 4. 0. 0libswscale 5. 1.100 / 5. 1.100libswresample 3. 1.100 / 3. 1.100libpostproc 55. 1.100 / 55. 1.100输入#0,mov,mp4,m4a,3gp,3g2,mj2,来自'/storage/emulated/0/Movies/g3cm1tt7qtd41.mp4.mp4':元数据:major_brand:iso6minor_version:1兼容品牌:mp42iso6avc1isomcreation_time:2020-01-30T11:13:07.000000Z时长:00:00:00.00,开始:0.042643,比特率:N / A流#0:0(und):视频:h264(avc1 / 0x31637661),yuv420p,854x480 [SAR 2136:2135 DAR 89:50],1225 kb / s,30 fps,30 tbr,15360tbn,60 tbc(默认)流#0:1(eng):音频:aac(mp4a / 0x6134706D),48000 Hz,立体声,fltp,128 kb / s(默认)输出#0,mp4到'/storage/emulated/0/Movies/cut_video10.mp4':元数据:major_brand:iso6minor_version:1兼容品牌:mp42iso6avc1isom编码器:Lavf58.12.100流#0:0(und):视频:h264(avc1 / 0x31637661),yuv420p,854x480 [SAR 2136:2135 DAR 89:50],q = 2-31、1225 kb / s,30 fps,30 tbr,15360 tbn,15360 tbc(默认)流#0:1(eng):音频:aac(mp4a / 0x6134706D),48000 Hz,立体声,fltp,128 kb / s(默认)流映射:流#0:0->#0:0(复制)流#0:1->#0:1(复制)按[q]停止,按[?]寻求帮助帧= 0 fps = 0.0 q = -1.0 Lsize = 0kB时间= 00:00:00.00比特率= N / A速度= 0x视频:0kB音频:0kB字幕:0kB其他流:0kB全局标头:0kB混合开销:未知

响应版本3.0.1起作用-

SUCCESS with output : ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
      built with gcc 4.8 (GCC)
      configuration: --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,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
      libavutil      55. 17.103 / 55. 17.103
      libavcodec     57. 24.102 / 57. 24.102
      libavformat    57. 25.100 / 57. 25.100
      libavdevice    57.  0.101 / 57.  0.101
      libavfilter     6. 31.100 /  6. 31.100
      libswscale      4.  0.100 /  4.  0.100
      libswresample   2.  0.101 /  2.  0.101
      libpostproc    54.  0.100 / 54.  0.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/Movies/g3cm1tt7qtd41.mp4.mp4':
      Metadata:
        major_brand     : iso6
        minor_version   : 1
        compatible_brands: mp42iso6avc1isom
        creation_time   : 2020-01-30 11:13:07
      Duration: 00:00:00.00, start: 0.042667, bitrate: N/A
        Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 854x480 [SAR 2136:2135 DAR 89:50], 1225 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
        Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Output #0, mp4, to '/storage/emulated/0/Movies/cut_video11.mp4':
      Metadata:
        major_brand     : iso6
        minor_version   : 1
        compatible_brands: mp42iso6avc1isom
        encoder         : Lavf57.25.100
        Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 854x480 [SAR 2136:2135 DAR 89:50], q=2-31, 1225 kb/s, 30 fps, 30 tbr, 15360 tbn, 15360 tbc (default)
        Stream #0:1(eng): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 128 kb/s (default)
    Stream mapping:
      Stream #0:0 -> #0:0 (copy)
      Stream #0:1 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    frame=  661 fps=0.0 q=-1.0 Lsize=    3848kB time=00:00:23.01 bitrate=1369.5kbits/s speed=71.1x    
    video:3463kB audio:359kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.657366%

文件链接-https://gofile.io/d/7aFuQo

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

此文件中的编辑列表看起来格式不正确。告诉ffmpeg忽略它。

ffmpeg -ignore_editlist 1 -i g3cm1tt7qtd41.mp4 -ss 10 -t 53 -c copy out.mp4
© www.soinside.com 2019 - 2024. All rights reserved.