Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
FelipeMurguia committed Nov 5, 2021
2 parents 370e306 + 294b230 commit 68556e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ class _VideoEditorState extends State<VideoEditor> {
bool _firstStat = true;
//NOTE: To use [-crf 17] and [VideoExportPreset] you need ["min-gpl-lts"] package
await _controller.exportVideo(
name: DateTime.now().millisecondsSinceEpoch.toString(),
// preset: VideoExportPreset.medium,
// customInstruction: "-crf 17",
onProgress: (statics) {
Expand Down
7 changes: 5 additions & 2 deletions lib/domain/bloc/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,8 @@ class VideoEditorController extends ChangeNotifier {
final String tempPath = outDir ?? (await getTemporaryDirectory()).path;
final String videoPath = file.path;
if (name == null) name = path.basenameWithoutExtension(videoPath);
final String outputPath = "$tempPath/$name.$format";
final int epoch = DateTime.now().millisecondsSinceEpoch;
final String outputPath = "$tempPath/${name}_$epoch.$format";

//-----------------//
//CALCULATE FILTERS//
Expand Down Expand Up @@ -484,6 +485,7 @@ class VideoEditorController extends ChangeNotifier {
Future<String?> _generateCoverFile({int quality = 100}) async {
return await VideoThumbnail.thumbnailFile(
imageFormat: ImageFormat.JPEG,
thumbnailPath: (await getTemporaryDirectory()).path,
video: file.path,
timeMs: selectedCoverVal?.timeMs ?? startTrim.inMilliseconds,
quality: quality,
Expand Down Expand Up @@ -521,7 +523,8 @@ class VideoEditorController extends ChangeNotifier {
return null;
}
if (name == null) name = path.basenameWithoutExtension(file.path);
final String outputPath = "$tempPath/$name.$format";
final int epoch = DateTime.now().millisecondsSinceEpoch;
final String outputPath = "$tempPath/${name}_$epoch.$format";

//-----------------//
//CALCULATE FILTERS//
Expand Down

0 comments on commit 68556e3

Please sign in to comment.