INDExOS / media-for-mobile

Media for Mobile
Other
456 stars 178 forks source link

Portrait video is rotated by 90 degrees counter-clockwise after using samples #85

Open devingDev opened 6 years ago

devingDev commented 6 years ago

Hi, using the samples I tried transcoding, for example using Cut Video . I opened a video I had recorded in portrait mode with my other custom app. When you view the video in a mediaplayer it shows correctly in portrait mode!
Now when I press cut and it transcodes and outputs a file the video that was output is rotated by 90 degrees counter-clockwise! Its the samples so I did not do custom stuff in there and I saw this piece of code which should make the output retain the original orientation in "ComposerTranscodeCoreActivity" class :

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

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

    configureVideoEncoder(mediaComposer, videoWidthOut, videoHeightOut);
    configureAudioEncoder(mediaComposer);
}`

Additionally landscape videos do not seem to get rotated and show correctly after transcoding.

devingDev commented 6 years ago

So I tried the cutter again. When I input a video recroded from screen (with DU Recorder app) I have no problems (except it saying missing audioformat)

When i use the camera app to record and open that file it 1) displays wrongly on the last activity where you press start (rotated by -90 degrees) and 2) the output is very weird , it has big black borders? and the original video is small in the middle taking up only 50% space.