Open camaro4life18 opened 3 years ago
Digging into my own issue, I ran with -vv and got the follow logs...
2021-02-26 12:18:02,014 [DEBUG ] - /home/pi/v4l2rtspserver/src/MJPEGVideoSource.cpp:26 SOF length:17 2021-02-26 12:18:02,014 [INFO ] - /home/pi/v4l2rtspserver/src/MJPEGVideoSource.cpp:42 width:1216 height:400 type:0 precision:8 2021-02-26 12:18:02,014 [DEBUG ] - /home/pi/v4l2rtspserver/src/MJPEGVideoSource.cpp:49 DQT length:132 2021-02-26 12:18:02,014 [DEBUG ] - /home/pi/v4l2rtspserver/src/MJPEGVideoSource.cpp:57 Quantization table idx:0 precision:0 size:64 total size:64 2021-02-26 12:18:02,014 [DEBUG ] - /home/pi/v4l2rtspserver/src/MJPEGVideoSource.cpp:77 SOS length:12 2021-02-26 12:18:02,014 [DEBUG ] - /home/pi/v4l2rtspserver/src/MJPEGVideoSource.cpp:87 headerSize:589 2021-02-26 12:18:02,018 [DEBUG ] - /home/pi/v4l2rtspserver/src/DeviceSource.cpp:105 waitingFrame delay:66ms 2021-02-26 12:18:02,019 [INFO ] - /home/pi/v4l2rtspserver/src/DeviceSource.cpp:29 intv_sec:1614359882 fps:15 bandwidth:45002kbps 2021-02-26 12:18:02,019 [DEBUG ] - /home/pi/v4l2rtspserver/src/DeviceSource.cpp:213 getNextFrame timestamp:1614359882.18177 size:384016 diff:1ms 2021-02-26 12:18:02,019 [DEBUG ] - /home/pi/v4l2rtspserver/src/DeviceSource.cpp:245 queueFrame timestamp:1614359882.18177 size:384016 diff:1ms 2021-02-26 12:18:02,084 [DEBUG ] - /home/pi/v4l2rtspserver/src/DeviceSource.cpp:105 waitingFrame delay:66ms 2021-02-26 12:18:02,085 [DEBUG ] - /home/pi/v4l2rtspserver/src/DeviceSource.cpp:213 getNextFrame timestamp:1614359882.84836 size:383872 diff:1ms 2021-02-26 12:18:02,085 [DEBUG ] - /home/pi/v4l2rtspserver/src/DeviceSource.cpp:245 queueFrame timestamp:1614359882.84836 size:383872 diff:1ms 2021-02-26 12:18:02,139 [DEBUG ] - /home/pi/v4l2rtspserver/src/DeviceSource.cpp:162 deliverFrame timestamp:1614359882.139887 size:384016 diff:121ms queue:1
In those logs you can see the resolution is getting shrunk. I dug in the code to see where that output is coming from and traced some of the code back to DeviceSource.cpp line 150 that is reducing the size to fit in fMaxSize. So it looks like live555 is reducing the image size to fit its buffer.
I'm not familiar with this code and how live555 and ffmpeg work, but this definitely seems like the problem for such a high resolution. It also looks like i'm not the only one to ever run into this issue.... https://stackoverflow.com/questions/20510484/live555-fmaxsize-and-ffmpeg
Hi camaro4life18,
This project doesnot use ffmpeg, it doesnot compress images. The MJEG streaming is not implemented in live555 and this project brings a naive implementation of it. Depending on the JPEG image, it may work or not. It seems size if not correctly decode, you should look to your JPEG frame regarding https://github.com/mpromonet/v4l2rtspserver/blob/master/src/MJPEGVideoSource.cpp
Note that JPEG RTP are limited by the https://tools.ietf.org/html/rfc2435 :
3.1.5. Width: 8 bits
This field encodes the width of the image in 8-pixel multiples (e.g.,
a width of 40 denotes an image 320 pixels wide). The maximum width
is 2040 pixels.
3.1.6. Height: 8 bits
This field encodes the height of the image in 8-pixel multiples
(e.g., a height of 30 denotes an image 240 pixels tall). When
encoding interlaced video, this is the height of a video field, since
fields are individually JPEG encoded. The maximum height is 2040
pixels.
Then 3264x2448 is not possible.
Best Regards, Michel.
When I set the resolution for the stream at the camera maximum, it comes out all garbled. Here is the supported formats for my camera: `v4l2-ctl --list-formats-ext ioctl: VIDIOC_ENUM_FMT Type: Video Capture
`
Then when I run the command...
This image looks distorted and the resolution on the client comes back as 1216x400