Skip to main content

rtmp 0.0.1 copy "rtmp: ^0.0.1" to clipboard
rtmp: ^0.0.1 copied to clipboard

A Dart library for RTMP (Real-Time Messaging Protocol).

rtmp #

A pure Dart library for RTMP (Real-Time Messaging Protocol).

Features #

  • Pure Dart: Implementation is entirely in Dart, ensuring cross-platform compatibility.
  • Zero Dependencies: No external package dependencies.
  • Publishing & Receiving: Supports both publishing to an RTMP server and receiving a stream from one.
  • Cross-Platform: Works on Flutter, Dart CLI, and any other Dart-supported environment.
  • H.264 & AAC Support: Basic support for common video and audio codecs.

Important

This package is an RTMP client. It does not include RTMP server functionality.

Screenshot #

YouTube Live from rtmp_publishing_example.dart

Screenshot

Getting started #

Add rtmp to your pubspec.yaml:

dependencies:
  rtmp: ^0.0.1

Usage #

Publishing a Stream #

import 'package:rtmp/rtmp.dart';

void main() async {
  final client = RtmpClient();
  await client.connect('rtmp://your-server-url/live');
  
  final stream = await client.createStream();
  await stream.publish('stream-key');
  
  // Send data...
  // stream.sendH264Sample(data, timestamp);
  
  await stream.close();
  await client.close();
}

Receiving a Stream #

import 'package:rtmp/rtmp.dart';

void main() async {
  final client = RtmpClient();
  await client.connect('rtmp://your-server-url/live');
  
  final stream = await client.createStream();
  await stream.play('stream-key');
  
  stream.videoStream.listen((packet) {
    print('Received video packet: ${packet.timestamp}');
  });
  
  // Wait or handle signals...
}

Additional information #

For more detailed examples, check the example/ directory in the repository.

0
likes
150
points
8
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Dart library for RTMP (Real-Time Messaging Protocol).

Repository (GitHub)
View/report issues

License

MIT (license)

More

Packages that depend on rtmp