View what's streaming

Is there a command-line way where channels-dvr will show me who is streaming what?

I'd like to know how many streams are active, maybe even ip addresses and the name of what's being streamed. Maybe even what's being recorded too.

I thought about scripting something that would look at channels-dvr.log (looking for a HLS "Starting" that is not followed by a HLS "Stopping" for the same channel#), but that feels hacky.

maybe something i can get from the http sever on :8089 ?

Yes, GET /dvr will return a JSON object. In that object is an activity object, which is the same as the Activity section on the DVR web UI.

For example:

$ curl -sS http://10.0.0.81:8089/dvr | jq .
{
  "activity": {
    "6-file-4880-10.0.0.90": "Watching recording Beat Bobby Flay S26E02 The Dynamic Duo 2020-08-23-1900.mpg from 10.0.0.90."
  },
  "busy": true,
  "clients": 2,
  "disk": {
    "free": 4239238602752,
    "total": 9920904794112,
    "used": 5181607903232
  },
  "enabled": true,
  "extra_paths": null,
  "guide": {
    "num_lineups": 2,
    "num_shows": 10512,
    "num_airings": 81942,
    "disk_size": 613281537,
    "updated_at": 1599168600
  },
  "keep": {
    "num": "",
    "only": ""
  },
  "last_backup": "2020-09-03T14:41:22.334067021-07:00",
  "padding": {
    "end": "180",
    "start": "0"
  },
  "path": "/srv/channels",
  "stats": {
    "groups": 346,
    "files": 1476,
    "jobs": 59,
    "rules": 245
  },
  "status": "running",
  "transcoder_cache": {
    "size": 0
  },
  "trash": {
    "after": "10"
  }
}
1 Like

boom! too easy.

i searched all over for something like that, is there a list that contain goodies like that?

No. The server's API is not documented. But, if you enable HTTP logging on your server, and then navigate around a client, you can get a feel for how things work.

Also as the devs have said, the dvr api is private and could change at anytime, so enjoy it while it lasts (like a dynamic IP that hasn't changed for years), but don't complain when it no longer works as you expect.

There are a lot of those if you spend the time searching the forum. Unfortunately some change or go away without notice. :man_shrugging:

1 Like

Yes, GET /dvr will return a JSON object. In that object is an activity object, which is the same as the

is there an easy way to access this from outside my local subnet? i see it gets tangled in oauth.

i know both simpleproxy and iptables+nat work around the problem, wondering if there's a cleaner solution.

Oauth is apparently required for outside access.

A VPN, SSH, or some other similar access would be needed to circumvent the OAuth requirements.

  "activity": {
    "6-file-4880-10.0.0.90": "Watching recording Beat Bobby Flay S26E02 The Dynamic Duo 2020-08-23-1900.mpg from 10.0.0.90."
  },

Do you happen to know the types of activities? I see Recording, Processing, Detecting commercials, and Watching. are there others ?

That field is also used for when the guide database is updated, or other activities.

Trial and error is your best option.