jonataslaw / jonataslaw/VideoCompress
`getFileThumbnail` Overwrites Thumbnails with Same Filename When Extracting Multiple Frames
- Dominant language
- Swift
- Stars
- 262
- Forks
- 344
- PR merge metrics
- No merged PRs in 30d
Description
```
Future> getTwoFrame(String videoPath) async {
final MediaInfo info = await VideoCompress.getMediaInfo(videoPath);
var duration = info.duration;
if (duration == null) {
throw StateError("no duration detected");
}
var f1 = await VideoCompress.getFileThumbnail(videoPath, position: -1);
var f2 = await VideoCompress.getFileThumbnail(videoPath,
position: (duration / 2).toInt());
assert(f1.path != f2.path);
return [f1, f2];
}
```
the assert here will always be false. you can't extract multiple thumbnails from a video using `getFileThumbnail` because they will overwrite themselves.
`getFileThumbnail` should generate files with a unique file name to avoid this issue
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.