a914-gowtham / android-video-trimmer

Helps to trim local videos with compress option on Android applications using Exoplayer 2 and FFmpeg.
Other
380 stars 117 forks source link

After compress video not return rotate? #14

Open hamaianh opened 4 years ago

hamaianh commented 4 years ago

Hi you, Please let me know, after compress video then not return rotate?

a914-gowtham commented 4 years ago

Sorry,I wouldn't get u..can you tell me in detail!

hamaianh commented 4 years ago

Hi you, E.g In metadata, video before use compression has rotate:90, but after compression then no longer see that attribute (rotate in metadata) Please help me check it?

hamaianh commented 4 years ago

Do you have idea?

a914-gowtham commented 4 years ago

It won't make any changes in metadata.However,check the video rotation before open the trimmer activity.or else share the code which is you used to get the rotation of the video

    public static String getRotation(Activity context, Uri videoUri) {
        try {
            MediaMetadataRetriever retriever = new MediaMetadataRetriever();
            retriever.setDataSource(context,videoUri);
            int width = Integer.parseInt(retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_ROTATION));
            retriever.release();
            return String.valueOf(width);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }