Coder Social home page Coder Social logo

sxudan / react-native-live-file-publisher Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 4.26 MB

This is a react native package to publish file to RTSP or RTMP server.

License: MIT License

JavaScript 13.07% TypeScript 37.14% Kotlin 21.03% Ruby 14.51% Objective-C 1.47% Objective-C++ 12.27% Swift 0.51%
ffmpeg ingest publisher react-native-package rtmp rtmp-file-publisher rtsp rtsp-file-publisher ingest-file live-file-publisher pusher

react-native-live-file-publisher's Introduction

react-native-live-file-publisher

This is a file publisher to publish the video file to RTSP or RTMP server.

Features

  • Publish video file streams to RTSP or RTMP servers.
  • Easy integration into your Flutter applications.

Installation

npm install react-native-live-file-publisher

or

yarn add react-native-live-file-publisher

Usage

import {
  PublisherProtocol,
  useLiveFilePublisher,
} from 'react-native-live-file-publisher';

// ...

const { publishingState, publish, stop, log } = useLiveFilePublisher({
    url: 'rtmp://192.168.1.100:1935',
    mode: PublisherProtocol.RTMP,
  });

.
.
// publish
/**
timestamp: '00:00:00'
filepath: local file path
name: stream name
**/
try {
    publish(<filepath>, <name>, <timestamp>);
} catch (e) {
    console.log(e);
}

Enums

export enum PublisherProtocol {
  RTMP,
  RTSP_UDP,
  RTSP_TCP,
}

export enum PublishingState {
  Normal = 'Normal',
  RequestPublish = 'RequestPublish',
  Publishing = 'Publishing',
  RequestStopPublish = 'RequestStopPublish',
}

Known issues

There are some issues publishing iphone video which are in HEVC format. They need to be transcoded using iOS UIImagePicker compression or other compression techniques. Before publishing to the server, you need to shrink resolution to streaming video resolution (1280x720). By default, the package expo-image-picker does it for you.

Screenshots

Publishing with the example app

Playing in VLC player

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

react-native-live-file-publisher's People

Contributors

sxudan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.