I have a job that is rotating and trimming video files. I do trimming the video but couldn't rotate it. I use following code snippet to rotate but the result video is the same with the source video .Also there isn't any error messeage.
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();
}
I appriciate any help.