搜尋套件、儲存庫與 APP 分類

套件詳情v1.0.1

mjpeg_stream

一個用於透過 HTTP 傳輸 MJPEG(運動 JPEG)影片的 Flutter 套件

AndroidiOSmacOSWindowsLinux
近 30 天下載
112
喜歡數
3
Pub 分數
125

安裝套件

flutter pub add mjpeg_stream

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

mjpeg_stream 套件讓 Flutter 應用程式能夠透過 HTTP 流式傳輸 MJPEG(運動 JPEG)影片,提供輕量級解決方案,可從 IP 攝影機或網路伺服器進行即時影片播放。它支援多個平台,包括 Android、iOS、macOS、Windows 與 Linux,非常適合跨平台影片監控應用。該套件能以極低延遲有效處理 HTTP 流傳輸,讓開發者可將即時影片串流直接整合至其使用者介面中。在需要連續影片串流的監控、機器人與物聯網應用中尤為實用。

適用情境

  • 即時攝像頭監控
  • 物聯網裝置影片串流整合
  • 機器人視覺系統
  • 監控儀表板
  • 遠端診斷

主要特色

  • 支援透過HTTP的MJPEG
  • 跨平台相容性
  • 低延遲串流
  • 與 Flutter 小部件的簡單整合
  • 即時視頻播放

適合對象

  • 開發監控應用程式的開發者
  • 物聯網專案創建者
  • 機器人工程師
  • 需要即時視頻流的應用程式
  • 跨平台視頻解決方案

使用建議

  • 需要穩定的網絡連接
  • 限制為 MJPEG 格式
  • 可能需要額外的緩衝區以應對低頻寬
  • 不適用於高解析度影片串流
  • 依賴伺服器端的MJPEG串流支援

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

📸 MJPEG Stream Flutter Package

mjpegLogo1

Welcome to MJPEG Stream Flutter Package! 🚀 This package allows you to stream MJPEG video in your Flutter application easily. Perfect for real-time camera feeds and IP camera streaming. 📷🎥

https://github.com/user-attachments/assets/c908688e-3cd0-45bc-a21b-359df1eac6a5

screen4

screen3

🌟 Features

  • 📡 Live MJPEG streaming
  • 🎨 Customizable width, height, and fit
  • ⚡ Optimized for performance
  • 🚀 Easy to integrate
  • 🛠 Error handling and reconnection support
  • 📜 Built-in logging for debugging

📦 Installation

Run this command:

With Flutter:

flutter pub add mjpeg_stream

Add this package to your pubspec.yaml:

dependencies:
  mjpeg_stream: latest_version

OR

mjpeg_stream:
    git:  
      url: https://github.com/MohammedShamseerPV/MJPEG-Stream.git
      ref: main  # Optional: specify the branch (default is 'main')

Then, run:

flutter pub get

🛠 Usage

Import the package:

import 'package:mjpeg_stream/mjpeg_stream.dart';
Example Usage 🎬
import 'package:flutter/material.dart';
import 'package:mjpeg_stream/mjpeg_stream.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'MJPEG Stream Example',
      home: Scaffold(
        appBar: AppBar(title: Text("MJPEG Stream")),
        body: Center(
          child: MJPEGStreamScreen(
            streamUrl: "http://your-ip-camera-url/video.mjpg",
            width: 300.0,
            height: 200.0,
            fit: BoxFit.cover,
          ),
        ),
      ),
    );
  }
}

📚 Use this Package as a Library

📥 Depend on it

Run this command:

With Flutter:

flutter pub add mjpeg_stream

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

dependedfdfdfncies:
  mjpeg_stream: ^latest_version
dependencies:
  mjpeg_stream: ^latest_version

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

📌 Import it

Now in your Dart code, you can use:

import 'package:mjpeg_stream/mjpeg_stream.dart';

⚙️ API Reference

Property Type Description
streamUrl String The URL of the MJPEG stream.
fit BoxFit Defines how the image should be inscribed into the widget. Default: BoxFit.cover.
width double Width of the stream display. Default: double.infinity.
height double Height of the stream display. Default: 300.0.
timeout Duration Timeout for the network request. Default: 5 seconds.
enableLogging bool Enables logging for debugging. Default: false.

🚀 How It Works

  1. The package establishes an HTTP connection to the MJPEG stream.
  2. It processes the received image frames in real-time.
  3. It updates the UI efficiently without performance issues.
  4. It handles errors and reconnection automatically. ⚡
  5. It provides logging for debugging purposes. 📜

🛠 Troubleshooting

  • ❗ Stream Not Loading? Check if your URL is correct and accessible.
  • 🔴 Slow Performance? Optimize the network or use a lower resolution stream.
  • 💥 Crashes? Ensure the stream URL is reachable and error handling is implemented.
  • 📝 Need Debugging? Enable logging by setting enableLogging: true.

🎯 Future Enhancements

  • ✅ Add support for pause/play functionality
  • ✅ Improve error handling
  • ✅ Optimize performance for low-latency streaming
  • ✅ Enhance logging and debugging features

📝 License

This package is open-source under the MIT License. Feel free to contribute! 😊

👨‍💻 Happy Coding! 🚀


🔗 Connect with Me


💰 Support My Work

If you found this package useful, consider supporting my work:

qr-code-phonePay

Uploading qr-code-phonePay.png…

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。