π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mob] Expose and log video metadata
Neeraj Guptac941783fd374
diff --git a/mobile/lib/models/ffmpeg/ffprobe_props.dart b/mobile/lib/models/ffmpeg/ffprobe_props.dartindex abbc56d41b..6a9fff317a 100644--- a/mobile/lib/models/ffmpeg/ffprobe_props.dart+++ b/mobile/lib/models/ffmpeg/ffprobe_props.dart@@ -1,5 +1,7 @@// Adapted from: https://github.com/deckerst/aves+import "dart:developer";+import "package:collection/collection.dart";import "package:intl/intl.dart";import "package:photos/models/ffmpeg/channel_layouts.dart";@@ -128,6 +130,12 @@ class FFProbeProps {required this.xiaomiSlowMoment,});+ // toString() method+ @override+ String toString() {+ return 'FFProbeProps(captureFps: $captureFps, androidManufacturer: $androidManufacturer, androidModel: $androidModel, androidVersion: $androidVersion, bitRate: $bitRate, bitsPerRawSample: $bitsPerRawSample, byteCount: $byteCount, channelLayout: $channelLayout, chromaLocation: $chromaLocation, codecName: $codecName, codecPixelFormat: $codecPixelFormat, codedHeight: $codedHeight, codedWidth: $codedWidth, colorPrimaries: $colorPrimaries, colorRange: $colorRange, colorSpace: $colorSpace, colorTransfer: $colorTransfer, colorProfile: $colorProfile, compatibleBrands: $compatibleBrands, creationTime: $creationTime, displayAspectRatio: $displayAspectRatio, date: $date, duration: $duration, durationMicros: $durationMicros, extraDataSize: $extraDataSize, fieldOrder: $fieldOrder, fpsDen: $fpsDen, frameCount: $frameCount, handlerName: $handlerName, hasBFrames: $hasBFrames, height: $height, language: $language, location: $location, majorBrand: $majorBrand, mediaFormat: $mediaFormat, mediaType: $mediaType, minorVersion: $minorVersion, nalLengthSize: $nalLengthSize, quicktimeLocationAccuracyHorizontal: $quicktimeLocationAccuracyHorizontal, rFrameRate: $rFrameRate, rotate: $rotate, sampleFormat: $sampleFormat, sampleRate: $sampleRate, sampleAspectRatio: $sampleAspectRatio, sarDen: $sarDen, segmentCount: $segmentCount, sourceOshash: $sourceOshash, startMicros: $startMicros, startPts: $startPts, startTime: $startTime, statisticsWritingApp: $statisticsWritingApp, statisticsWritingDateUtc: $statisticsWritingDateUtc, timeBase: $timeBase, track: $track, vendorId: $vendorId, width: $width, xiaomiSlowMoment: $xiaomiSlowMoment)';+ }+factory FFProbeProps.fromJson(Map<dynamic, dynamic>? json) {return FFProbeProps(captureFps:diff --git a/mobile/lib/ui/viewer/file/file_details_widget.dart b/mobile/lib/ui/viewer/file/file_details_widget.dartindex fb15a3148d..81418ec976 100644--- a/mobile/lib/ui/viewer/file/file_details_widget.dart+++ b/mobile/lib/ui/viewer/file/file_details_widget.dart@@ -1,4 +1,5 @@import "dart:async";+import "dart:developer";import "dart:io";import "package:exif/exif.dart";@@ -110,6 +111,7 @@ class _FileDetailsWidgetState extends State<FileDetailsWidget> {final File? originFile = await getFile(widget.file, isOrigin: true);if (originFile == null) return;final session = await FFprobeKit.getMediaInformation(originFile.path);+final mediaInfo = session.getMediaInformation();if (mediaInfo == null) {@@ -120,8 +122,13 @@ class _FileDetailsWidgetState extends State<FileDetailsWidget> {);return;}- //todo:(neeraj) Use probe data for back filling location- final _ = await FFProbeUtil.getProperties(mediaInfo);+ final properties = await FFProbeUtil.getProperties(mediaInfo);+ final parsedMetadata = await FFProbeUtil.getMetadata(mediaInfo);++ // print all the properties+ log("videoCustomProps ${properties.toString()}");+ log("videoMetadata ${parsedMetadata.toString()}");+setState(() {});}diff --git a/mobile/lib/utils/ffprobe_util.dart b/mobile/lib/utils/ffprobe_util.dartindex a4fea7cfff..289bf5962b 100644--- a/mobile/lib/utils/ffprobe_util.dart+++ b/mobile/lib/utils/ffprobe_util.dart@@ -14,7 +14,7 @@ class FFProbeUtil {static Future<FFProbeProps> getProperties(MediaInformation mediaInformation,) async {- final properties = await _getMetadata(mediaInformation);+ final properties = await getMetadata(mediaInformation);try {return FFProbeProps.fromJson(properties);@@ -28,7 +28,7 @@ class FFProbeUtil {}}- static Future<Map> _getMetadata(MediaInformation information) async {+ static Future<Map> getMetadata(MediaInformation information) async {final props = information.getAllProperties();if (props == null) return {};