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

GitHub 代码仓MohammedShamseerPV/MJPEG-Stream

MJPEG-流

MohammedShamseerPV/MJPEG-Stream open-source repository details.

MJPEG-流 项目封面
星标
1
复刻
2
最近推送(UTC)
2025年2月14日
项目状态
未归档

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

📸 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…

Mohammed Shamseer PV GitHub avatar
GitHub 作者

Mohammed Shamseer PV ↗

Hi there 👋 I’m Mohammed Shamseer, a passionate Self-Taught Software Developer dedicated to creating innovative solutions that bridge technology

语言Dart

此仓库发布的插件

使用的依赖

依赖清单 4 项

  • flutter{"sdk":"flutter"}
  • http^1.2.2
  • flutter_test开发依赖{"sdk":"flutter"}
  • flutter_lints开发依赖^3.0.0

如何选择适合项目的代码仓?

先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。

  1. 通过仓库名、作者或描述搜索,再按技术分类缩小范围。
  2. 结合星标、复刻与最近推送比较项目;星标反映社区关注,不代表质量保证。
  3. 使用前在 GitHub 核对 README、许可证与 Issues。

来源与维护

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗