1
我有一個旋轉和剪裁視頻文件的工作。 我修剪視頻,但無法旋轉它。 我使用以下代碼片段進行旋轉,但結果視頻與源視頻相同。並且沒有任何錯誤消息。 mp4parser不會旋轉視頻
videoPath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/download/cvbenim/islenecek.mp4";
try {
String rotatedPath = videoPath.replace(".mp4", "cvbenim_is_ilanı_rotated.mp4");
Movie result = MovieCreator.build(videoPath);
File file = new File(rotatedPath);
if (file.exists()) {
file.delete();
}
Container out = new DefaultMp4Builder().build(result);
MovieHeaderBox mvhd = Path.getPath(out, "moov/mvhd");
mvhd.setMatrix(Matrix.ROTATE_90);
out.writeContainer(new FileOutputStream(rotatedPath).getChannel());
playVideoFromPath(rotatedPath);
} catch (Exception e) {
e.printStackTrace();
}
我任何並欣賞幫助。
當我在桌面上播放結果視頻時,視頻不旋轉 –