luci-app-ustreamer: complete rewrite#8324
Conversation
|
Image values depends on the camera itself. Generally they should be taken from |
889146e to
2d1e7fa
Compare
New features: - Implement all supported ustreamer features - Detailed UI text and description based on the program help - Input validation for all parameters - Stream preview with link to the stream page - Dark theme colours for the stream preview - Bulgarian translation (complete) Bug fixes: - Use of poll.add inside the render function results in a fork bomb - Repeated use if setTimeout results in a fork bomb when the stream is not available (old bug from luci-app-mjpg-streamer) Merge: - I tried to keep existing translations as much as possible - All existing features, except [video_devs] Removed: - [video_devs] parameters, this or a similar feature will be implemented once I fully test it, and choose an optimal strategy, with support for multiple video input devices. In order to comlpete work on this feature, I need programatic access to the configuration name for each instance: config ustreamer 'configuration_name' Formatting: - Format code for readability and to fit 80 column where possible Notes: The values for image control varies between camera models, therefore the range is unrestricted. Due to a race condition, two instances of the package got created. I put a lot of effort and testing in every single detail, and the other implementation got merged first. All features and translations are merged here, except for [video_devs], which will be reworked later. Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
2d1e7fa to
e74454c
Compare
|
Changes: |
|
I suppose I forgot to add a variable to check for existing polls. :/ |
| 'require uci'; | ||
| 'require ui'; | ||
| 'require view'; | ||
| 'require poll'; |
| return Promise.all([ | ||
| L.resolveDefault(fs.list('/dev/'), []).then(entries => entries.filter(e => /^video.*$/.test(e.name)) ), | ||
| uci.load('ustreamer'), | ||
| ]); |
There was a problem hiding this comment.
We use this to find available devices.
| render([video_devs]) { | ||
| render: function () { |
| '<li><kbd>HW ───────── </kbd>Use pre-encoded MJPEG frames directly from camera hardware</li>' + | ||
| '<li><kbd>M2M-VIDEO ── </kbd>GPU-accelerated MJPEG encoding using V4L2 M2M video interface</li>' + | ||
| '<li><kbd>M2M-IMAGE ── </kbd>GPU-accelerated JPEG encoding using V4L2 M2M image interface</li>' | ||
| )); |
There was a problem hiding this comment.
Use strings here, and put any html outside of i18n strings. See elsewhere in apps and the repo for examples.
There was a problem hiding this comment.
So I should replace all strings containing <br /> like this, and update all translations? I'll try to do it tomorrow.
- _('line_1<br />line_2')
+ _('line_1') + '<br />' + _('line_2')I'm doing this for the first time. What are the i18n strings? This? _('text')
How easy or hard is it to use Weblate? I spent the past few days editing 37 translations at the same time, to keep them in perfect sync with the code. It was painful, even though I learned some tricks and my efficiency improved greatly.
There was a problem hiding this comment.
This repo uses GNU message tools. Anything you change in js, just run build/i18n-sync.sh applications/luci-app-ustreamer/ and it refreshes for you.
| this_tab, form.Flag, 'allow_truncated_frames', | ||
| _('Allow truncated frames'), _( | ||
| 'Allows to handle truncated frames. Default: disabled<br />' + | ||
| 'Useful if the device produces incorrect but still acceptable frames' |
There was a problem hiding this comment.
Same - use br outside of _()
| const dv_timings = s.taboption( | ||
| this_tab, form.Flag, 'dv_timings', _('DV-timings'), _( | ||
| 'Enable DV-timings querying and events processing to automatic ' + | ||
| 'resolution change<br />Default: disable' |
There was a problem hiding this comment.
Same. If we keep Default: disable as a separate string, it only needs i18n once.
It's not difficult to run this command during page init (after fs.list) and poll the camera for acceptable values. But the tricky part I suppose is telling the sectionentry that uses that device to know which of these to apply. I could help you figure it out after we get the baby steps going here. |
|
@systemcrash @mdevaev {
"brightness": { "min":-64, "max":64, "step":1, "default":0, "auto":1, "value":0 },
"contrast": { "min":0, "max":95, "step":1, "default":0, "auto":0, "value":0 },
// auto can also be hardcoded, since we know which parameters support it
} |
|
If a device is not present - no keys to the kingdom. But I figure ustreamer could provide some sane defaults in that case. Or the UI falls back to some default. |
|
Any update on this? |
|
I had to switch to an urgent task for work, and I'll resume this soon. Sorry for the delay. |
|
@httpstorm Unfortunately, ustreamer does not provide an option for dumping existing image parameters. I could do that, but I'm too overwhelmed right now. Sorry about this. |
|
No worries. Once implemented in |
New features:
Bug fixes:
poll.addinside therenderfunction results in a fork bombsetTimeoutresults in a fork bomb when the stream is not available (old bug fromluci-app-mjpg-streamer)Merge:
[video_devs]Removed:
[video_devs]parameters, this or a similar feature will be implemented once I fully test it, and choose an optimal strategy, with support for multiple video input devices. In order to comlpete work on this feature, I need programatic access to theconfiguration namefor each instance:config ustreamer 'configuration_name'Formatting:
TODO:
Ask the
ustreamerauthor whether we should use0-255limits for some of the image control parameters. Note: My camera expects0-255, while the source code internally accepts int range, but warns when a value is outside the range I have defined. These limits could be standard, in which case we should keep them or dependent on the camera used, in which case we should remove the limits and accept any int value.Edit: The values for image control varies between camera models, therefore the range is unrestricted.
Note:
Due to a race condition, two instances of the package got created. I put a lot of effort and testing in every single detail, and the other implementation got merged first. All features and translations are merged here, except for
[video_devs], which will be reworked later.Signed-off-by: <my@email.address>row (viagit commit --signoff)<package name>: titlefirst line subject for packagesPKG_VERSIONin the Makefile@systemcrash @hnyman @GeorgeSapkin @mdevaev