Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getMatrix() return olways ROTATE_0 #66

Open
GoogleCodeExporter opened this issue Apr 20, 2016 · 5 comments
Open

getMatrix() return olways ROTATE_0 #66

GoogleCodeExporter opened this issue Apr 20, 2016 · 5 comments

Comments

@GoogleCodeExporter
Copy link

Executing:

    String m = isoFile.getMovieBox().getMovieHeaderBox().getMatrix().toString();

on any video, despite of the rotation, returns always "Rotate 0"

I have tested the versions 1.0-RC-24 and 1.0-RC-25 on a Galaxy S3 with Android 
4.


Original issue reported on code.google.com by [email protected] on 5 Aug 2013 at 6:20

@GoogleCodeExporter
Copy link
Author

Please have a look at the TrackHeaderBox. Your phone might rotate the video 
track instead of the whole video.

Original comment by [email protected] on 6 Aug 2013 at 3:28

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

It reproduces for me also, I'm testing it on a video I create with LG Nexus 4's 
camera(API level 4.4). 
I'm getting that the MovieBox is
MovieBox[MovieHeaderBox[creationTime=Mon Dec 30 15:07:27 GMT+02:00 
2013;modificationTime=Mon Dec 30 15:07:27 GMT+02:00 
2013;timescale=1000;duration=2667;rate=1.0;volume=1.0;matrix=Rotate 
0°;nextTrackId=3];TrackBox[];TrackBox[]]

it has only box of type MovieHeaderBox, and indeed the rotation is always 
Rotation 0.

Original comment by [email protected] on 30 Dec 2013 at 3:01

@GoogleCodeExporter
Copy link
Author

I'm having the same issue in Android 4.4.4, I know that the video is rotated by 
90, I checked it in ffmpeg also and it has a rotation of 90, but 
isoFile.getMovieBox().getMovieHeaderBox().getMatrix().toString() is returning 
"Rotate 0". 

I just downloaded your library and I noticed few things that might help you fix 
the issue or narrow it down, 


1- The matrix variable in MovieHeaderBox.java is being set as shown below,
         private Matrix matrix = Matrix.ROTATE_0;

and the function is always returning it 

    public Matrix getMatrix() {
        return matrix;
    }

2- The second issue is that the matrix definition doesn't look right, for 
example, the matrix ROTATE_0 found in Matrix.java below might be wrong, 
                       public static final Matrix ROTATE_0 = new Matrix(1, 0, 0, 1, 0, 0, 1, 0, 0);

I believe this should be an identity matrix and it should be like this ( 1, 0, 
0, 0, 1, 0, 0, 0, 1 ).



Original comment by [email protected] on 19 Sep 2014 at 3:21

@GoogleCodeExporter
Copy link
Author

Hi,

It's seems to be ok if you use the TrackBox Data.

Something like this is ok on my video files :

isoFile = new IsoFile(filepath);
                MovieBox moov = isoFile.getMovieBox();
                for(Box b : moov.getBoxes()) {
                    // First looking for movie Header Box 
                     if (b.getType()=="mvhd"){
                        MovieHeaderBox mhb = (MovieHeaderBox) b;
                        System.out.println("Duration :"+mhb.getDuration());
                        System.out.println("Matrix Rotation :"+mhb.getMatrix());                            
                     }
                     if (b.getType()=="trak"){
                        TrackBox tb = (TrackBox) b;
                        System.out.println("Trak Matrix Rotation :"+tb.getTrackHeaderBox().getMatrix());
                     }
                    System.out.println(b);
                }

Jean

Original comment by [email protected] on 18 Jan 2015 at 7:46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant