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

पैकेज विवरणv1.0.1

ffmpeg_helper

Flutter के लिए FFmpeg कमांड सहायता, Windows प्लेटफॉर्म पर सेटअप के समर्थन के साथ।

AndroidiOSmacOSWindowsLinux
30-दिन डाउनलोड
104
लाइक
27
Pub अंक
140

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

flutter pub add ffmpeg_helper

पैकेज अवलोकन

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

ffmpeg_helper एक Flutter पैकेज है जो Flutter एप्लिकेशन में FFmpeg कमांड्स के उपयोग को सरल बनाता है, जो FFmpeg ऑपरेशन्स निष्पादित करने के लिए आसान उपयोगकर्ता इंटरफ़ेस प्रदान करता है। इसमें Windows पर FFmpeg को सेटअप करने का निर्मित समर्थन शामिल है, जिससे यह Android, iOS, macOS, Windows और Linux जैसे कई प्लेटफॉर्मों पर उपलब्ध होता है। पैकेज जटिल कमांड-लाइन इंटरैक्शन को सरल Dart विधियों में समाहित करता है, जिससे डेवलपर्स को वीडियो कन्वर्जन, ट्रिमिंग और मर्जिंग जैसे मल्टीमीडिया प्रोसेसिंग कार्यों को कम प्रयास में करने में सक्षम बनाता है। बाहरी सर्वर पर निर्भरता के बिना डिवाइस पर मीडिया संशोधन की आवश्यकता वाले एप्लिकेशन के लिए आदर्श है।

उपयोग

  • वीडियो प्रारूप रूपांतरण
  • वीडियो से ऑडियो निकालना
  • वीडियो ट्रिमिंग और मर्जिंग
  • डिवाइस-आधारित मीडिया प्रोसेसिंग
  • प्लेटफॉर्म-सहित बहुमीडिया एप्लिकेशन

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

  • निर्मित विंडोज सेटअप समर्थन
  • प्लेटफॉर्म-अनुकूल FFmpeg एकीकरण
  • FFmpeg कमांड्स के लिए सरल Dart API
  • Android, iOS, macOS, Windows और Linux के समर्थन करता है
  • आसान कॉन्फ़िगरेशन और एक्सीक्यूशन

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

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

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

  • लक्षित उपकरणों पर सही FFmpeg स्थापना की आवश्यकता है
  • FFmpeg बाइनरी के कारण ऐप का आकार बढ़ सकता है
  • विंडोज सेटअप में अतिरिक्त कॉन्फ़िगरेशन चरणों की आवश्यकता होती है
  • मूल उपयोग के अतिरिक्त सीमित दस्तावेज़न
  • कम शक्ति वाले उपकरणों पर संभावित प्रदर्शन प्रभाव

मूल README

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

Buy Me A Coffee

ffmpeg_helper

FFmpeg commands helper for flutter with support for setup on windows platform. Create thumbnail and run ffprobe on all platforms except WEB. This uses ffmpeg_kit_flutter_min_gpl package for android/ios/macos Info was taken from ffmpeg_cli and recreated it as that project was stale.

// Initialize in main
  await FFMpegHelper.instance.initialize(); // This is a singleton instance
  // FFMpegHelper ffmpeg = FFMpegHelpe.instance; // use like this
  runApp(const MyApp());
// Command builder
// Use prebuilt args and filters or create custom ones
final FFMpegCommand cliCommand = FFMpegCommand(
  inputs: [
    FFMpegInput.asset(selectedFile!.path),
  ],
  args: [
    const LogLevelArgument(LogLevel.info),
    const OverwriteArgument(),
    const TrimArgument(
      start: Duration(seconds: 0),
      end: Duration(seconds: 10),
    ),
  ],
  filterGraph: FilterGraph(
    chains: [
      FilterChain(
        inputs: [],
        filters: [
          ScaleFilter(
            height: 300,
            width: -2,
          ),
        ],
        outputs: [],
      ),
    ],
  ),
  outputFilepath: path.join(appDocDir.path, "ffmpegtest.mp4"),
);
FFMpegHelperSession session = await ffmpeg.runAsync(
  cliCommand,
  statisticsCallback: (Statistics statistics) {
    print('bitrate: ${statistics.getBitrate()}');
  },
);

Thumbnail creator

// use ffmpeg.getThumbnailFileAsync() to get session
Future<FFMpegHelperSession> getThumbnailFileAsync({
  required String videoPath,
  required Duration fromDuration,
  required String outputPath,
  String? ffmpegPath,
  FilterGraph? filterGraph,
  int qualityPercentage = 100,
  Function(Statistics statistics)? statisticsCallback,
  Function(File? outputFile)? onComplete,
  FFMpegConfigurator? ffMpegConfigurator,
})
// use ffmpeg.getThumbnailFileSync() to get thumbnail file
Future<File?> getThumbnailFileSync({
  required String videoPath,
  required Duration fromDuration,
  required String outputPath,
  String? ffmpegPath,
  FilterGraph? filterGraph,
  int qualityPercentage = 100,
  Function(Statistics statistics)? statisticsCallback,
  Function(File? outputFile)? onComplete,
  FFMpegConfigurator? ffMpegConfigurator,
})

Run FFMpeg and get session so that user can cancel it later.

Future<FFMpegHelperSession> runAsync(
  FFMpegCommand command, {
  Function(Statistics statistics)? statisticsCallback,
  Function(File? outputFile)? onComplete,
  Function(Log)? logCallback,
})

Run FFMpeg as future.

Future<File?> runSync(
  FFMpegCommand command, {
  Function(Statistics statistics)? statisticsCallback,
})

Run ffprobe

Future<MediaInformation?> runProbe(String filePath)

Setup FFMPEG for Linux

sudo apt-get install ffmpeg
OR
sudo snap install ffmpeg
depends on linux distro

Setup FFMPEG for windows

Future<void> downloadFFMpeg() async {
    if (Platform.isWindows) {
      bool success = await ffmpeg.setupFFMpegOnWindows(
        onProgress: (FFMpegProgress progress) {
          downloadProgress.value = progress;
        },
      );
      setState(() {
        ffmpegPresent = success;
      });
    } else if (Platform.isLinux) {
      // show dialog box
      await Dialogs.materialDialog(
          color: Colors.white,
          msg:
              'FFmpeg installation required by user.\nsudo apt-get install ffmpeg\nsudo snap install ffmpeg',
          title: 'Install FFMpeg',
          context: context,
          actions: [
            IconsButton(
              onPressed: () {
                Navigator.of(context).pop();
              },
              text: 'Ok',
              iconData: Icons.done,
              color: Colors.blue,
              textStyle: const TextStyle(color: Colors.white),
              iconColor: Colors.white,
            ),
          ]);
    }
  }
// check setup progress on windows
// On windows if ffmpeg is not present it will download official zip file and extract on doc directory of app.
SizedBox(
  width: 300,
  child: ValueListenableBuilder(
    valueListenable: downloadProgress,
    builder: (BuildContext context, FFMpegProgress value, _) {
      //print(value.downloaded / value.fileSize);
      double? prog;
      if ((value.downloaded != 0) && (value.fileSize != 0)) {
        prog = value.downloaded / value.fileSize;
      } else {
        prog = 0;
      }
      if (value.phase == FFMpegProgressPhase.decompressing) {
        prog = null;
      }
      if (value.phase == FFMpegProgressPhase.inactive) {
        return const SizedBox.shrink();
      }
      return Column(
        mainAxisSize: MainAxisSize.min,
        children: [
          Text(value.phase.name),
          const SizedBox(height: 5),
          LinearProgressIndicator(value: prog),
        ],
      );
    },
  ),
),

श्रेणियाँ

निर्भरताएँ

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

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

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

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