-
Notifications
You must be signed in to change notification settings - Fork 663
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
MJPEG netcam is always shown in 640x480 #2693
Comments
motionEye does support motion v4.4, which is why this change was done: #2462 Did you run into any specific issue with latest motion and motionEye? Probably we missed migration for a specific config key. |
I have 1920x1080 mjpeg stream added via Network Camera, but the preview / video from motion becomes 640x480. This issue is not reproducible with 4.3.2 |
You mean a simple MJPEG stream? That is not passed through motion at all, is it? Or do you mean an RTSP or RTMP stream? In this case you should be able to use the resolution option in camera settings. Do you use custom motion arguments? We just internally translate those which are used by the options in UI, while for custom parameters you need to assure those do match the motion version. Lastly, does motion, if used at all for this stream, report any warning about unknown config keys? |
|
Does the URL to the network camera start with
If I see it right, the resolution is not set anywhere for netcams with other URL schemes. Can you show the related camera config? cat /etc/motioneye/camera-1.conf Adjust the number to match the netcam. And if you find time, doing the same with motion v4.3.2 would be great. |
It starts with HTTP. This is how it looks like in v4.3.2
|
So as expected no resolution/width/height is defined at all. With motion 4.5.1, when accessing the stream directly at port 8081 has 640x480 resolution applied as well, or is it full HD there? |
It is 640x480, downsized from full HD, so the image looks compressed horizontally as the aspect ratio becomes tighter. |
Then it seems to be a bug in motion itself, since the config does not enforce any resolution. In this case I'd expect it to show the stream unmodified. Reading the docs, however, it seems the default is (now) 640x480 and enforced for the output stream, even if the original stream has a different resolution and is not actually rescaled: https://motion-project.github.io/motion_config.html#width This seems dumb to me. The default, if nothing enforced, should be the input stream. Can you test with motion v4.4 to narrow down here the change happened? https://github.com/Motion-Project/motion/releases/tag/release-4.4.0 If this is somehow a wanted change, we'd need to expose the width/height setting for all camera types, but in case of a netcam stream obtain the original resolution and apply this when the camera is created (as default). But I'm not sure how to obtain the original resolution. |
I've actually tested on 4.4.0 as well, it does have the same issue. It should be easy to obtain the resolution by just reading a single frame the moment the stream url is added, but if someone decided to change the source without readding, then the resolution would remain unchanged. |
Okay, good to know. There is an issue/discussion about this, older than motion 4.4: Motion-Project/motion#1489
Indeed, I mean that my Python and PIL knowledge is insufficient to know how to implement this. Would require some spare time to look into the code. I think the code around the masks already does this, so could be reused as basis to obtain and measure dimensions of a single frame when adding a new netcam. I will test a bit as well so see what we can do our end and collect all info required to do a proper report at the motion repo. |
motionEye writes a config file to Let's see if I can manage to do a pull request on this matter. |
It creates an |
Indeed, and it doesn't contain resolution related config on my side. After all, it doesn't sound right to have the config here since we might be dealing with streams with different resolution. |
Okay, so motionEye does not enforce the 640x480 via its global and individual netcam configs. With motion 4.3.2 in this case, auto-detection seemed to have worked, since motion 4.4 it enforces 640x480 regardless, which actually matches the documentation. Also the v4.3.2 documentation says that 640x480 is the default and that motion tries to resize the output image (even without rescaling). Both docs match 100% for these settings: https://motion-project.github.io/4.3.2/motion_config.html#width Now I see another section:
The changelog says: https://github.com/Motion-Project/motion/releases/tag/release-4.4.0
The docs have been changed here: https://github.com/Motion-Project/motion/pull/1367/files I think it has to do something with whether FFmpeg is used or not. |
I came across this issue and have come to somewhat of a workaround with a slight drawback. tldr; My setup is that I have a bunch (5) of raspberry pi zero 2s with pi v3 cameras running motioneye, but only outputting a stream, not saving any data or doing any motion detection.
This sounds like basically what we want, a high resolution version of the stream. The first drawback being:
This is a bit of a pain, but not the end of the world with the setup I have, as I can simply add the name/time overlay on each of my zeros before the stream is passed to the hub. This may be a deal breaker for other setups. The other drawback is:
Meaning there is no option to only set a high res url and the preview will continue to be 640x480 but recorded video is my full stream resolution. Either way it's better than what I had before if still not perfect. To get it working I just added:
Hope this helps a little |
@MartinLenord |
Hey @zeekblitz, you have to add the config to each camera configuration on the hub that is consuming the streams (in my case my RPi 5). You can either add it directly to each |
@kingkingyyk I was able to get the resolution to display correctly on the dashboard of my motioneye "hub" from a MJPEG network cam by just specifying the height and width parameters in the Extra Options field for the added camera. So in my case, I have a couple Raspberry Pi Zero 2 Ws with Arducam 12MP IMX708 Module 3 cameras and a Raspberry Pi 4B as the hub. When adding the Zeros as network cams, the dashboard always had the resolution defaulted down. I have them set at 1280x720 resolution so in the Extra Options field on the hub dashboard for that camera I just added:
Which after applying made the dashboard stream preview the correct resolution. |
motioneye/extra/linux_init
always install latest motion, but motioneye doesn't necessarily support it.For example, in
4.4.0
introduced new configuration options that causes this issue where motion doesn't support writing the new configuration yet.The text was updated successfully, but these errors were encountered: