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

Export project - Duration #2040

Closed reinierrr closed 1 week ago

reinierrr commented 2 weeks 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

Operating System

MacOS 12

Steps to reproduce

I'm trying to 'Export project' with timestamps + duration, trying to find it under File > Export Project.

Expected behavior

I'm expecting to be able to export timestamps and duration for each segment visible in the segments sidebar.

Actual behavior

I only succeed in exporting the segments Start time and End time timestamps by choosing File > Export Project > Timestamps.

Share log from developer tools

No response

mifi commented 1 week ago

Are you saying that you want "start time" & "duration" of each segment in the exported file (instead of segment "start time", "end time")? what do you need this for ?

reinierrr commented 1 week ago

Correct, looking back at my report I see now that that was unclear. My apologies.

I'm not able to export segments where the first frame of the exported video corresponds with what I'm seeing when I play the segment in the LosslessCut GUI. After reading up on "Keyframe cut mode" I learned that it's not possible to achieve this. When exporting with "Keyframe cut mode" the exported clip starts too early, when exporting with "Keyframe cut mode" disabled it starts with a few black frames.

After reading up I understand why this is the case (and therefor unavoidable). Am I correct or misunderstanding?

When I manually export the clip through terminal using ffmpeg while I use Start time (HH:MM:SS.MS) for -ss and Duration (HH:MM:SS.MS) for -t I get exactly the segment as I see in the LossletCut GUI.

So this is what I would need it for: to be able to export those values, write a Bash script which would loop through the exported values to export all these segments starting with the correct first frame...

mifi commented 1 week ago

When I manually export the clip through terminal using ffmpeg while I use Start time (HH:MM:SS.MS) for -ss and Duration (HH:MM:SS.MS) for -t I get exactly the segment as I see in the LossletCut GUI.

so you're trying to do a lossy cut (re-encode) manually using ffmpeg in order to get accurate cut times?

I think if you're writing a bash script, you can in that bash script just calculate duration. according to the math formula:

duration = "segment end time" - "segment start time"

or am i missing something?

reinierrr commented 1 week ago

You are right, thanks for your reply and proposed solution