VideoHelp Forum




+ Reply to Thread
Results 1 to 11 of 11
  1. What is the easiest way to edit orientation information in a video container? Name of any app.
    My phone videos randomly rotate 90 degrees. I want to remove this information so that the rotation is 0 degrees. This is an edit, and it is possible to edit some other information in the container, I would like to do it without creating a new container. If this is possible.
    Quote Quote  
  2. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    What is the existing container and what codecs are used by the video/audio?
    Quote Quote  
  3. I use MP4 and AVC/AAC.
    Quote Quote  
  4. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Avidemux, also Prowo's Clever FFMpeg GUI
    Quote Quote  
  5. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    If your videos are rotating on playback there's nothing you can do to fix that,to prevent your phone from rotating shot off auto-rotate in the menu you pull down
    I think,therefore i am a hamster.
    Quote Quote  
  6. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Try AVIDemux using this technique. As I note there, not guaranteed to work.
    Quote Quote  
  7. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    This only changes the metadata field. (can be: 90, 180, 270) Some players may not honor the changed metadata, and play the video in it's original display format.
    Code:
    ffmpeg.exe -display_rotation 180 -i "input.mp4" -c copy "output.mp4"
    You may have to re-encode in that case.
    Code:
    ffmpeg.exe -i "input.mp4" -vf "transpose=0" "output.mp4"
    transpose;
    0 = 90° counter-clockwise and vertical flip (default)
    1 = 90° clockwise
    2 = 90° counter-clockwise
    3 = 90° clockwise and vertical flip


    The quality may change. better/worse?
    This means also, maybe, using a codec.
    Code:
    ffmpeg.exe -i "input.mp4" -vf "transpose=0" -c:v libx264 -crf 22  "output.mp4"
    Note: Subtitle will NOT rotate with the video.
    Some testing will put you on the right path.
    Cheers.
    Quote Quote  
  8. @gelo333
    try:
    Lossless Cut
    Lossless rotate, will keep the container as is.
    Quote Quote  
  9. You can always rotate and reencode. Try something like this:
    Code:
    ffmpeg -i "your source" -vf "rotate='90*PI/180:ow=hypot(iw,ih):oh=ow:fillcolor=yellow',scale=w=-2:h=1080" -c:a copy -c:v libx264 -crf 20 "rotated.mp4"
    Then crop the yellow canvas as needed. You may add the cropping/resizing to the commandline as well.

    It rotates to any angle, just for demo or fun, try
    Code:
    ffmpeg -i "your source" -vf "rotate='0.5*PI*t:ow=hypot(iw,ih):oh=ow:fillcolor=yellow',scale=w=-2:h=1080,setsar=sar=1/1" -c:a copy -c:v libx264 -crf 20 "rotated.mp4"
    You see why there is a yellow (or whatever color) canvas.
    Last edited by Sharc; 13th Jan 2025 at 03:29.
    Quote Quote  
  10. I'd like to clarify a few things. The original video in the container has a 90 degree rotation tag. In other words, the resolution does not need to be changed.
    I can rotate a video in LosslessCut without encoding. But this creates a new container and overwrites several data in the container. I want to change only the rotation data without changing the other data.
    Quote Quote  
  11. Use clever FFmpeg-GUI.
    Load your mp4, click main page, click various, click rotate.
    Set the degrees, click rotate. Done.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!