{"id":17393184,"url":"https://github.com/animeng/flutter_export_video_frame","last_synced_at":"2025-04-15T13:51:51.529Z","repository":{"id":52579779,"uuid":"184379910","full_name":"animeng/flutter_export_video_frame","owner":"animeng","description":"Export picture from video file","archived":false,"fork":false,"pushed_at":"2022-02-19T07:42:12.000Z","size":202,"stargazers_count":15,"open_issues_count":9,"forks_count":22,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T20:45:57.581Z","etag":null,"topics":["album","android","flutter","frames","image","ios","video"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/animeng.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-01T06:53:55.000Z","updated_at":"2023-03-20T15:19:46.000Z","dependencies_parsed_at":"2022-09-04T05:23:06.089Z","dependency_job_id":null,"html_url":"https://github.com/animeng/flutter_export_video_frame","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animeng%2Fflutter_export_video_frame","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animeng%2Fflutter_export_video_frame/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animeng%2Fflutter_export_video_frame/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animeng%2Fflutter_export_video_frame/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/animeng","download_url":"https://codeload.github.com/animeng/flutter_export_video_frame/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249085453,"owners_count":21210267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["album","android","flutter","frames","image","ios","video"],"created_at":"2024-10-16T10:03:37.145Z","updated_at":"2025-04-15T13:51:51.506Z","avatar_url":"https://github.com/animeng.png","language":"Java","readme":"# Export Video frame for Flutter\n\nA Flutter plugin for iOS and Android for exporting picture from video file.\n\n## Installation\n\nadd ```export_video_frame``` as a dependency in your pubspec.yaml file.\n\n## Usage\n\n```dart\n\n/// Returns whether clean success\n  static Future\u003cbool\u003e cleanImageCache() async {\n    final String result = await _channel.invokeMethod('cleanImageCache');\n    if (result == \"success\") {\n      return true;\n    }\n    return false;\n  }\n\n  /// Save image to album\n  ///\n  /// - parameters:\n  ///    - file: file of video\n  ///    - albumName: save the album name\n  ///    - waterMark:assetName \"images/water_mark.png\"\n  ///    - alignment: [0,0]represents the center of the rectangle. \n  ///      from -1.0 to +1.0 is the distance from one side of the rectangle to the other side of the rectangle.\n  ///      Default value [1,1] repesent right bottom\n  ///    - scale: the scale ratio with respect water image size.Default value is 1.0\n  /// Returns whether save success\n  static Future\u003cbool\u003e saveImage(File file, String albumName,{String waterMark,Alignment alignment,double scale}) async {\n    Map\u003cString,dynamic\u003e para = {\"filePath\":file.path,\"albumName\":albumName};\n    if (waterMark != null) {\n      para.addAll({\"waterMark\":waterMark});\n      if (alignment != null) {\n        para.addAll({\"alignment\":{\"x\":alignment.x,\"y\":alignment.y}});\n      } else {\n        para.addAll({\"alignment\":{\"x\":1,\"y\":1}});\n      }\n      if (scale != null) {\n        para.addAll({\"scale\":scale});\n      } else {\n        para.addAll({\"scale\":1.0});\n      }\n    }\n    final bool result =\n        await _channel.invokeMethod('saveImage', para);\n    return result;\n  }\n\n  /// Returns the file list of the exporting image\n  ///\n  /// - parameters:\n  ///    - filePath: file path of video\n  ///    - number: export the number of frames\n  ///    - quality: scale of export frame.\"0\" is lowest,\"1\" is origin.(\"0\" is scale for 0.1 in android) \n  static Future\u003cList\u003cFile\u003e\u003e exportImage(String filePath, int number,double quality) async {\n    var para = {\"filePath\":filePath,\"number\":number,\"quality\":quality};\n    final List\u003cdynamic\u003e list =\n        await _channel.invokeMethod('exportImage', para);\n    var result = list\n        .cast\u003cString\u003e()\n        .map((path) =\u003e File.fromUri(Uri.file(path)))\n        .toList();\n    return result;\n  }\n\n  /// Returns the file list of the exporting image\n  ///\n  /// - parameters:\n  ///    - file: file of video\n  ///    - duration: export the duration of frames\n  ///    - radian: rotation the frame ,which will export frame.Rotation is clockwise.\n  static Future\u003cFile\u003e exportImageBySeconds(File file, Duration duration,double radian) async {\n    var milli = duration.inMilliseconds;\n    var para = {\"filePath\":file.path,\"duration\":milli,\"radian\":radian};\n    final String path = await _channel\n        .invokeMethod('exportImageBySeconds', para);\n    try {\n      var result = File.fromUri(Uri.file(path));\n      return result;\n    } catch (e) {\n      throw e;\n    }\n  }\n\n  /// Returns the file list of the exporting frame for gif file\n  ///\n  /// - parameters:\n  ///    - filePath: file path of video\n  ///    - quality: scale of export frame.\"0\" is lowest,\"1\" is origin.(\"0\" is scale for 0.1 in android) \n  static Future\u003cList\u003cFile\u003e\u003e exportGifImage(String filePath, double quality) async {\n    var para = {\"filePath\":filePath,\"quality\":quality};\n    final List\u003cdynamic\u003e list =\n        await _channel.invokeMethod('exportGifImagePathList', para);\n    var result = list\n        .cast\u003cString\u003e()\n        .map((path) =\u003e File.fromUri(Uri.file(path)))\n        .toList();\n    return result;\n  }\n\n```\n\n### ios\n\nIf there will be an error when compile ios app.Because flutter use swift is 4.0.\nlocated in ios/Podfile\nEdit your Podfile as follows:\n\n``` ruby\n\ntarget 'Runner' do\n  use_frameworks! # \u003c--- add this\n  ...\nend\n\npost_install do |installer|\n  installer.pods_project.targets.each do |target|\n    target.build_configurations.each do |config|\n      config.build_settings['ENABLE_BITCODE'] = 'NO'\n      config.build_settings['SWIFT_VERSION'] = '4.2' # \u003c--- add this\n    end\n  end\nend\n\n```\n\nIf you use saveAblum api,you need add the add the following keys to your Info.plist file, located ios/Runner/Info.plist:\n\n```xml\n\n\u003ckey\u003eNSPhotoLibraryUsageDescription\u003c/key\u003e\n\u003cstring\u003eUse Ablum For your purpose\u003c/string\u003e\n\n```\n\n### Android\n\nMake sure you add the needed permissions to your Android Manifest Permission.\n\n``` gradle\n\u003cuses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" /\u003e\n\u003cuses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" /\u003e\n```\n\n[Example Demo](https://pub.dev/packages/export_video_frame#-example-tab-)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanimeng%2Fflutter_export_video_frame","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanimeng%2Fflutter_export_video_frame","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanimeng%2Fflutter_export_video_frame/lists"}