Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to statistical output from srt-live-transmit #345

Closed
gissleh opened this issue Apr 17, 2018 · 3 comments
Closed

Improvements to statistical output from srt-live-transmit #345

gissleh opened this issue Apr 17, 2018 · 3 comments

Comments

@gissleh
Copy link
Contributor

gissleh commented Apr 17, 2018

I'm evaluating SRT for stream contribution, and the early results with using the built-in live transmit tool has been promising once I found out where to put the latency argument. My use case is using the srt-live-transmit as a process spawned from a central management system, and for that good monitoring information is important.

However, I have noticed the statistics option for srt-live-transmit does not output all monitoring data it has access to, and the format – while good for human readability and debugging – is not very suited for parsing by client programs.

I have added an option for that in a local copy of the repo that prints in a JSON format (except not prettified like the example below), but I want to see what you think about this before cleaning that code up and sending a pull request.

{
    "sid": 948948699,
    "time": 3310824,
    "window": {
        "flow": 8192,
        "congestion": 8192,
        "flight": 0
    },
    "link": {
        "rtt": 253.417,
        "bandwidth": 113.28,
        "maxBandwidth": 30
    },
    "send": {
        "packets": 0,
        "packetsLost": 0,
        "packetsDropped": 0,
        "packetsRetransmitted": 0,
        "bytes": 0,
        "bytesDropped": 0,
        "mbitRate": 0
    },
    "recv": {
        "packets": 886507,
        "packetsLost": 17,
        "packetsDopped": 0,
        "packetsRetransmitted": 39,
        "packetsBelated": 19,
        "bytes": 1114118900,
        "bytesLost": 20222,
        "bytesDropped": 0,
        "mbitRate": 2.69206
    }
}
@gissleh gissleh changed the title Statistical output for srt-live-transmit is lacking in parameters and parsability. Improvements to statistical output from srt-live-transmit Apr 17, 2018
@rebotnix
Copy link

Like that, let´s merge to the main master please!

@ethouris
Copy link
Collaborator

ethouris commented May 4, 2018

I don't exactly understand how it is supposed to work. Can anyone make a PR for it?

@gissleh
Copy link
Contributor Author

gissleh commented May 4, 2018

#356

The output in that PR is a json stream where each output is an object that spans just one line, making it compatible with parsers that reads newline-delimited json streams and concatenated json streams. It's best used with -q to avoid having to filter out non-json output from stderr. Since there are no string values, writing JSON without an external library should be safe.

rndi pushed a commit that referenced this issue May 23, 2018
* Added -pf option with values json and default
* Changed PrintSrtStats (transmitmedia.cpp) to use a stringstream to build the output before printing it.
@gissleh gissleh closed this as completed Jun 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants