这是我用于分割视频的命令:
ffmpeg -y -i input.mp4 -c:v copy -c:a copy -map 0 -f segment -segment_time 60 -g 9 -sc_threshold 0 -force_key_frames expr:gte(t,n_forced*6) output.mp4
这是我执行上述命令后得到的错误:
built with gcc 4.9.x (GCC) 20150123 (prerelease)
configuration: --target-os=android --cross-prefix=/home/george/ffmpeg-android/toolchain-android/bin/aarch64-linux-android- --arch=arm64 --cpu=cortex-a57 --enable-runtime-cpudetect --sysroot=/home/george/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-filters --enable-libx264 --enable-zlib --enable-libfreetype --enable-libmp3lame --enable-fontconfig --enable-pthreads --enable-protocol=file --disable-debug --disable-network --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-small --disable-shared --enable-static --enable-ffmpeg --enable-jni --enable-mediacodec --disable-bsfs --disable-encoders --enable-encoder='rawvideo,libx264,mpeg4,bmp,png,aac,mp3,gif,libmp3lame,pcm_s8,pcm_u8' --disable-decoders --enable-decoder='aac,h264,h264_mediacodec,mpeg4,mpeg4_mediacodec,bmp,mp3,png,gif,pcm_s8,pcm_u8' --disable-muxers --enable-muxer='mp3,gif,mp4,rawvideo,ac3,flac,ipod,pcm_u8' --disable-demuxers --enable-demuxer='aac,gif,mp3,image_png_pipe,rawvideo,mov,flac,ac3,sdp,pcm_u8,mpegvideo' --disable-parsers --enable-parser='aac,bmp,h264,mjpeg,png,mpeg4video,mpegvideo,mpegaudio' --disable-hwaccels --enable-hwaccel=h264_mediacodec --enable-gpl --disable-x86asm --disable-doc --pkg-config=/home/george/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/george/ffmpeg-android/build/arm64 --extra-cflags='-I/home/george/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all -Wall -Os -O3 -pipe -ffast-math' --extra-ldflags='-L/home/george/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -luuid -lm -lz' --extra-cxxflags=
libavutil 56. 14.100 / 56. 14.100
libavcodec 58. 18.100 / 58. 18.100
libavformat 58. 12.100 / 58. 12.100
libavdevice 58. 3.100 / 58. 3.100
libavfilter 7. 16.100 / 7. 16.100
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100
libpostproc 55. 1.100 / 55. 1.100
Unrecognized option 'segment_time'.
Error splitting the argument list: Option not found
目前我正在使用ffmpeg 4.0.2。
请帮帮我!我不知道为什么它不能识别segment_time!
答案1
您正在编译 FFMPEG,要使用segment
您需要--enable muxer=segment \
在 android-ffmpeg.sh 文件中添加的选项
感谢@Gyan