搜索插件、代码仓与 APP 分类

插件详情v1.3.3

flutter_video_info

一个 Flutter 插件,用于获取视频文件的基本元数据信息。

AndroidiOS
近 30 天下载
1.7万
喜欢数
73
Pub 分数
150

安装插件

flutter pub add flutter_video_info

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

flutter_video_info 是一个 Flutter 插件,可从 Android 和 iOS 设备上的视频文件中提取基本元数据。它提供诸如持续时间、分辨率、帧率和文件大小等基本信息,无需外部依赖。该插件轻量级,专为需要快速访问视频属性的媒体应用而设计。它与 Flutter 生态系统无缝集成,并通过原生代码桥接支持两个平台。非常适合开发视频播放器、媒体库或内容管理工具的开发者。

适合场景

  • 提取视频时长以用于播放控制
  • 在媒体预览中显示视频分辨率
  • 下载前检查文件大小
  • 在处理前验证视频格式
  • 构建媒体库元数据显示

主要特点

  • 支持 Android 和 iOS
  • 获取持续时间、分辨率、帧速率和大小
  • 轻便且快速
  • 无外部依赖
  • 用于元数据提取的简单 API

适合对象

  • 媒体播放器应用
  • 视频上传格式化
  • 内容管理系统
  • 媒体库接口
  • 跨平台视频工具

使用建议

  • 需要平台特定的文件访问权限
  • 仅限基本元数据(无音频详细信息)
  • 不支持流媒体URL
  • 元数据准确性取决于源文件的完整性
  • 可能无法与加密或损坏的视频文件一起使用

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

pub package pub package

flutter_video_info 1.3.3

This plugin uses MediaMetadataRetriever class of native android to get basic meta information of a video file.

The following info can be extracted by this plugin:

title path author mimetype height width filesize duration orientation date framerate location

Installation & Uses

Add flutter_video_info as a dependency in your pubspec.yaml file (what?).

dependencies:
    flutter_video_info: <current version>

Import FlutterVideoInfo in your dart file.

import 'package:flutter_video_info/flutter_video_info.dart';

final videoInfo = FlutterVideoInfo();

String videoFilePath = "your_video_file_path";
var info = await videoInfo.getVideoInfo(videoFilePath);

//String title = info.title;   to get title of video
//similarly path,author,mimetype,height,width,filesize,duration,orientation,date,framerate,location can be extracted.

for iOS

If you select a video from your photo library, Add the following keys to your Info.plist file, located in /ios/Runner/Info.plist:

NSPhotoLibraryUsageDescription - describe why your app needs permission for the photo library. This is called Privacy - Photo Library Usage Description in the visual editor.

Troubleshooting

Checkout here

PR is welcomed

Anyone can pr for these issues

所属分类

依赖

依赖清单 1 项

源码仓库

使用此插件的项目