EliasKotlyar / Xiaomi-Dafang-Hacks

4.19k stars 1k forks source link

USB to Ethernet: VBR vs. FixedQP #1759

Closed SomebodySysop closed 3 years ago

SomebodySysop commented 3 years ago

This is an issue tracking system only. If you have general questions or are a newbie, please ask for help in our chat channel.

To make sure your issue can be resolved as quickly as possible please state your

Description

I have my camera directly wired to my network via USB to Ethernet connection. Response via ssh and web portal is very good. However, rtsp is only stable when camera uses "FixedQP". When I use "VBR" or any other method, connection is dropped constantly and consistently.

Can anyone tell me why that is? I have been using dafang-hacks on wyze and xiomi xiaofang cameras for 3 years now, and I would say the camera behaves as if it is on a bad wifi connection. I have had much better vbr reception with older firmware (2 years).

What did you do to debug the issue

I am using ContaCam nvr. rtsp connection is pretty stable with fixedqp format. Once I change it to vbr, with no other changes, connection immediately becomes unstable, dropping constantly.

The rtsp connection also appears to be fairly stable, even in vbr format, on VLC.

Evidence

Not really sure which logs are relevant here.

Please add snippets from the logfiles in:

best camera settings - 2021-07-11_17-20-28 more camera settings (unsupported size in ContaCam) - 2021-07-11_18-19-55

Contribute Back

If your issue was resolved, please consider contributing back to the project by creating a pull request to improve the code or documentation in order to avoid that this issue arises again for other people.

SomebodySysop commented 3 years ago

While I am still curious about the answer to this, I decided to do an end-around and simply transcode the rtsp stream to mjpeg, which the ContaCam nvr reads without issue and high efficiency.

Basically installed vlc onto a linux server running on my home network and used the rtsp to mjpeg vlc transcode command described in this post: https://www.reddit.com/r/selfhosted/comments/i5ug0t/how_to_restream_a_rtsp_live_video_in_a_way_that/g0smrkn?utm_source=share&utm_medium=web2x&context=3

And, BTW, the issue really must be with ContaCam because vlc is reading the same v4l2rtspserver rtsp stream.

No stutter, no drops. Clear, clean 1920 x 1080 stream. Problem effectively solved.