问题
execFFmpegBinary(new String[]{"-y", "-i", path, "-s", "160x120", "-r", "25", "-vcodec", "mpeg4", "-b:v", "150k", "-b:a", "48000", "-ac", "2", "-ar", "22050", filePath});
video auto rotate after compress..
is there any solution?
here is lib Link
回答1:
it might be the autorotate issue in FFMPEG and you have to disable autorotate:
ffmpeg -noautorotate -i input.mp4 output.mp4
if this solution doesn't solve your problem, you can get the input video rotation with Android APIs like this:
MediaMetadataRetriever m = new MediaMetadataRetriever();
m.setDataSource(inputVideoFilePath);
String rotation;
if (Build.VERSION.SDK_INT >= 17) {
rotation = m.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_ROTATION);
}
after finding input file's rotation, you have to rotate the output file accordingly as below :
ffmpeg -noautorotate -i input.mp4 -filter:v "rotation*PI/180" output.mp4
来源:https://stackoverflow.com/questions/60752666/ffmpegandroid-library-rotates-video-after-compress