-
Couldn't load subscription status.
- Fork 323
chore: support startTime and duration value in milliseconds #306
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
base: master
Are you sure you want to change the base?
Conversation
| val startTime = call.argument<Int>("startTime") | ||
| val duration = call.argument<Int>("duration") | ||
| val startTime = call.argument<Double>("startTime") | ||
| val duration = call.argument<Double>("duration") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yujune shouldn't this use Long ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion, I have changed it to milliseconds.
| int? startTime, | ||
| int? duration, | ||
| double? startTime, | ||
| double? duration, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Issue
The current
startTimeanddurationvalues support seconds only; using milliseconds would provide greater precision for trimming.