Skip to content

Commit

Permalink
Merge pull request #57 from LeGoffMael/getMetadata
Browse files Browse the repository at this point in the history
Get metadata of video file
  • Loading branch information
seel-channel authored Dec 16, 2021
2 parents 17ab785 + 1dc857e commit 045a3c7
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/domain/bloc/controller.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import 'dart:io';
import 'dart:typed_data';
import 'package:ffmpeg_kit_flutter_min_gpl/ffmpeg_kit.dart';
import 'package:ffmpeg_kit_flutter_min_gpl/ffprobe_kit.dart';
import 'package:ffmpeg_kit_flutter_min_gpl/media_information_session.dart';
import 'package:ffmpeg_kit_flutter_min_gpl/statistics.dart';
import 'package:path/path.dart' as path;
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -363,6 +365,21 @@ class VideoEditorController extends ChangeNotifier {
return transpose.length > 0 ? "${transpose.join(',')}" : "";
}

//--------------//
//VIDEO METADATA//
//--------------//

/// Return metadata of the video file
Future<void> getMetaData(
{required void Function(Map<dynamic, dynamic>? metadata)
onCompleted}) async {
await FFprobeKit.getMediaInformationAsync(file.path, (session) async {
final information =
(session as MediaInformationSession).getMediaInformation();
onCompleted(information?.getAllProperties());
});
}

//------------//
//VIDEO EXPORT//
//------------//
Expand Down

0 comments on commit 045a3c7

Please sign in to comment.