removed ffmpeg-kit dependency
This commit is contained in:
parent
550c72e994
commit
43521e6268
7 changed files with 0 additions and 374 deletions
30
plugins/aves_video_ffmpeg/.gitignore
vendored
30
plugins/aves_video_ffmpeg/.gitignore
vendored
|
@ -1,30 +0,0 @@
|
|||
# Miscellaneous
|
||||
*.class
|
||||
*.log
|
||||
*.pyc
|
||||
*.swp
|
||||
.DS_Store
|
||||
.atom/
|
||||
.buildlog/
|
||||
.history
|
||||
.svn/
|
||||
migrate_working_dir/
|
||||
|
||||
# IntelliJ related
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
.idea/
|
||||
|
||||
# The .vscode folder contains launch configuration and tasks you configure in
|
||||
# VS Code which you may wish to be included in version control, so this line
|
||||
# is commented out by default.
|
||||
#.vscode/
|
||||
|
||||
# Flutter/Dart/Pub related
|
||||
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
|
||||
#/pubspec.lock
|
||||
**/doc/api/
|
||||
.dart_tool/
|
||||
.packages
|
||||
build/
|
|
@ -1,10 +0,0 @@
|
|||
# This file tracks properties of this Flutter project.
|
||||
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
||||
#
|
||||
# This file should be version controlled and should not be manually edited.
|
||||
|
||||
version:
|
||||
revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
|
||||
channel: stable
|
||||
|
||||
project_type: package
|
|
@ -1 +0,0 @@
|
|||
include: ../../analysis_options.yaml
|
|
@ -1 +0,0 @@
|
|||
export 'src/metadata.dart';
|
|
@ -1,146 +0,0 @@
|
|||
import 'package:aves_model/aves_model.dart';
|
||||
import 'package:aves_video/aves_video.dart';
|
||||
import 'package:ffmpeg_kit_flutter/ffmpeg_kit_config.dart';
|
||||
import 'package:ffmpeg_kit_flutter/ffprobe_kit.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
class FfmpegVideoMetadataFetcher extends AvesVideoMetadataFetcher {
|
||||
static const chaptersKey = 'chapters';
|
||||
static const formatKey = 'format';
|
||||
static const streamsKey = 'streams';
|
||||
|
||||
@override
|
||||
void init() {}
|
||||
|
||||
@override
|
||||
Future<Map> getMetadata(AvesEntryBase entry) async {
|
||||
var uri = entry.uri;
|
||||
if (uri.startsWith('content://')) {
|
||||
final safUri = await FFmpegKitConfig.getSafParameterForRead(uri);
|
||||
if (safUri == null) {
|
||||
debugPrint('failed to get SAF URI for entry=$entry');
|
||||
return {};
|
||||
}
|
||||
uri = safUri;
|
||||
}
|
||||
|
||||
final session = await FFprobeKit.getMediaInformation(uri);
|
||||
final information = session.getMediaInformation();
|
||||
if (information == null) {
|
||||
final failStackTrace = await session.getFailStackTrace();
|
||||
final output = await session.getOutput();
|
||||
debugPrint('failed to get video metadata for entry=$entry, failStackTrace=$failStackTrace, output=$output');
|
||||
return {};
|
||||
}
|
||||
|
||||
final props = information.getAllProperties();
|
||||
if (props == null) return {};
|
||||
|
||||
final chapters = props[chaptersKey];
|
||||
if (chapters is List) {
|
||||
if (chapters.isEmpty) {
|
||||
props.remove(chaptersKey);
|
||||
}
|
||||
}
|
||||
|
||||
final format = props.remove(formatKey);
|
||||
if (format is Map) {
|
||||
format.remove(Keys.filename);
|
||||
format.remove('size');
|
||||
_normalizeGroup(format);
|
||||
props.addAll(format);
|
||||
}
|
||||
|
||||
final streams = props[streamsKey];
|
||||
if (streams is List) {
|
||||
streams.forEach((stream) {
|
||||
if (stream is Map) {
|
||||
_normalizeGroup(stream);
|
||||
|
||||
final fps = stream[Keys.avgFrameRate];
|
||||
if (fps is String) {
|
||||
final parts = fps.split('/');
|
||||
if (parts.length == 2) {
|
||||
final num = int.tryParse(parts[0]);
|
||||
final den = int.tryParse(parts[1]);
|
||||
if (num != null && den != null) {
|
||||
if (den > 0) {
|
||||
stream[Keys.fpsNum] = num;
|
||||
stream[Keys.fpsDen] = den;
|
||||
}
|
||||
stream.remove(Keys.avgFrameRate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final disposition = stream[Keys.disposition];
|
||||
if (disposition is Map) {
|
||||
disposition.removeWhere((key, value) => value == 0);
|
||||
stream[Keys.disposition] = disposition.keys.join(', ');
|
||||
}
|
||||
|
||||
final idValue = stream['id'];
|
||||
if (idValue is String) {
|
||||
final id = int.tryParse(idValue);
|
||||
if (id != null) {
|
||||
stream[Keys.index] = id - 1;
|
||||
stream.remove('id');
|
||||
}
|
||||
}
|
||||
|
||||
if (stream[Keys.streamType] == 'data') {
|
||||
stream[Keys.streamType] = MediaStreamTypes.metadata;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return props;
|
||||
}
|
||||
|
||||
void _normalizeGroup(Map<dynamic, dynamic> stream) {
|
||||
void replaceKey(String k1, String k2) {
|
||||
final v = stream.remove(k1);
|
||||
if (v != null) {
|
||||
stream[k2] = v;
|
||||
}
|
||||
}
|
||||
|
||||
replaceKey('bit_rate', Keys.bitrate);
|
||||
replaceKey('codec_type', Keys.streamType);
|
||||
replaceKey('format_name', Keys.mediaFormat);
|
||||
replaceKey('level', Keys.codecLevel);
|
||||
replaceKey('nb_frames', Keys.frameCount);
|
||||
replaceKey('pix_fmt', Keys.codecPixelFormat);
|
||||
replaceKey('profile', Keys.codecProfileId);
|
||||
|
||||
final tags = stream.remove('tags');
|
||||
if (tags is Map) {
|
||||
stream.addAll(tags);
|
||||
}
|
||||
|
||||
<String>{
|
||||
Keys.bitsPerSample,
|
||||
Keys.closedCaptions,
|
||||
Keys.codecLongName,
|
||||
Keys.codecProfileId,
|
||||
Keys.filmGrain,
|
||||
Keys.hasBFrames,
|
||||
Keys.rFrameRate,
|
||||
Keys.startPts,
|
||||
Keys.startTime,
|
||||
Keys.vendorId,
|
||||
}.forEach((key) {
|
||||
final value = stream[key];
|
||||
switch (value) {
|
||||
case final num v:
|
||||
if (v == 0) {
|
||||
stream.remove(key);
|
||||
}
|
||||
case final String v:
|
||||
if (double.tryParse(v) == 0 || v == '0/0' || v == 'unknown' || v == '[0][0][0][0]') {
|
||||
stream.remove(key);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,158 +0,0 @@
|
|||
# Generated by pub
|
||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||
packages:
|
||||
aves_model:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: "../aves_model"
|
||||
relative: true
|
||||
source: path
|
||||
version: "0.0.1"
|
||||
aves_utils:
|
||||
dependency: transitive
|
||||
description:
|
||||
path: "../aves_utils"
|
||||
relative: true
|
||||
source: path
|
||||
version: "0.0.1"
|
||||
aves_video:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: "../aves_video"
|
||||
relative: true
|
||||
source: path
|
||||
version: "0.0.1"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: clock
|
||||
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.2"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.19.0"
|
||||
equatable:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: equatable
|
||||
sha256: "567c64b3cb4cf82397aac55f4f0cbd3ca20d77c6c03bedbc4ceaddc08904aef7"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.7"
|
||||
ffmpeg_kit_flutter:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: "flutter/flutter"
|
||||
ref: background-lts
|
||||
resolved-ref: "24213bd2334265cfc240525fb9a218b85ad4d872"
|
||||
url: "https://github.com/deckerst/ffmpeg-kit.git"
|
||||
source: git
|
||||
version: "6.0.3"
|
||||
ffmpeg_kit_flutter_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: ffmpeg_kit_flutter_platform_interface
|
||||
sha256: addf046ae44e190ad0101b2fde2ad909a3cd08a2a109f6106d2f7048b7abedee
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.2.1"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
flutter_lints:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: flutter_lints
|
||||
sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.0.0"
|
||||
leak_tracker:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker
|
||||
sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "10.0.8"
|
||||
lints:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: lints
|
||||
sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.1.1"
|
||||
material_color_utilities:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: material_color_utilities
|
||||
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.11.1"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.15.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.9.1"
|
||||
plugin_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: plugin_platform_interface
|
||||
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.8"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.4"
|
||||
vm_service:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vm_service
|
||||
sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "14.3.1"
|
||||
sdks:
|
||||
dart: ">=3.6.0 <4.0.0"
|
||||
flutter: ">=2.0.0"
|
|
@ -1,28 +0,0 @@
|
|||
name: aves_video_ffmpeg
|
||||
version: 0.0.1
|
||||
publish_to: none
|
||||
|
||||
environment:
|
||||
sdk: ^3.6.0
|
||||
#resolution: workspace
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
aves_model:
|
||||
path: ../aves_model
|
||||
aves_video:
|
||||
path: ../aves_video
|
||||
# `video` version is necessary, as some videos make the app crash
|
||||
# when using only `min` or `https` (the default)
|
||||
# ffmpeg_kit_flutter_video: 6.0.3-LTS
|
||||
ffmpeg_kit_flutter:
|
||||
git:
|
||||
url: https://github.com/deckerst/ffmpeg-kit.git
|
||||
ref: background-lts
|
||||
path: flutter/flutter
|
||||
|
||||
dev_dependencies:
|
||||
flutter_lints:
|
||||
|
||||
flutter:
|
Loading…
Reference in a new issue