Skip to main content

robot_stream_mjpeg 0.1.1 copy "robot_stream_mjpeg: ^0.1.1" to clipboard
robot_stream_mjpeg: ^0.1.1 copied to clipboard

HTTP MJPEG video source and Flutter widget for ROS 2 web_video_server streams with automatic reconnect and stall detection.

example/main.dart

import 'package:flutter/material.dart';
import 'package:robot_stream_mjpeg/robot_stream_mjpeg.dart';

void main() => runApp(const MaterialApp(home: MjpegExamplePage()));

/// Minimal example connecting [MjpegSource] to a ROS `web_video_server`.
class MjpegExamplePage extends StatefulWidget {
  const MjpegExamplePage({super.key, this.host = '192.168.1.100'});

  final String host;

  @override
  State<MjpegExamplePage> createState() => _MjpegExamplePageState();
}

class _MjpegExamplePageState extends State<MjpegExamplePage> {
  final _source = MjpegSource(robotId: 'robot1');

  @override
  void initState() {
    super.initState();
    _source.connect(
      webVideoServerUri(
        host: widget.host,
        topic: '/camera/color/image_raw',
        quality: 50,
        width: 640,
        height: 480,
      ),
    );
  }

  @override
  void dispose() {
    _source.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('MJPEG Example')),
      body: Center(
        child: MjpegView(
          source: _source,
          placeholder: const CircularProgressIndicator(),
        ),
      ),
    );
  }
}
0
likes
160
points
59
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

HTTP MJPEG video source and Flutter widget for ROS 2 web_video_server streams with automatic reconnect and stall detection.

Repository (GitHub)
View/report issues
Contributing

Topics

#ros #ros2 #robotics #mjpeg #video

License

BSD-3-Clause (license)

Dependencies

flutter, http, robot_stream_core

More

Packages that depend on robot_stream_mjpeg