Skip to main content

Save stream to disk

Project description

Language

Stream saver

PyPI PyPI - License PyPI - Python Version

Python module for save stream to disk


Installation

Package Installation from PyPi

$ pip install stream-saver-g4

Package Installation from Source Code

The source code is available on GitHub.
Download and install the package:

$ git clone https://github.com/Genzo4/stream_saver
$ cd stream_saver
$ pip install -r requirements.txt
$ pip install .

Basic usage

  • Import:

from stream_saver_g4 import StreamSaver
  • Create instance:

Create an instance of the StreamSaver. You can specify additional options:

  • stream_URL - Stream URL. Default value: ''
  • output_template - Output template. Default value: 'output_%Y-%m-%d_%H-%M-%S.ts'
  • segment_time - Segment length. Default value: '01:00:00'
stream = StreamSaver(stream_URL='rtsp://cam_1.local:554/live1.sdp',
                     output_template='output_%H-%M-%S.ts',
                     segment_time='00:30:00'
                     )
  • Run saving stream

Stream saving is running in the background.

stream.run()
  • Stop saving stream

stream.stop()

Changelog


Language

Stream saver

PyPI PyPI - License PyPI - Python Version

Python модуль для сохранения видеопотока на диск.


Установка

Установка пакета с PyPi

$ pip install stream-saver-g4

Установка пакета из исходного кода

Исходный код размещается на GitHub.
Скачайте его и установите пакет:

$ git clone https://github.com/Genzo4/stream_saver
$ cd stream_saver
$ pip install -r requirements.txt
$ pip install .

Использование

  • Подключаем:

from stream_saver_g4 import StreamSaver
  • Создаём экземпляр

Создаём экземпляр StreamSaver. Можно указать дополнительные параметры:

  • stream_URL - адрес потока. Значение по умолчанию: ''
  • output_template - шаблон выходных файлов. Значение по умолчанию: 'output_%Y-%m-%d_%H-%M-%S.ts'
  • segment_time - длина одного сегмента. Значение по умолчанию: '01:00:00'
stream = StreamSaver(stream_URL='rtsp://cam_1.local:554/live1.sdp',
                     output_template='output_%H-%M-%S.ts',
                     segment_time='00:30:00'
                     )
  • Запускаем сохрание потока

Сохранение потока идёт в фоновом режиме.

stream.run()
  • Останавливаем сохранение потока

stream.stop()

Changelog

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stream_saver_g4-1.1.0.tar.gz (5.1 kB view hashes)

Uploaded Source

Built Distribution

stream_saver_g4-1.1.0-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page