jprjr / multistreamer

[discontinued] A webapp for publishing video to multiple streaming services at once.
MIT License
322 stars 94 forks source link

rtmp stats #61

Closed k1ck3r closed 3 years ago

k1ck3r commented 6 years ago

hey,

some time ago, you've implemented a rtmp stats page, which i think already comment, doesn't work for my purposes. i want to purpose the following additional code to webapp.lua in order to work with stats - basically will define what steps i take in order to adapt your code with nginxs' stats page.

  1. adding following line somewhere at start of webapp.lua:
    local function xml_xsl_out(req,err,status)
    status = status or 404
    return req:write({
    layout = 'plain',
    content_type = 'application/xml',
    status = status
    }, err)
    end
  2. changing the following lines @https://github.com/jprjr/multistreamer/blob/ec774a8fd389f78100a4397ebf55042c6614f37f/lib/multistreamer/webapp.lua#L1089

comment the following -- return plain_err_out(self,buf,200)

then add the following

buf = string.gsub(buf, '?>', '?>\n<?xml-stylesheet type="text/xsl" href="stat.xsl" ?>\n') return xml_xsl_out(self,buf,200)

  1. defining the /stats in nginx-conf.lua
    location /stat.xsl {
        root /opt/multistreamer/share/multistreamer/html/static/rtmp-stats;
        auth_basic "Restricted";
        auth_basic_user_file /opt/multistreamer/share/multistreamer/html/static/rtmp-stats/.htpasswd;
    }

    The custom stat.xml can be found here: https://pastebin.com/mv2u5rLc

So, because i can't purpose new changes to the code, please, add this to your scope of changes.

jprjr commented 3 years ago

I've been considering discontinuing this project for some time now. I'm sorry I couldn't solve your issue, but I just don't enjoy working on multistreamer anymore.