Rotated HD video appears cropped - how to fix?

Started by ecbass7, August 14, 2020, 07:03:52 PM

Previous topic - Next topic

ecbass7

Hello, I am new to Exiftool and am trying to rotate some mp4 videos created with a Canon S120 camera.  I read several forum posts, I understand the basic command, and I can successfully execute it and the video is indeed rotated.  Prior to rotation with Exiftool, the Rotation tag in Composite was 0, and the MatrixStructure in Track 1 was 1 0 0 0 1 0 0 0 1.  After rotation with exiftool, the rotation tag in Composite is 270, the MatrixStructure in Track1 is 0 -1 0 1 0 0 0 1920 1, and the video is indeed rotated correctly when I view it in any video player.  All other tags remain the same.

But... the rotated video is displayed cropped on the right hand side, and then expanded to fit.  So a person who was centrally located on the video before is now on the right of the video, the wall to their R is not visible because it's been cropped away, and the person appears physically wider than they were before.   I tried in multiple players, all with the same result.

I was trying to come up with a thought as to how/why the media players are interpreting the tags such that they are displaying the video cropped (since obviously I haven't actually changed the video, just the metadata).  The only thing I thought of, and maybe this is the wrong rabbit hole to go down, is that maybe my pixels aren't square - or maybe the video players need to be told explicitly that the pixels *are* square.  I noticed that there is no tag for PixelAspectRatio anywhere in my metadata.  It *should* be a 1:1 because that's the standard for HD video... but maybe it's not.  I'd play around with it if I could, but when I tried to add the tag, I found that exiftool won't add it.  When I look at the documentation, it appears that mostly this tag is not writeable although in one place it is.  But perhaps my tag name or syntax is not correct, because I was not able to get exiftool to write the tag. 

The other option I thought of was to play around with MatrixStructure, but I'm not sure what to change it *to*.  I saw this which explained the basic structure of the matrix, but I could only get so far.  I understand that the matrix can be manipulated to take care of scaling, but I'm not sure how.  And again, not sure why it is necessary, or even if scaling is my problem.  It's just the only idea I've had so far. 

https://stackoverflow.com/questions/7025186/how-to-remove-or-edit-exif-from-mp4-video

So, my questions are:

1. Does anyone have any idea what could have caused my video to become cropped in the rotation process? 
2. Do you think I am going down the right rabbit hole with either the PixelAspectRatio or the MatrixStructure ideas, and if so do you have any ideas as to how to work with these tags to fix my problem?

Thank you. 

Phil Harvey

I would try playing around with the 1920 parameter in MatrixStructure to see where that gets you.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

ecbass7

No effect: I tried 300, 3000, and 30000 instead of 1920 and the image was identical each time.  :(

I thought about changing the ImageWidth and ImageHeight and ImageSize parameters but none of them appear to be writable. 

I take it PixelAspectRatio is not writable, then? 

Thank you. 

Phil Harvey

Right.  PixelAspectRatio is not yet writable.  Currently none of the image description tags are writable.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

ecbass7

OK, thanks.  I played around with pretty much everything in MatrixStructure and nothing makes a difference, so I guess it's "game over" - nothing else to write even if I could figure out what the video players are reading or misreading.  Thank you for the feedback/replies.