π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Parse make, model and location for iPhone Videos
Neeraj Guptac28b4934c427
diff --git a/mobile/lib/models/ffmpeg/ffprobe_keys.dart b/mobile/lib/models/ffmpeg/ffprobe_keys.dartindex 99befc1858..081fe0ff7e 100644--- a/mobile/lib/models/ffmpeg/ffprobe_keys.dart+++ b/mobile/lib/models/ffmpeg/ffprobe_keys.dart@@ -28,6 +28,7 @@ class FFProbeKeys {static const date = 'date';static const disposition = 'disposition';static const duration = 'duration';+ static const quickTimeLocation ="com.apple.quicktime.location.ISO6709";static const durationMicros = 'duration_us';static const encoder = 'encoder';static const extraDataSize = 'extradata_size';diff --git a/mobile/lib/models/ffmpeg/ffprobe_props.dart b/mobile/lib/models/ffmpeg/ffprobe_props.dartindex f85747edc8..71478e01a1 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";@@ -10,11 +12,11 @@ import "package:photos/models/ffmpeg/mp4.dart";import "package:photos/models/location/location.dart";class FFProbeProps {- final Map<String, dynamic>? prodData;-- FFProbeProps({- required this.prodData,- });+ Map<String, dynamic>? prodData;+ Location? location;+ DateTime? creationTime;+ String? bitrate;+ String? majorBrand;// toString() method@override@@ -29,15 +31,17 @@ class FFProbeProps {return buffer.toString();}- factory FFProbeProps.fromJson(Map<dynamic, dynamic>? json) {+ static fromJson(Map<dynamic, dynamic>? json) {final Map<String, dynamic> parsedData = {};+ final FFProbeProps result = FFProbeProps();for (final key in json!.keys) {final stringKey = key.toString();switch (stringKey) {case FFProbeKeys.bitrate:case FFProbeKeys.bps:- parsedData[stringKey] = _formatMetric(json[key], 'b/s');+ result.bitrate = _formatMetric(json[key], 'b/s');+ parsedData[stringKey] = result.bitrate;break;case FFProbeKeys.byteCount:parsedData[stringKey] = _formatFilesize(json[key]);@@ -66,10 +70,23 @@ class FFProbeProps {case FFProbeKeys.duration:parsedData[stringKey] = _formatDuration(json[key]);case FFProbeKeys.location:- parsedData[stringKey] = _formatLocation(json[key]);+ result.location = _formatLocation(json[key]);+ if (result.location != null) {+ parsedData[stringKey] =+ '${result.location!.latitude}, ${result.location!.longitude}';+ }+ break;+ case FFProbeKeys.quickTimeLocation:+ result.location =+ _formatLocation(json[FFProbeKeys.quickTimeLocation]);+ if (result.location != null) {+ parsedData[FFProbeKeys.location] =+ '${result.location!.latitude}, ${result.location!.longitude}';+ }break;case FFProbeKeys.majorBrand:- parsedData[stringKey] = _formatBrand(json[key]);+ result.majorBrand = _formatBrand(json[key]);+ parsedData[stringKey] = result.majorBrand;break;case FFProbeKeys.startTime:parsedData[stringKey] = _formatDuration(json[key]);@@ -78,8 +95,9 @@ class FFProbeProps {parsedData[stringKey] = json[key];}}+ result.prodData = parsedData;- return FFProbeProps(prodData: parsedData);+ return result;}static String _formatBrand(String value) => Mp4.brands[value] ?? value;@@ -196,6 +214,7 @@ class FFProbeProps {longitude: coordinates[1],);} catch (e) {+ log('failed to parse location: $value', error: e);return null;}}diff --git a/mobile/lib/ui/viewer/file/vid_exif_dialog.dart b/mobile/lib/ui/viewer/file/video_exif_dialog.dartsimilarity index 93%rename from mobile/lib/ui/viewer/file/vid_exif_dialog.dartrename to mobile/lib/ui/viewer/file/video_exif_dialog.dartindex f320b9a6c1..5f621f85ea 100644--- a/mobile/lib/ui/viewer/file/vid_exif_dialog.dart+++ b/mobile/lib/ui/viewer/file/video_exif_dialog.dart@@ -37,13 +37,14 @@ class VideoExifDialog extends StatelessWidget {return Column(crossAxisAlignment: CrossAxisAlignment.start,children: [+ _buildInfoRow(context, 'Creation Time', probeData, 'creation_time'),_buildInfoRow(context, 'Duration', probeData, 'duration'),- _buildInfoRow(context, 'Probe Score', probeData, 'probe_score'),- _buildInfoRow(context, 'Number of Programs', probeData, 'nb_programs'),- _buildInfoRow(context, 'Number of Streams', probeData, 'nb_streams'),+ _buildInfoRow(context, 'Location', probeData, 'location'),_buildInfoRow(context, 'Bitrate', probeData, 'bitrate'),+ _buildInfoRow(context, 'Model', probeData, 'com.apple.quicktime.model'),+ _buildInfoRow(context, 'OS', probeData, 'com.apple.quicktime.software'),+ _buildInfoRow(context, 'Major Brand', probeData, 'major_brand'),_buildInfoRow(context, 'Format', probeData, 'format'),- _buildInfoRow(context, 'Creation Time', probeData, 'creation_time'),],);}