mifi / lossless-cut

The swiss army knife of lossless video/audio editing
https://losslesscut.app/
GNU General Public License v2.0
26.1k stars 1.26k forks source link

Exports full video, not cutting the range #1436

Closed tedyoung closed 1 year ago

tedyoung commented 1 year ago

I have a lot of issues to go through, so in order to make it easier for me to help you, I ask that you please try these things first

Operating System

MacOS 12

Steps to reproduce

I'm baffled as to why LosslessCut stopped working for me. I've used it for a long time, but recently it stopped cutting and exports the full range of the video. It's happening on every video I've tried it on (all MP4/h.264/avc1). For example, it says it's going to export a subset of the video (say 00:03:49.726 - 02:23:37.235), but the export is the entire file. The ffmetadata file that it outputs says:

[CHAPTER]
TIMEBASE=1/1000
START=0
END=229725
title=

[CHAPTER]
TIMEBASE=1/1000
START=229725
END=8617234
title=

Used by the command:

ffmpeg -hide_banner -i '/Volumes/VidArkAlt/Stream Raw Recordings - 2021/2021-05-01 15-04-17 - MobReg Episode 5.mp4' -f ffmetadata -i '/Volumes/VidArkAlt/Stream Raw Recordings - 2021/ffmetadata-1674778901481.txt' -map '0:0' '-c:0' copy -map '0:1' '-c:1' copy -map_metadata 0 -map_chapters 1 -movflags '+faststart' -default_mode infer_no_subs -ignore_unknown -f mp4 -y '/Volumes/VidArkAlt/Stream Raw Recordings - 2021/2021-05-01 15-04-17 - MobReg Episode 5-00.00.00.000-02.25.44.682.mp4'

But I don't understand how that's used. It seems to be the right start/end point (in the second CHAPTER), but I don't understand how that's used by ffmpeg.

If I manually use ffmpeg using the command below, it works fine, so I'm just stumped as to why LosslessCut is not working.

ffmpeg -i `2021-05-01 15-04-17 - MobReg Episode 5.mp4` -ss 00:03:49 -to 02:23:37 -c:v copy -c:a copy `2021-05-01 15-04-17 - MobReg Episode 5 cut.mp4`

Expected behavior

Expected it to cut the video as specified.

Actual behavior

Exports the entire video. It even names it with the suffix 00.00.00.000-02.25.44.682, which is the entire video, instead of the specified cut segment.

Share log

No error occurred.

{ "state": { "filePath": "/Volumes/VidArkAlt/Stream Raw Recordings - 2021/2021-05-01 15-04-17 - MobReg Episode 5.mp4", "fileFormat": "mp4", "externalFilesMeta": {}, "mainStreams": [ { "index": 0, "codec_name": "h264", "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", "profile": "Main", "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": 1, "sample_aspect_ratio": "1:1", "display_aspect_ratio": "16:9", "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": "60/1", "avg_frame_rate": "262340500/4372341", "time_base": "1/90000", "start_pts": 0, "start_time": "0.000000", "duration_ts": 787021380, "duration": "8744.682000", "bit_rate": "4439531", "bits_per_raw_sample": "8", "nb_frames": "524681", "extradata_size": 43, "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": { "language": "und", "handler_name": "VideoHandler", "vendor_id": "[0][0][0][0]" } }, { "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": "48000", "channels": 2, "channel_layout": "stereo", "bits_per_sample": 0, "id": "0x2", "r_frame_rate": "0/0", "avg_frame_rate": "0/0", "time_base": "1/48000", "start_pts": 1584, "start_time": "0.033000", "duration_ts": 419742720, "duration": "8744.640000", "bit_rate": "159999", "nb_frames": "409905", "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": { "language": "und", "handler_name": "SoundHandler", "vendor_id": "[0][0][0][0]" } } ], "copyStreamIdsByFile": { "/Volumes/VidArkAlt/Stream Raw Recordings - 2021/2021-05-01 15-04-17 - MobReg Episode 5.mp4": { "0": true, "1": true } }, "cutSegments": [ { "start": 229.725992, "end": 8617.234564 } ], "mainFileFormatData": { "filename": "/Volumes/VidArkAlt/Stream Raw Recordings - 2021/2021-05-01 15-04-17 - MobReg Episode 5.mp4", "nb_streams": 2, "nb_programs": 0, "format_name": "mov,mp4,m4a,3gp,3g2,mj2", "format_long_name": "QuickTime / MOV", "start_time": "0.000000", "duration": "8744.682000", "size": "5049896738", "bit_rate": "4619856", "probe_score": 100, "tags": { "major_brand": "isom", "minor_version": "512", "compatible_brands": "isomiso2avc1mp41", "encoder": "Lavf58.29.100" } }, "rotation": 360, "shortestFlag": false, "effectiveExportMode": "sesgments_to_chapters", "outSegTemplate": "${FILENAME}-${CUT_FROM}-${CUT_TO}${SEG_SUFFIX}${EXT}" }, "platform": "darwin", "version": "3.49.0" }

mifi commented 1 year ago

Hi. This is because you are using the "chapters" export mode. please change it to Separate files

Screenshot 2023-01-27 at 10 50 31
tedyoung commented 1 year ago

That was it, thanks! Not sure how that setting got changed.