mirror of
https://github.com/ente-io/ente.git
synced 2025-08-08 07:28:26 +00:00
[mob] video editor fixes (#5091)
## Description Previously video editor was giving subpar quality videos, this fixes it and also re-encodes videos using libx264 mp4 format. This will also increase the time to process the edited video. ## Tests
This commit is contained in:
commit
d09613a946
@ -209,15 +209,14 @@ class _VideoEditorPageState extends State<VideoEditorPage> {
|
||||
|
||||
final config = VideoFFmpegVideoEditorConfig(
|
||||
_controller!,
|
||||
format: VideoExportFormat(
|
||||
path.extension(widget.ioFile.path).substring(1),
|
||||
),
|
||||
// commandBuilder: (config, videoPath, outputPath) {
|
||||
// final List<String> filters = config.getExportFilters();
|
||||
// filters.add('hflip'); // add horizontal flip
|
||||
format: VideoExportFormat.mp4,
|
||||
commandBuilder: (config, videoPath, outputPath) {
|
||||
final List<String> filters = config.getExportFilters();
|
||||
|
||||
// return '-i $videoPath ${config.filtersCmd(filters)} -preset ultrafast $outputPath';
|
||||
// },
|
||||
final String startTrimCmd = "-ss ${_controller!.startTrim}";
|
||||
final String toTrimCmd = "-t ${_controller!.trimmedDuration}";
|
||||
return '$startTrimCmd -i $videoPath $toTrimCmd ${config.filtersCmd(filters)} -c:v libx264 -c:a aac $outputPath';
|
||||
},
|
||||
);
|
||||
|
||||
try {
|
||||
@ -241,12 +240,12 @@ class _VideoEditorPageState extends State<VideoEditorPage> {
|
||||
await PhotoManager.stopChangeNotify();
|
||||
|
||||
try {
|
||||
final AssetEntity? newAsset =
|
||||
final AssetEntity newAsset =
|
||||
await (PhotoManager.editor.saveVideo(result, title: fileName));
|
||||
result.deleteSync();
|
||||
final newFile = await EnteFile.fromAsset(
|
||||
widget.file.deviceFolder ?? '',
|
||||
newAsset!,
|
||||
newAsset,
|
||||
);
|
||||
|
||||
newFile.creationTime = widget.file.creationTime;
|
||||
|
Loading…
x
Reference in New Issue
Block a user