我正在使用https://github.com/WritingMinds/ffmpeg-android-java。可以修剪,加入mp4文件,但无法旋转和加速/减速。
尝试了几乎所有的答案,但没有运气。
我正在使用最新的Android Studio。
D/ffmpeg_work: [-noautorotate, -i, /storage/emulated/0/Pictures/VideoApp/v_1479895157.mp4, -vf, transpose=1, /storage/emulated/0/Pictures/VideoApp/v_1480001945.mp4]
D/FFmpeg: Running publishing updates method
D/ffmpeg_work: onProgress: ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
D/ffmpeg_work: onProgress: built with gcc 4.8 (GCC)
D/ffmpeg_work: onProgress: 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=
D/ffmpeg_work: onProgress: libavutil 55. 17.103 / 55. 17.103
D/ffmpeg_work: onProgress: libavcodec 57. 24.102 / 57. 24.102
D/ffmpeg_work: onProgress: libavformat 57. 25.100 / 57. 25.100
D/ffmpeg_work: onProgress: libavdevice 57. 0.101 / 57. 0.101
D/ffmpeg_work: onProgress: libavfilter 6. 31.100 / 6. 31.100
D/ffmpeg_work: onProgress: libswscale 4. 0.100 / 4. 0.100
D/ffmpeg_work: onProgress: libswresample 2. 0.101 / 2. 0.101
D/ffmpeg_work: onProgress: libpostproc 54. 0.100 / 54. 0.100
D/ffmpeg_work: onProgress: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/Pictures/VideoApp/v_1479895157.mp4':
D/ffmpeg_work: onProgress: Metadata:
D/ffmpeg_work: onProgress: major_brand : isom
D/ffmpeg_work: onProgress: minor_version : 512
D/ffmpeg_work: onProgress: compatible_brands: isomiso2avc1mp41
D/ffmpeg_work: onProgress: encoder : Lavf57.25.100
D/ffmpeg_work: onProgress: Duration: 00:00:09.88, start: -3.000000, bitrate: 1816 kb/s
D/ffmpeg_work: onProgress: Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 1280x960, 1755 kb/s, 4.46 fps, 7.50 tbr, 90k tbn, 180k tbc (default)
D/ffmpeg_work: onProgress: Metadata:
D/ffmpeg_work: onProgress: rotate : 270
D/ffmpeg_work: onProgress: handler_name : VideoHandler
D/ffmpeg_work: onProgress: Side data:
D/ffmpeg_work: onProgress: displaymatrix: rotation of 90.00 degrees
D/ffmpeg_work: onProgress: Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 96 kb/s (default)
D/ffmpeg_work: onProgress: Metadata:
D/ffmpeg_work: onProgress: handler_name : SoundHandler
也试过这些:
[-noautorotate, -i, /storage/emulated/0/Pictures/VideoApp/v_1479895157.mp4, -filter:v, transpose=1, /storage/emulated/0/Pictures/VideoApp/v_1480002208.mp4]
[-noautorotate, -i, /storage/emulated/0/Pictures/VideoApp/v_1479895157.mp4, -filter:v, transpose=1, -metadata:s:v, rotate=0, /storage/emulated/0/Pictures/VideoApp/v_1480002275.mp4]
[-noautorotate, -i, /storage/emulated/0/Pictures/VideoApp/v_1479895157.mp4, -vf, transpose=1, /storage/emulated/0/Pictures/VideoApp/v_1480002362.mp4]
此后两种情况都没有发生