Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(server): video duration extraction #11610

Merged
merged 1 commit into from
Aug 6, 2024
Merged

Conversation

michelheusschen
Copy link
Contributor

Extracting the video duration based on EXIF data has proven to be unreliable. Exiftool has 7 different ways for calculating the Duration value, and if any of those are missing or invalid the duration will also be wrong. Using ffprobe is a more reliable solution to determine the video duration.

Using an MKV test file the duration is now correctly extracted as 00:01:27.336, whereas it was previously 24:15:36.000. This should fix #7312 and fix #8244, though I can't verify that myself

} else if (typeof seconds === 'string') {
_seconds = Duration.fromISOTime(seconds).as('seconds');
if (videoStreams[0]) {
switch (videoStreams[0].rotation) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocking since this is existing code, but only checking the first stream isn't reliable. The media service uses the stream with the highest frame count, which may or may not be the first stream.

@alextran1502 alextran1502 merged commit 325fb4b into main Aug 6, 2024
21 of 22 checks passed
@alextran1502 alextran1502 deleted the fix/server-video-duration branch August 6, 2024 16:27
@mio-19
Copy link
Contributor

mio-19 commented Aug 8, 2024

How do I apply this to existing videos?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Video length is always incorrect Video duration is 0:00
5 participants