jonataslaw / jonataslaw/VideoCompress
Unable to get the picture at the specified time
- Dominant language
- Swift
- Stars
- 262
- Forks
- 344
- PR merge metrics
- No merged PRs in 30d
Description
//10s 1
List temp = [];
for (int i = 0; i < duration; i = i + 10) {
final thumbnailFile = await VideoCompress.getFileThumbnail(
path,
quality: 100,
position: i
);
await Future.delayed(Duration(seconds: 1));
temp.add(thumbnailFile.path);
// if (0 == i) {
// firstImages.value = temp.first;
// firstImages.refresh();
// }
print("$i = ${thumbnailFile.path}");
}
Temporary repair method
private func getFileThumbnail(_ path: String,_ quality: NSNumber,_ position: NSNumber,_ result: FlutterResult) {
let fileName = Utility.getFileName(path)
//change
let url = Utility.getPathUrl("\(Utility.basePath())/\(fileName)_\(position).jpg")
Utility.deleteFile(path)
if let bitmap = getBitMap(path,quality,position,result) {
guard (try? bitmap.write(to: url)) != nil else {
return result(FlutterError(code: channelName,message: "getFileThumbnail error",details: "getFileThumbnail error"))
}
result(Utility.excludeFileProtocol(url.absoluteString))
}
}
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the Dart call to VideoCompress.getFileThumbnail and the Swift getFileThumbnail method shown in the issue. Reproduce requests at different positions and compare the returned image with the specified time; done means thumbnails are retrieved for the requested positions without relying on the temporary repair.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, swift
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100