पैकेज, रिपॉज़िटरी और ऐप श्रेणियाँ खोजें

पैकेज विवरणv0.0.7

export_video_frame

एक फ्लटर प्लगइन जो वीडियो फ़ाइल से छवि के निर्यात के लिए आईओएस और एंड्रॉइड के लिए है।

AndroidiOS
30-दिन डाउनलोड
66
लाइक
41
Pub अंक
130

पैकेज इंस्टॉल करें

flutter pub add export_video_frame

पैकेज अवलोकन

सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।

एक फ्लटर प्लगइन जो डेवलपर्स को एंड्रॉइड और आईओएस प्लेटफॉर्म पर वीडियो फाइलों से स्टिल छवियां निकालने की अनुमति देता है। यह थंबनेल या प्रीव्यू बनाने के लिए विशिष्ट समय स्थितियों पर फ्रेम कैप्चर करने के लिए एक सीधा-आसान एपीआई प्रदान करता है। इस प्लगइन को मल्टीमीडिया एप्लिकेशन में बिना किसी झंझट के एकीकृत करने के लिए डिज़ाइन किया गया है, जिसमें नेटिव वीडियो प्रोसेसिंग के साथ न्यूनतम सेटअप के साथ समर्थन है। यह प्लेटफॉर्म-विशिष्ट क्षमताओं का उपयोग करता है ताकि उच्च प्रदर्शन और उपकरणों के बीच अनुकूलता सुनिश्चित की जा सके।

उपयोग

  • वीडियो थंबनेल जनरेट करना
  • पूर्वावलोकन छवियाँ बनाना
  • विश्लेषण के लिए फ्रेम निकालना
  • वीडियो संपादन उपकरण बनाना
  • वीडियो स्नैपशॉट प्रदर्शित कर रहा है

मुख्य विशेषताएँ

  • क्रॉस-प्लेटफ़ॉर्म समर्थन (iOS & Android)
  • निर्दिष्ट समयांकों पर फ्रेम निकालना
  • सरल API एकीकरण
  • उच्च प्रदर्शन रेंडरिंग
  • मूल वीडियो प्रसंस्करण

इनके लिए उपयुक्त

  • वीडियो ऐप विकासकर्ता
  • मीडिया सामग्री निर्माता
  • थंबनेल जनरेशन टूल्स
  • वीडियो विश्लेषण के साथ शैक्षिक ऐप्स
  • फ्रेम-बाय-फ्रेम वीडियो जांच की आवश्यकता वाले ऐप्स

विचार योग्य बातें

  • प्लेटफॉर्म-विशिष्ट अनुमतियाँ की आवश्यकता होती है
  • चित्र निर्यात (कोई वीडियो संपादन नहीं) पर सीमित
  • प्रदर्शन के लिए उपकरण हार्डवेयर पर निर्भर करता है
  • बड़े वीडियो के साथ मेमोरी की सीमा हो सकती है
  • कोई निर्मित यूआई घटक प्रदान नहीं किए गए हैं

मूल README

संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।

Export Video frame for Flutter

A Flutter plugin for iOS and Android for exporting picture from video file.

Installation

add export_video_frame as a dependency in your pubspec.yaml file.

Usage


/// Returns whether clean success
  static Future<bool> cleanImageCache() async {
    final String result = await _channel.invokeMethod('cleanImageCache');
    if (result == "success") {
      return true;
    }
    return false;
  }

  /// Save image to album
  ///
  /// - parameters:
  ///    - file: file of video
  ///    - albumName: save the album name
  ///    - waterMark:assetName "images/water_mark.png"
  ///    - alignment: [0,0]represents the center of the rectangle. 
  ///      from -1.0 to +1.0 is the distance from one side of the rectangle to the other side of the rectangle.
  ///      Default value [1,1] repesent right bottom
  ///    - scale: the scale ratio with respect water image size.Default value is 1.0
  /// Returns whether save success
  static Future<bool> saveImage(File file, String albumName,{String waterMark,Alignment alignment,double scale}) async {
    Map<String,dynamic> para = {"filePath":file.path,"albumName":albumName};
    if (waterMark != null) {
      para.addAll({"waterMark":waterMark});
      if (alignment != null) {
        para.addAll({"alignment":{"x":alignment.x,"y":alignment.y}});
      } else {
        para.addAll({"alignment":{"x":1,"y":1}});
      }
      if (scale != null) {
        para.addAll({"scale":scale});
      } else {
        para.addAll({"scale":1.0});
      }
    }
    final bool result =
        await _channel.invokeMethod('saveImage', para);
    return result;
  }

  /// Returns the file list of the exporting image
  ///
  /// - parameters:
  ///    - filePath: file path of video
  ///    - number: export the number of frames
  ///    - quality: scale of export frame."0" is lowest,"1" is origin.("0" is scale for 0.1 in android) 
  static Future<List<File>> exportImage(String filePath, int number,double quality) async {
    var para = {"filePath":filePath,"number":number,"quality":quality};
    final List<dynamic> list =
        await _channel.invokeMethod('exportImage', para);
    var result = list
        .cast<String>()
        .map((path) => File.fromUri(Uri.file(path)))
        .toList();
    return result;
  }

  /// Returns the file list of the exporting image
  ///
  /// - parameters:
  ///    - file: file of video
  ///    - duration: export the duration of frames
  ///    - radian: rotation the frame ,which will export frame.Rotation is clockwise.
  static Future<File> exportImageBySeconds(File file, Duration duration,double radian) async {
    var milli = duration.inMilliseconds;
    var para = {"filePath":file.path,"duration":milli,"radian":radian};
    final String path = await _channel
        .invokeMethod('exportImageBySeconds', para);
    try {
      var result = File.fromUri(Uri.file(path));
      return result;
    } catch (e) {
      throw e;
    }
  }

  /// Returns the file list of the exporting frame for gif file
  ///
  /// - parameters:
  ///    - filePath: file path of video
  ///    - quality: scale of export frame."0" is lowest,"1" is origin.("0" is scale for 0.1 in android) 
  static Future<List<File>> exportGifImage(String filePath, double quality) async {
    var para = {"filePath":filePath,"quality":quality};
    final List<dynamic> list =
        await _channel.invokeMethod('exportGifImagePathList', para);
    var result = list
        .cast<String>()
        .map((path) => File.fromUri(Uri.file(path)))
        .toList();
    return result;
  }

ios

If there will be an error when compile ios app.Because flutter use swift is 4.0. located in ios/Podfile Edit your Podfile as follows:


target 'Runner' do
  use_frameworks! # <--- add this
  ...
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
      config.build_settings['SWIFT_VERSION'] = '4.2' # <--- add this
    end
  end
end

If you use saveAblum api,you need add the add the following keys to your Info.plist file, located ios/Runner/Info.plist:


<key>NSPhotoLibraryUsageDescription</key>
<string>Use Ablum For your purpose</string>

Android

Make sure you add the needed permissions to your Android Manifest Permission.

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Example Demo

श्रेणियाँ

निर्भरताएँ

निर्भरता सूची 1 आइटम

सोर्स रिपॉज़िटरी

इस पैकेज का उपयोग करने वाले प्रोजेक्ट

अभी कोई डेटा उपलब्ध नहीं है।