Giter VIP home page Giter VIP logo

streamsaver's Introduction

Quickstart

This utility allows saving video streams into local files.

Install transform utility using a command

  • pip install dist/streamsaver-1.0.2.tar.gz

Examples of usage:

Show help message

  • transform -h

Save rtsp, udp or tcp stream into a local mp4 file.

  • transform -u udp://host:6002 -o mp4 -d ./out.mp4
  • transform -u tcp://host:5000 -o mp4 -d ./out.mp4
  • transform -u rtsp://host:1235/file2.rtsp -o mp4 -d ./out.mp4

Save stream into series of jpg files.

  • transform -u rtsp://host:1235/file.rtsp -o frame -d ./out%0d.jpg
  • transform -u udp://host:6002 -o frame -d ./out%0d.jpg

Requiments

  • GStreamer 1.0 (Use command sudo apt install gstreamer1.0)
  • python 3
  • pip3 util (can be installed with sudo apt install python3-pip)

for development: virtualenv setuptools (can be installed with pip3 install virtualenv setuptools)

Using streamsaver as library

To call transform function from you python script you can import streamsaver and use streamsaver.pipeline.transform directly.

from streamsaver.pipeline import transform

transform("udp://host:6002", "mp4", "/tmp/out.mp4")

Also, see examples\appsink_example.py. In this example, the numpy calculates the mean of pixels on a video stream.

Setup development environment

git clone [url]
cd streamsaver
virtualenv -p /usr/bin/python3 .pyenv
source .pyenv/bin/activate
cd .pyenv/lib/python3.6/site-packages
ln -s /usr/lib/python3/dist-packages/gi
python setup.py install

After this command transform will become available in the PATH of the virtual environment

Build distribution

python setup.py sdist

to install the built package run

pip install dist/streamsaver-1.0.2.tar.gz

To run unittests

PYTHONPATH=./:$PYTHONPATH python3 -m unittest discover -s streamsaver/test

To run e2e tests

Testing the video processing pipeline requires a source of a signal. Complex pipelines can be distributed on several hosts, and you need an orchestration tool to run tests. So I am using robot framework for automatization.

install requirements

sudo pip3 install robotframework
sudo apt install ffmpeg

to run tests

cd e2e_tests
robot test_transform.robot

Than open report.html, log.html

streamsaver's People

Contributors

dumbris avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  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.