VideoHelp Forum




+ Reply to Thread
Results 1 to 14 of 14
  1. Hello all,

    I'm looking for a way to rotate some of my videos without re-encoding. I know there are a few threads here on this subject but none has answered my needs.

    I'm looking to change one of the metadata which might work with DaVinci Resolve.
    Exiftool does work - but it creates a copy by design so it's slow when dealing with files of many GB each. Yes, I can ask exiftool to overwrite the original file but it would still need to create a temp file.

    ffmpeg doesn't seem to be working.

    I was hoping for something which would easily change the rotation "flag" without re-encoding and without copying the file.

    Any ideas? Someone was telling me there were able to do that via the "preview" app of a macOS.

    Thanks!
    Quote Quote  
  2. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Avidemux can do it. In some cases, it doesn't recognize that the video is vertical
    and displays it as horizontal in the window. In this case set "output format" to mp4 and save it as a new video.

    Otherwise, "output format" mp4/configure/rotate
    Quote Quote  
  3. Originally Posted by tony359 View Post
    ffmpeg doesn't seem to be working.

    I was hoping for something which would easily change the rotation "flag" without re-encoding and without copying the file.
    On-the-fly rotation (45 degrees for example):
    Code:
    ffplay -i "your_source" -vf rotate='45*PI/180:ow=hypot(iw,ih):oh=ow'
    Why would you want to change the flag? Is it wrong?
    Last edited by Sharc; 2nd Jan 2025 at 04:38.
    Quote Quote  
  4. Why would you want to change the flag? Is it wrong?
    So...

    My footage is all rotated because of how my Sony camera is set. I cannot change that unfortunately.

    In Resolve I can easily batch rotate everything of course.

    HOWEVER, when I generate proxies, Resolve does NOT take the rotation flag into account. So when I rotate assets, the asset shows correctly but the Proxy keeps the original rotation - making proxies unusable.

    I contacted Black Magic Design and as usual they told me it's "by design" which is their standard answer when they acknowledge something but they are not allowed to say it.

    So I am hoping that maybe rotating the clips beforehand might be taken into account by the proxy generator as well.

    PS: This affects the standalone proxy generator - the internal generator DOES take the flag into account but does not run in the background. Also, if you rotate a clip AFTER the proxy was made, Resolve does not take that into account so a new proxy needs to be generated.

    Thanks all, I'll test all the suggestions and report back!

    update
    Avidemux doesn't seem to like the sound track - it's PCM

    LosslessCut does work - with Resolve as well! (though it's also complaining about the sound track) But LosslessCut uses ffmpeg, so there must be a way to use ffmpeg directly as well!
    I'll explore LosslessCut though, thanks for now!
    Image Attached Thumbnails Click image for larger version

Name:	avimux.JPG
Views:	10
Size:	16.8 KB
ID:	84526  

    Last edited by tony359; 2nd Jan 2025 at 06:06.
    Quote Quote  
  5. Right, I have tested Lossless cut and I think I've hit a stop.

    Unfortunately, if I understand right, the software cannot batch export "by design". I can batch load but not batch export.
    If I load a single video file and change the rotation, it works 100%.

    Now, Losslesscut is using ffmpeg so I selected "last ffmpeg commands" from the menu and discovered that the full ffmpeg command used was like this:

    Code:
    ffmpeg -hide_banner -i "G:\Losslesscut test delete\Videos\2024-09-11 18-01-58 EFFV 3840X2160 29.97fps E10.MP4" -map 0:0 -c:0 copy -map 0:1 -c:1 copy -map_metadata 0 -movflags +faststart -default_mode infer_no_subs -ignore_unknown -metadata:s:v:0 rotate=180 -f mov -y "G:\Losslesscut test delete\Videos\2024-09-11 18-01-58 EFFV 3840X2160 29.97fps E10.mov"
    So I ran it manually on command prompt, I got the below

    Code:
    G:\Losslesscut test delete\Videos>ffmpeg -hide_banner -i "G:\Losslesscut test delete\Videos\2024-09-11 18-01-58 EFFV 3840X2160 29.97fps E10.MP4" -map 0:0 -c:0 copy -map 0:1 -c:1 copy -map_metadata 0 -movflags +faststart -default_mode infer_no_subs -ignore_unknown -metadata:s:v:0 rotate=180 -f mov -y "G:\Losslesscut test delete\Videos\2024-09-11 18-01-58 EFFV 3840X2160 29.97fps E10.mov"
    [mov,mp4,m4a,3gp,3g2,mj2 @ 000002842ecb7e80] st: 0 edit list: 1 Missing key frame while searching for timestamp: 1001
    [mov,mp4,m4a,3gp,3g2,mj2 @ 000002842ecb7e80] st: 0 edit list 1 Cannot find an index entry before timestamp: 1001.
    [aist#0:1/pcm_s16be @ 000002842f69ecc0] Guessed Channel Layout: stereo
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'G:\Losslesscut test delete\Videos\2024-09-11 18-01-58 EFFV 3840X2160 29.97fps E10.MP4':
      Metadata:
        major_brand     : XAVC
        minor_version   : 16785407
        compatible_brands: XAVCmp42iso2
        creation_time   : 2024-09-11T18:01:58.000000Z
      Duration: 00:08:30.51, start: 0.000000, bitrate: 59091 kb/s
      Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709/bt709/iec61966-2-4, progressive), 3840x2160 [SAR 1:1 DAR 16:9], 56297 kb/s, 29.97 fps, 29.97 tbr, 30k tbn (default)
          Metadata:
            creation_time   : 2024-09-11T18:01:58.000000Z
            handler_name    : Video Media Handler
            vendor_id       : [0][0][0][0]
            encoder         : AVC Coding
      Stream #0:1[0x2](und): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, stereo, s16, 1536 kb/s (default)
          Metadata:
            creation_time   : 2024-09-11T18:01:58.000000Z
            handler_name    : Sound Media Handler
            vendor_id       : [0][0][0][0]
      Stream #0:2[0x3](und): Data: none (rtmd / 0x646D7472), 1227 kb/s (default)
          Metadata:
            creation_time   : 2024-09-11T18:01:58.000000Z
            handler_name    : Timed Metadata Media Handler
            timecode        : 14:31:48:28
    Stream mapping:
      Stream #0:0 -> #0:0 (copy)
      Stream #0:1 -> #0:1 (copy)
    Output #0, mov, to 'G:\Losslesscut test delete\Videos\2024-09-11 18-01-58 EFFV 3840X2160 29.97fps E10.mov':
      Metadata:
        major_brand     : XAVC
        minor_version   : 16785407
        compatible_brands: XAVCmp42iso2
        creation_time   : 2024-09-11T18:01:58.000000Z
        encoder         : Lavf61.7.100
      Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709/bt709/iec61966-2-4, progressive), 3840x2160 [SAR 1:1 DAR 16:9], q=2-31, 56297 kb/s, 29.97 fps, 29.97 tbr, 30k tbn (default)
          Metadata:
            creation_time   : 2024-09-11T18:01:58.000000Z
            handler_name    : Video Media Handler
            vendor_id       : [0][0][0][0]
            encoder         : AVC Coding
            rotate          : 180
      Stream #0:1(und): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, stereo, s16, 1536 kb/s (default)
          Metadata:
            creation_time   : 2024-09-11T18:01:58.000000Z
            handler_name    : Sound Media Handler
            vendor_id       : [0][0][0][0]
    Press [q] to stop, [?] for help
    [mov @ 000002842f477380] Starting second pass: moving the moov atom to the beginning of the file
    [out#0/mov @ 000002842f477280] video:3508364KiB audio:95721KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.011651%
    frame=15300 fps=960 q=-1.0 Lsize= 3604504KiB time=00:08:30.47 bitrate=57844.2kbits/s speed=  32x
    
    G:\Losslesscut test delete\Videos>
    However the file does not look rotated when opened via VLC.

    What am I missing here? I tested the rotated file in Resolve and it works - so I am getting close! But I need a batch process unfortunately. I'd be happy to create my own command prompt batch file but first I need to find out what the command is!

    Ah, ffmpeg still seems to not like the sound track of my Sony E10 files - I have to export in MOV for that reason?

    Thanks!
    Quote Quote  
  6. Member Bernix's Avatar
    Join Date
    Apr 2016
    Location
    Europe
    Search Comp PM
    VLC got in tools in geometry rotate function, when you save it it will play all files rotated. But yes not what you want.
    Quote Quote  
  7. Indeed - I need the file to be flagged as rotated so that Resolve can read that.

    I mentioned VLC just to say that using the app VLC also shows the file rotate but using the command line it does not.
    Quote Quote  
  8. Originally Posted by tony359 View Post
    I was hoping for something which would easily change the rotation "flag" without re-encoding and without copying the file.
    You can use clever FFmpeg-GUI.
    Load your video, click main page, click various, click rotate.
    Set the degrees, click rotate. Done.
    (The file is copied, there is no way around it).

    Works with mp4 and mov.
    It changes the metadata only, so it's fast and there is no quality loss.
    Be aware, not all player can handle this.
    Quote Quote  
  9. Thanks! Unfortunately Resolve is one of those "players" - the file does not appear rotated using Clever ffmpeg-GUI.

    There is something Losslesscut does which works for me. But I cannot find what.
    Quote Quote  
  10. have you tried contacting the developer of Losslesscut:
    losslesscut issues

    Originally Posted by tony359 View Post
    Thanks! Unfortunately Resolve is one of those "players" - the file does not appear rotated using Clever ffmpeg-GUI.

    There is something Losslesscut does which works for me. But I cannot find what.
    Quote Quote  
  11. Yes, my question is already under ‘discussions’ thanks 🙂
    Quote Quote  
  12. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    ”Exiftool does work - but it creates a copy by design so it's slow when dealing with files of many GB each.“

    I have used it to rotate some videos. If you use a fast ssd maybe still way to go.
    Quote Quote  
  13. the SSD is fast but I'm rotating videos for my youtube channel - hence I keep making clips and they tend to be big. I was hoping to find a faster way. After all this is to allow Resolve to generate Proxies but I can work without them.

    If I don't find an alternative, by all means I'll consider exiftool.
    Quote Quote  



Similar Threads

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