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

Extracted audio track is shorter than expected unless video is played until the end before extraction #2052

Open haminhtrifree opened 1 week ago

haminhtrifree commented 1 week 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

Windows 11

Steps to reproduce

  1. Load a video file into lossless cut (file size more than 1GB is better)
  2. Click Tracks
  3. Click 3 dots next to Audio track and export it as a separate file
  4. Check the length of the exported audio track.

Expected behavior

The audio track should have the same length as the original video file.

Actual behavior

The length of the audio track is shorter than the length of the video file. This problem can be fixed if I preview the last seconds of the video. Then the exported audio file will have the same length.

Share log from developer tools

No response

mifi commented 1 week ago

how much shorter? sometimes a file can contain a video track and an audio track, and sometimes they do indeed have a different duration (e.g. the audio track ends before the video track, causing silence at the end of the video / or begining). in that case when you export the audio track to its own file, it will have the (shorter) length of the audio, because it's no longer constrained by the video's longer length.

This problem can be fixed if I preview the last seconds of the video.

Are you 100% sure about this? I don't see how that can help because seeking the preview and extracting a track to a file are two completely unrelated systems (the latter is an ffmpeg command that gets run, you can see it in the "Last ffmpeg commands" page)