chore: support startTime and duration value in milliseconds#306
Open
yujune wants to merge 1 commit intojonataslaw:masterfrom
Open
chore: support startTime and duration value in milliseconds#306yujune wants to merge 1 commit intojonataslaw:masterfrom
yujune wants to merge 1 commit intojonataslaw:masterfrom
Conversation
ekuleshov
reviewed
Apr 23, 2025
| val startTime = call.argument<Int>("startTime") | ||
| val duration = call.argument<Int>("duration") | ||
| val startTime = call.argument<Double>("startTime") | ||
| val duration = call.argument<Double>("duration") |
Author
There was a problem hiding this comment.
The current startTime and duration values are in seconds. The use of the double type allows for fractional seconds (e.g., 1.5s).
E.g.
final mediaInfo = await VideoCompress.compressVideo(
...
startTime: 1.5,
duration: 5.5,
);There was a problem hiding this comment.
The problem is that double value is not precise. You are doing decimal math on non decimal double values.
It would be more precise either pass value in milliseconds, or use a string format like ffmpeg is using or something like "01:02.500"
Author
There was a problem hiding this comment.
Thanks for the suggestion, I have changed it to milliseconds.
ekuleshov
reviewed
Apr 23, 2025
| int? startTime, | ||
| int? duration, | ||
| double? startTime, | ||
| double? duration, |
There was a problem hiding this comment.
The Dart's int is already 64-bit on all platforms (except web). No need to change it to a floating-point double type
e79a687 to
371fee1
Compare
371fee1 to
74d5c70
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
The current
startTimeanddurationvalues support seconds only; using milliseconds would provide greater precision for trimming.