-
Notifications
You must be signed in to change notification settings - Fork 54
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
Suggestion to get thumbnails to web interface #324
Comments
So in other words, you'd like a tool that periodically saves a miniaturized frame somewhere to a file which will get read by the webserver. Is that correct? |
I've added a rough draft of a tool on the thumbnailgen branch in my fork. It's using the same infrastructure as the previews in the GUI and saves the frames as jpeg files. Right now there is a hard coded limit of 1 frame per second. To build it you need libjpeg installed.
The tool takes 2 arguments - path of the unix socket it should create and the path of the output picture.
UltraGrid can then be started with the
Let me know if this works for your use case so I can polish it a bit more and merge into master. |
This is very close to what I was going to do. Since I use multicast a lot, I was going to output UG to multicast and then use ffmpeg to grab I frames and make thumbnails. This way seems a lot better. I will try to compile and put it into my test setup and see how much more CPU is used for that. I think having the option for FPS would be worthy considering different setups. |
Works great!.... Really great. So then I will ask another question at the same time. Right now I have an application that looks at the log output for the audio levels, and I have that pushing via a socket connection to my browser. Similar to how this jpg is done. Would there be something like what you have for this picture via the display be available for audio too? BTW, I also use the log parsing to get the transmission statistics. |
Glad it works for you. I've cleanup up the code a bit, made the fps limit configurable (accepts also floating point, so it's possible to specify 0.1 for 1 frame per 10 seconds) and merged it into master. As for the audio levels - right now the meter widgets in the QT GUI get that info via the control port. When "stats on" is written to the control port, it should start sending messages like
Those are the levels of the received audio. If you also want stats for the audio that is being sent, you need to launch uv with the |
I was testing this locally on one box encode with the thumbnails, but the moment I add the -d and make a connection with the decoder on the same box, the thumbs no longer update. I tired moving the -d position in the command line but that didn't help. I am sure I am doing something wrong here... Encoder: Decocder: |
I was planning to mention this in more detail, but looks like I forgot, sorry. To generate thumbnails on the encoder side it would be more appropriate to use the preview capture filter (which needs to be before the
The difference is that the capture filter runs in the sending part of UltraGrid before it ever touches the network, while the |
Using release from yesterday.... [capture filter preview] Unable to convert |
Looks like the pixel conversion from the captured format into RGB is missing. What format are you capturing in? R10k or v210? |
For this example is v210 but it could be any. It’s unknown at the moment, I normally use auto mode always. |
I've just added conversions for both v210 and R10k. All formats that can come out of decklink should be covered now. |
Thanks. I see it working now with the newly added FPS, but the resulting thumbnails is not even legible compared to before. 256 and 512 examples below.
|
Could this be how interlaced and progressive are being handled? |
Actually, this is because of how the images are scaled. The GUI preview on which code this is based on was designed to have the smallest possible performance impact rather than good quality. As such it's implemented so that:
This usually gives good enough results, however the problem here is that in the v210 pixel format the pixels are organized in 6 pixel wide "blocks" that cannot be divided. This means that the scaling algorithm has to always keep six consecutive pixels and only skip over multiplies of six pixels, which causes the artifacts as seen in your example. |
I understand what you are saying. But doubtful to agree with you that’s it’s good enough. It’s not even legible. I’d sooner chase iframes in the compressed video than have that. |
Alright, I've just added a mode (enabled using |
Thanks I will try that out and report back., |
Does anyone happen to have an OSx binary for thumbnailgen? I can't get it to compile in OSx. No issue complaining for Linux but we do all encoding on OSx. |
Update on this.... in 1.8.7 trying to do thumbnails. If I leave it to audio, I get the error [capture filter preview] Unable to convert If I try with continuous, it works in auto, but the quality of the jpg is complete garbage. |
In the same way as the ones you posted before? Is that with or without the |
It works on the decoder side, but dosnt work on the encoder side, so its either or the other, but not both able to use the hq option. |
I'm not entirely sure what the problem being reported is, so to make sure we are on the same page: On the decoder side, On the encoder side, Also, when running the preview on both the encoder and decoder sides, the socket specified need to different for both sides. |
I am trying to experiment on a headless solution where I can put data from the console output of UG, and send that to a local web interface where I can see the logs and remotely control everything. The question came up, "why don't you get the video in the browser, or at least thumbnails" that seems like a great idea, but other than trying to create another encode and re-directing locally to the browser, does anyone have a suggestion of maybe even a 1 FPS or less way to pass that to a local web server where a user can see stuff there? I already take the text data and make volume bars and some other features, but adding the thumbs would be the best solution as I think it wouldn't take much more horsepower to do it.
Update, I know I have asked this before, but I just putting it out in the universe again! That old github suggestion couldn't even get running it was so outdated.
Update, to be clear, what I need is to grab thumbnails of the encoder side and the decoder side. I can handle all the web stuff after that.
thoughts/suggestions?
The text was updated successfully, but these errors were encountered: