-
Notifications
You must be signed in to change notification settings - Fork 21
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
video statistics #46
Comments
@markvdb Do you have this data? In absolute or relative values? |
No, that's why we are asking you. How would you collect that data? Easy for 2016-11-21 22:36 GMT+01:00 Richard Hartmann notifications@github.com:
Mark Van den Borre |
I can provide example nginx logs, basically you see two things: requests for .m3u8 file (the playlist) and STREAMNAME-[0-9]*.ts , which is the current segment the user is viewing. If you parse the file and see which segments were most watched, or which IP watched 10 consecutive segments or whatever, you can probably calculate all the stats. |
Without a bit more context, I am not even sure what exactly you're asking us to do. What does the stack look like? What other tools exist which do similar? Which bits and pieces of the nginx logs are the most relevant and interesting ones in your experience? Is there a tapout for basic stats which we could use? Do you already collect partial info which we could re-use or glean implementation details from? Something along those lines. |
Okay, I'll try to explain a bit better :) The only way I know to measure anything related to HLS is by parsing the access logs. HLS itself (HTTP live streaming) is moderately stupid standard for video streaming, that does the following:
The clients re-fetch continuously STREAMNAME.m3u8 and the mentioned .ts files in it. For example, to find out how many hours of video were watched for a single room, you count the number of .ts files, and treat them as 5 seconds each. If you want to find out how many unique people watched a stream, you filter out all the .ts files for one, get a list of unique IP addresses, and for each of those check if it fetched more than 12 .ts files (1 minute). This isn't perfect, but should be close to reality. If you want to see when a room peaked, you get all the .ts files for a room and see which one was downloaded most. Does this answer the question, or am I explaining something completely different and useless?:) |
If that's all you want, that seems almost trivial. As a lot of that is domain-specific to video, I would prefer to teach you how to fish so you can add new stuff yourself. If you really just need someone to write a log file parser, we can help there as well. Let's assume we have two rooms, A and B and two streams, 720p and 1080p. After parsing the current logs, you would generate a text file like
and be done with it. The rest can be handed off to Prometheus and it will magically do the right thing for you. |
Is there any update on this? I still think it would be better in the long-term if you did it and we help you understand why & how. |
Sorry, have been very busy. I can do the parser that deals with it and just generates the file, shouldn't be a problem. |
Sounds good. I will be more than happy to review the results and make sure
it's aligned with the patterns.
Richard
Sent by mobile; excuse my brevity.
|
For log file parsing, I highly recommend https://github.com/google/mtail or https://github.com/fstab/grok_exporter. If I can have some sample nginx logs I can write this easily. |
@krokodilerian Please post some log samples, or point me to the code that generates the logs. |
@SuperQ , I have a dump of the logs, how do I give them to you? ~607MB. |
Ahh, the logs were supposed to be used for live monitoring. Having them later isn't necessary. We can possibly do this for 2018. All I really needed was a representative sample, or the log format code. |
I'll send a 10MB excerpt from a log somewhere, what about email? |
I grabbed a copy of the logs from the stream frontend host. |
Hello Ben, Any update on this? If not, we'll go by the total bandwidth consumption of the streamers... Thank you! Mark |
I think we implemented this in mtail. See the nginx.mtail file. I don't know where I put the log file from the streaming front-end to validate the functionality. If anyone has some backup logs, that'd be helpful. |
I added #129 to also give us better internal metrics from nginx. |
We can use promtail for that, as we have a loki instance up and running. first we need nginx to produce a json access log that we can parse properly
feel free to remove json fields from the output that are |
Requested by Basti in FOSDEM/video#46
Here you go: FOSDEM/infrastructure@fa7088e |
Richard,
We have a variable number of video streaming frontends serving HLS video. We would like to get reliable visitor statistics:
Can you make this for us please?
Thank you!
The text was updated successfully, but these errors were encountered: