Skip to main content

Controls a local dvbstreamer

Project description

dvbctrl

Module to control a local dvbstreamer. On Arch you can install dvbstreamer from the AUR.

starting

from dvbctrl.dvbstreamer import DVBStreamer

adapter = 0
dvbs = DVBStreamer(adapter)
running = dvbs.start()
if not running:
    raise Exception(f"Failed to start dvbstreamer on adapter {adapter}")

stopping

from dvbctrl.dvbstreamer import DVBStreamer

adapter = 0
dvbs = DVBStreamer(adapter)

...

if dvbs.isRunning():
    dvbs.stop()

commands

from dvbctrl.commands import DVBCommand

kwargs = {
    "adapter": 0,
    "host": "127.0.0.1"
    "pass": "dvbctrl"
    "user": "dvbctrl"
}
dvbc = DVBCommand(**kwargs)

# services (channels)
chans = dvbc.lsservices()

recorder

A simple interface to dvbctrl to easily record to files from channels. Utilises the primary service filter only.

from dvbctrl.recorder import Recorder

# initialise the recorder
r = Recorder("BBC TWO", "/tmp/bbc_two.ts", adapter=0)

# start the recorder, this checks that the file is growing
r.start()

...

# stop the recording
r.stop()

You can periodically check that the recording file is still growing by using the check function, passing in the last file size. This returns a tuple containing a True/False flag and the current size. If the flag is False (i.e. the file isn't growing or is not there) then the lastsize argument is returned.

isok, currentsize = r.check(12345)

dvbctrl recorder commands

  • tuneToChannel() Tunes the dvbstreamer to a channel will wait up to 5 seconds for dvbstreamer to stabilise. Returns True if tuned or False otherwise
  • isTuned() returns True if tuned, False otherwise
  • waitTuned() waits for up to 5 seconds for the streamer to tune returns True if tuned successfully, False otherwise

dvbctrl commands

  • select Select a new service to stream.
  • setmrl Set the MRL of the primary service filter.
  • getmrl Get the primary service filter MRL.
  • addsf Add a service filter.
  • rmsf Remove a service filter.
  • lssfs List all service filters.
  • setsf Set the service to be filtered by a service filter.
  • getsf Get the service to stream to a secondary service output.
  • setsfmrl Set the service filter's MRL.
  • getsfmrl Get the service filter's MRL.
  • setsfavsonly Enable/disable streaming of Audio/Video/Subtitles only.
  • getsfavsonly Get whether Audio/Video/Subtitles only streaming is enabled.
  • lsservices List all services or for a specific multiplex.
  • lsmuxes List multiplexes.
  • lspids List the PIDs for a specified service.
  • current Print out the service currently being streamed.
  • serviceinfo Display information about a service.
  • muxinfo Display information about a mux.
  • stats Display the stats for the PAT,PMT and service PID filters.
  • festatus Displays the status of the tuner.
  • scan Scan the specified multiplex(es) for services.
  • cancelscan Cancel the any scan that is in progress.
  • lslcn List the logical channel numbers to services.
  • findlcn Find the service for a logical channel number.
  • selectlcn Select the service from a logical channel number.
  • lsmfs List current filters.

dvbctrl commands not yet implemented

  • feparams Get current frontend parameters. (NOT IMPLEMENTED)
  • lsprops List available properties. (NOT IMPLEMENTED)
  • getprop Get the value of a property. (NOT IMPLEMENTED)
  • setprop Set the value of a property. (NOT IMPLEMENTED)
  • propinfo Display information about a property. (NOT IMPLEMENTED)
  • dumptsr Dump information from the TSReader (NOT IMPLEMENTED)
  • lslnbs List known LNBs (NOT IMPLEMENTED)
  • epgdata Register to receive EPG data in XML format. (NOT IMPLEMENTED)
  • date Display the last date/time received. (NOT IMPLEMENTED)
  • enabledsmcc Enable DSM-CC data download for the specified service filter. (NOT IMPLEMENTED)
  • disabledsmcc Disable DSM-CC data download for the specified service filter. (NOT IMPLEMENTED)
  • dsmccinfo Display DSM-CC info for the specified service filter. (NOT IMPLEMENTED)
  • epgcaprestart Starts or restarts the capturing of EPG content. (NOT IMPLEMENTED)
  • epgcapstart Starts the capturing of EPG content. (NOT IMPLEMENTED)
  • epgcapstop Stops the capturing of EPG content. (NOT IMPLEMENTED)
  • now Display the current program on the specified service. (NOT IMPLEMENTED)
  • next Display the next program on the specified service. (NOT IMPLEMENTED)
  • addlistener Add a destination to send event notification to. (NOT IMPLEMENTED)
  • rmlistener Remove a destination to send event notification to. (NOT IMPLEMENTED)
  • lslisteners List all registered event listener (NOT IMPLEMENTED)
  • addlistenevent Add an internal event to monitor. (NOT IMPLEMENTED)
  • rmlistenevent Remove an internal event to monitor (NOT IMPLEMENTED)
  • lslistenevents List all registered event listener (NOT IMPLEMENTED)
  • addmf Add a new destination for manually filtered PIDs. (NOT IMPLEMENTED)
  • rmmf Remove a destination for manually filtered PIDs. (NOT IMPLEMENTED)
  • setmfmrl Set the filter's MRL. (NOT IMPLEMENTED)
  • addmfpid Adds a PID to a filter. (NOT IMPLEMENTED)
  • rmmfpid Removes a PID from a filter. (NOT IMPLEMENTED)
  • lsmfpids List PIDs for filter. (NOT IMPLEMENTED)
  • addoutput Add a new output. (NOT IMPLEMENTED)
  • rmoutput Remove an output. (NOT IMPLEMENTED)
  • enablesicap Enable the capture of PSI/SI data. (NOT IMPLEMENTED)
  • disablesicap Disable the capture of PSI/SI data. (NOT IMPLEMENTED)
  • lsplugins List loaded plugins. (NOT IMPLEMENTED)
  • plugininfo Display the information about a plugin. (NOT IMPLEMENTED)
  • who Display current control connections. (NOT IMPLEMENTED)
  • auth Login to control dvbstreamer. (NOT IMPLEMENTED)
  • logout Close the current control connection. (NOT IMPLEMENTED)
  • quit Exit the program. (NOT IMPLEMENTED)
  • help Display the list of commands or help on a specific command. (NOT IMPLEMENTED)

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

dvbctrl-0.3.9.tar.gz (23.5 kB view details)

Uploaded Source

Built Distribution

dvbctrl-0.3.9-py3-none-any.whl (35.9 kB view details)

Uploaded Python 3

File details

Details for the file dvbctrl-0.3.9.tar.gz.

File metadata

  • Download URL: dvbctrl-0.3.9.tar.gz
  • Upload date:
  • Size: 23.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.7 Linux/5.15.74-3-MANJARO

File hashes

Hashes for dvbctrl-0.3.9.tar.gz
Algorithm Hash digest
SHA256 041bd3152f5bd99ed9680f5062058f9c32168c446c8a7beb94507b4863d35cfa
MD5 0b04c6c2659e680a271ae287afc8a9f0
BLAKE2b-256 b195a39926518f7bd75f5afcc39889c3f9b1128211d1bba67c75ec27546292ae

See more details on using hashes here.

File details

Details for the file dvbctrl-0.3.9-py3-none-any.whl.

File metadata

  • Download URL: dvbctrl-0.3.9-py3-none-any.whl
  • Upload date:
  • Size: 35.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.7 Linux/5.15.74-3-MANJARO

File hashes

Hashes for dvbctrl-0.3.9-py3-none-any.whl
Algorithm Hash digest
SHA256 7ab8185d23807c3350c4bb4783649749dabd823b01b3292893759c23bc95e602
MD5 698e7e03a9adf52ff5b42261e872b2d7
BLAKE2b-256 45df852bfe99d6950a44cc023892aa91ad205a14fe36690a963b36ae7a2d5f8f

See more details on using hashes here.

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