Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6815697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:50:17+00:00 2026-05-26T20:50:17+00:00

I recorded a Full HD video with Samsung Galaxy II, when I uploaded it

  • 0

I recorded a Full HD video with Samsung Galaxy II, when I uploaded it to YouTube I found that it turned to 90 degrees like Portrait layout 1080×1920 NOT 1920×1080.
I found the cause of the problem:

YouTube is reading video metadata and rotate video acording Exif
orientation before encoding

This is ExifTool report (please see last tag “Rotation”):

ExifTool Version Number         : 8.61
File Name                       : video.mp4
Directory                       : .
File Size                       : 217 MB
File Modification Date/Time     : 2011:08:11 00:47:23+04:00
File Permissions                : rw-rw-rw-
File Type                       : 3GP
MIME Type                       : video/3gpp
Major Brand                     : 3GPP Media (.3GP) Release 4
Minor Version                   : 0.3.0
Compatible Brands               : 3gp4, 3gp6
Movie Data Size                 : 227471371
Movie Header Version            : 0
Create Date                     : 1900:01:00 00:00:00
Modify Date                     : 1900:01:00 00:00:00
Time Scale                      : 1000
Duration                        : 0:01:46
Preferred Rate                  : 1
Preferred Volume                : 100.00%
Preview Time                    : 0 s
Preview Duration                : 0 s
Poster Time                     : 0 s
Selection Time                  : 0 s
Selection Duration              : 0 s
Current Time                    : 0 s
Next Track ID                   : 3
Track Header Version            : 0
Track Create Date               : 1900:01:00 00:00:00
Track Modify Date               : 1900:01:00 00:00:00
Track ID                        : 1
Track Duration                  : 0:01:46
Track Layer                     : 0
Track Volume                    : 0.00%
Image Width                     : 1920
Image Height                    : 1080
Graphics Mode                   : srcCopy
Op Color                        : 0 0 0
Compressor ID                   : avc1
Source Image Width              : 1920
Source Image Height             : 1080
X Resolution                    : 72
Y Resolution                    : 72
Bit Depth                       : 24
Video Frame Rate                : 30.023
Matrix Structure                : 1 0 0 0 1 0 0 0 1
Media Header Version            : 0
Media Create Date               : 1900:01:00 00:00:00
Media Modify Date               : 1900:01:00 00:00:00
Media Time Scale                : 16000
Media Duration                  : 0:01:46
Handler Type                    : Audio Track
Handler Description             : SoundHandler
Balance                         : 0
Audio Format                    : mp4a
Audio Channels                  : 1
Audio Bits Per Sample           : 16
Audio Sample Rate               : 16000
Play Mode                       : SEQ_PLAY
Avg Bitrate                     : 17.1 Mbps
Image Size                      : 1920x1080
Rotation                        : 90

How do I remove whole Exif data or just edit Rotation property?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:50:17+00:00Added an answer on May 26, 2026 at 8:50 pm

    Mp4 files (and many others) use the MPEG-4 standard, which arranges the data inside it in little boxes called atoms. You can find a great description of atoms in this Page. In short, atoms are organized in a tree like structure, where an atom can be either the parent of other atoms or a container of data, but not both (although some people break this rule)

    In particular the atom you are looking for is called “tkhd” (Track Header). You can find a list of atoms here.

    Within this atom you will find metadata of the video. The structure of the “tkhd” atom is specified here

    Finally the chunk of metadata you need (which is not an atom), is called “Matrix Structure”. From developer.apple.com:

    All values in the matrix are 32-bit fixed-point numbers divided as
    16.16, except for the {u, v, w} column, which contains 32-bit fixed-point numbers divided as 2.30.

    This is shown in the following image:

    "Matrix Structure" a transformation matrix

    The 9 byte matrix starts in byte 48 of the “tkhd” atom. An example of a “matrix structure” for an orientation of 0° would be 1 0 0 0 1 0 0 0 1 (the identity matrix)

    SO!

    After all that, what you need is to modify this matrix. The next parragraph is taken from developer.apple.com:

    A transformation matrix defines how to map points from one coordinate
    space into another coordinate space. By modifying the contents of a
    transformation matrix, you can perform several standard graphics
    display operations, including translation, rotation, and scaling. The
    matrix used to accomplish two-dimensional transformations is described
    mathematically by a 3-by-3 matrix.

    This means that the transformation matrix defines a function, that maps each coordinate into a new one.

    Since you only need to rotate the image, simply modify the left most 2 x 3 matrix, which is defined by the bytes 0, 1, 3, 4, 6 and 7.

    Here are the 2 x 3 matrices I use to represent each orientation (values 0, 1, 3, 4, 6 and 7 of the 3×3 matrix):

    0°: (x’, y’) = (x, y)
    1 0
    0 1
    0 0

    90°: (x’, y’) = (height – y, x)
    0 1
    -1 0
    height 0

    180°: (x’, y’) = (widht – x, height – y)
    -1 0
    0 -1
    width height

    270°: (x’, y’) = (y, width – x)
    0 -1
    1 0
    0 width

    If you don’t have them, the width and height can be obtained just after the matrix structure. They are also fixed point numbers of 4 bytes (16.16).

    It is quite probable your video metadata contains the 90° Matrix

    (Thanks to Phil Harvey, creator of Exiftool for his help and a wonderful software)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the following recorded plot, I cannot find the instruction that constructs the layout
I recorded a video and copied it to the path NSURL *videoPath =[NSURL URLWithString:[NSString
How to post a recorded video into Facebook wall with message and please tell
Can you save recorded video to isolated storage on Windows Phone 7? And if
I have app in which i have recorded sound files i want that i
I want to play a video file recorded to be played in the mediaplayer
I recorded some audio files that must be played from java. I did it
In my application I recorded a video and then playing. For recording a video
I've recorded my track to a text file and now I'd like to insert
I have recorded live video from the camera using AVCaptureVideoDataOuput and AVAssetWriter but the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.