mifi / lossless-cut

The swiss army knife of lossless video/audio editing
GNU General Public License v2.0
24.01k stars 1.19k forks source link

Exported video rotates regardless of output settings #2020

Open farcast3r opened 1 month ago

farcast3r commented 1 month ago

The fewer issues I have to read, the more new features I will have time to implement, so I ask that you please try these things first

Steps to reproduce

I have been trying to trim a few videos that I took on my iPhone but they seem to be behaving different than files I've downloaded online - attempting to export these files results in the output file being rotated. Example file attached

All files are between 60MB and 323MB so I cannot attach to this form - I have tried exporting with various formats

image

Expected behavior

Exported video should retain the same rotation as the original video

Actual behavior

Video exports with trim applied but also rotated 270 degrees

Provide an error report

No error occurred.

{ "err": false, "state": { "ffmpegExperimental": false, "preserveMovData": false, "movFastStart": true, "preserveMetadataOnMerge": false, "filePath": "C:\Users\Jake\Downloads\ss\IMG_0110 TRIMDOWN.MOV", "fileFormat": "mov", "externalFilesMeta": {}, "mainStreams": [ { "index": 0, "codec_name": "h264", "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", "profile": "High", "codec_type": "video", "codec_tag_string": "avc1", "codec_tag": "0x31637661", "width": 1920, "height": 1080, "coded_width": 1920, "coded_height": 1080, "closed_captions": 0, "film_grain": 0, "has_b_frames": 0, "pix_fmt": "yuv420p", "level": 42, "color_range": "tv", "color_space": "bt709", "color_transfer": "bt709", "color_primaries": "bt709", "chroma_location": "left", "field_order": "progressive", "refs": 1, "is_avc": "true", "nal_length_size": "4", "id": "0x1", "r_frame_rate": "60000/1001", "avg_frame_rate": "209900/3501", "time_base": "1/600", "start_pts": 0, "start_time": "0.000000", "duration_ts": 84024, "duration": "140.040000", "bit_rate": "23299403", "bits_per_raw_sample": "8", "nb_frames": "8396", "extradata_size": 158, "disposition": { "default": 1, "dub": 0, "original": 0, "comment": 0, "lyrics": 0, "karaoke": 0, "forced": 0, "hearing_impaired": 0, "visual_impaired": 0, "clean_effects": 0, "attached_pic": 0, "timed_thumbnails": 0, "captions": 0, "descriptions": 0, "metadata": 0, "dependent": 0, "still_image": 0 }, "tags": { "creation_time": "2024-05-18T18:36:54.000000Z", "language": "und", "handler_name": "Core Media Video", "vendor_id": "[0][0][0][0]", "encoder": "H.264" }, "side_data_list": [ { "side_data_type": "Display Matrix", "displaymatrix": "\n00000000: 0 65536 0\n00000001: -65536 0 0\n00000002: 70778880 0 1073741824\n", "rotation": -90 } ] }, { "index": 1, "codec_name": "aac", "codec_long_name": "AAC (Advanced Audio Coding)", "profile": "LC", "codec_type": "audio", "codec_tag_string": "mp4a", "codec_tag": "0x6134706d", "sample_fmt": "fltp", "sample_rate": "44100", "channels": 2, "channel_layout": "stereo", "bits_per_sample": 0, "initial_padding": 0, "id": "0x2", "r_frame_rate": "0/0", "avg_frame_rate": "0/0", "time_base": "1/44100", "start_pts": 0, "start_time": "0.000000", "duration_ts": 6175691, "duration": "140.038345", "bit_rate": "165277", "nb_frames": "6034", "extradata_size": 2, "disposition": { "default": 1, "dub": 0, "original": 0, "comment": 0, "lyrics": 0, "karaoke": 0, "forced": 0, "hearing_impaired": 0, "visual_impaired": 0, "clean_effects": 0, "attached_pic": 0, "timed_thumbnails": 0, "captions": 0, "descriptions": 0, "metadata": 0, "dependent": 0, "still_image": 0 }, "tags": { "creation_time": "2024-05-18T18:36:54.000000Z", "language": "und", "handler_name": "Core Media Audio", "vendor_id": "[0][0][0][0]" } }, { "index": 2, "codec_type": "data", "codec_tag_string": "mebx", "codec_tag": "0x7862656d", "id": "0x3", "r_frame_rate": "0/0", "avg_frame_rate": "0/0", "time_base": "1/600", "start_pts": 0, "start_time": "0.000000", "duration_ts": 84024, "duration": "140.040000", "nb_frames": "1", "disposition": { "default": 1, "dub": 0, "original": 0, "comment": 0, "lyrics": 0, "karaoke": 0, "forced": 0, "hearing_impaired": 0, "visual_impaired": 0, "clean_effects": 0, "attached_pic": 0, "timed_thumbnails": 0, "captions": 0, "descriptions": 0, "metadata": 0, "dependent": 0, "still_image": 0 }, "tags": { "creation_time": "2024-05-18T18:36:54.000000Z", "language": "und", "handler_name": "Core Media Metadata" } }, { "index": 3, "codec_type": "data", "codec_tag_string": "mebx", "codec_tag": "0x7862656d", "id": "0x4", "r_frame_rate": "0/0", "avg_frame_rate": "0/0", "time_base": "1/600", "start_pts": 0, "start_time": "0.000000", "duration_ts": 84024, "duration": "140.040000", "nb_frames": "1", "disposition": { "default": 1, "dub": 0, "original": 0, "comment": 0, "lyrics": 0, "karaoke": 0, "forced": 0, "hearing_impaired": 0, "visual_impaired": 0, "clean_effects": 0, "attached_pic": 0, "timed_thumbnails": 0, "captions": 0, "descriptions": 0, "metadata": 0, "dependent": 0, "still_image": 0 }, "tags": { "creation_time": "2024-05-18T18:36:54.000000Z", "language": "und", "handler_name": "Core Media Metadata" } }, { "index": 4, "codec_type": "data", "codec_tag_string": "mebx", "codec_tag": "0x7862656d", "id": "0x5", "r_frame_rate": "0/0", "avg_frame_rate": "0/0", "time_base": "1/600", "start_pts": 0, "start_time": "0.000000", "duration_ts": 84024, "duration": "140.040000", "bit_rate": "82991", "nb_frames": "8396", "disposition": { "default": 1, "dub": 0, "original": 0, "comment": 0, "lyrics": 0, "karaoke": 0, "forced": 0, "hearing_impaired": 0, "visual_impaired": 0, "clean_effects": 0, "attached_pic": 0, "timed_thumbnails": 0, "captions": 0, "descriptions": 0, "metadata": 0, "dependent": 0, "still_image": 0 }, "tags": { "creation_time": "2024-05-18T18:36:54.000000Z", "language": "und", "handler_name": "Core Media Metadata" } } ], "copyStreamIdsByFile": { "C:\Users\Jake\Downloads\ss\IMG_0110 TRIMDOWN.MOV": { "0": true, "1": true, "2": false, "3": false, "4": false } }, "cutSegments": [ { "start": 15.621804, "end": 39.159592 } ], "mainFileFormatData": { "filename": "C:\Users\Jake\Downloads\ss\IMG_0110 TRIMDOWN.MOV", "nb_streams": 5, "nb_programs": 0, "format_name": "mov,mp4,m4a,3gp,3g2,mj2", "format_long_name": "QuickTime / MOV", "start_time": "0.000000", "duration": "140.040000", "size": "412469169", "bit_rate": "23562934", "probe_score": 100, "tags": { "major_brand": "qt ", "minor_version": "0", "compatible_brands": "qt ", "creation_time": "2024-05-18T18:36:54.000000Z", "com.apple.quicktime.make": "Apple", "com.apple.quicktime.model": "iPhone 11 Pro", "com.apple.quicktime.software": "17.4.1", "com.apple.quicktime.creationdate": "2024-05-18T21:36:54+0300" } }, "rotation": 360, "shortestFlag": false, "effectiveExportMode": "merge", "outSegTemplate": "${FILENAME}-${CUT_FROM}-${CUT_TO}${SEG_SUFFIX}${EXT}" }, "platform": "win32", "version": "3.61.1" }

Share the file

https://drive.google.com/file/d/1W5fYIvvWpBbCmnGrnMvmS8d1hTyIGDMd/view?usp=drive_link

Share log from developer tools

image

farcast3r commented 4 weeks ago

Update: I am presuming that the issues are caused by rotation metadata embedded in the video files

I have tried to force rotation (90 degrees) in Lossless Cut before rendering, but the resulted video remains in the wrong orientation -

Also, when exporting these videos (with or without changing rotation), the beginning seems to flicker in the wrong orientation.

I'm wondering what the best approach would be here - to Handbrake the videos beforehand, or to try and remove the rotation metadata from the videos?

Any support would be greatly appreciated