Skip to content

Fixes to resolve mimepart issues in the event stream from Hikvision cameras #51

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

xtelinco
Copy link

As mentioned in this issue #34 the Hikvision server code generates these types of errors when processing the stream of events from Hikvision cameras.

I have tracked this down to the Hikvision camera sending bogus --boundary lines at the end of some XML. So the mimepart parser sees this as an error and misses an event. This is because the mimepart parser sees

--boundary
--boundary
Content-Type: ...

I have added a filter to detect this and strip the bogus boundary.

Also the event stream generates image/jpeg type mime entries for some messages. These were completely unhandled and were processed as XML. These changes inspect the Content-Type header and only process the messages as XML if the content type suggests so. If the Content-Type is 'image/jpeg' you can now optionally send this to MQTT as well.

@xtelinco xtelinco marked this pull request as ready for review March 14, 2025 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant