INDExOS / media-for-mobile

Media for Mobile
Other
456 stars 178 forks source link

Keep the correct video orientation on transcoding #65

Closed daniloercoli closed 7 years ago

daniloercoli commented 7 years ago

Fix #64 and upgrade Gradle and Gradle wrapper

smackd40 commented 7 years ago

video rotation fix works. How to handle text overlay rotation in relation to video rotation fix?

RafagSL commented 6 years ago

@smackd40 +1, this works when just translating, but not when applying a filter.

RafagSL commented 6 years ago

Ok, just add

int orientation = mediaFileInfo.getRotation(); mediaComposer.setTargetFile(dstMediaPath, orientation);

on setTrasncodeParameter method on the ComposerVideoEffectCoreActivity and will keep the orientation.

devingDev commented 6 years ago

I am using the samples and for example when I use Cut Video it will rotate the video by 90 degrees when I use a video I had recorded before. The video was shot in portrait mode and looking at it it shows correctly. But after using Cut video it is rotated by 90 degrees counter-clockwise.

When I use a landscape recorded video it seems to work though.. very weird.

As this is a sample I assume it uses the class ComposerTranscodeCoreActivity which calls this:

` protected void setTranscodeParameters(org.m4m.MediaComposer mediaComposer) throws IOException {

    mediaComposer.addSourceFile(mediaUri1);
    int orientation = mediaFileInfo.getRotation();
    mediaComposer.setTargetFile(dstMediaPath, orientation);

....

} ` so it should be set correctly but it is not.