Skip to content
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

Add ability to parse Annex B stream in FU-A #100

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

thatdevsherry
Copy link

Summary

Add ability to break apart an Annex B stream sent in a FU-A. Fixes #68

Details

My V380 cam would send a FU-A after establishing RTSP connection. The FU-A was not conformant to spec.

FU-A (start) => [ sps header - sps - boundary - pps header - pps - boundary - idr header - idr ] # Annex B stream
FU-A (...) => [ sps header - idr ]
FU-A (end) => [ sps header - idr ]

Notice how all the frags have the same header (as they should be), but the start has an Annex B stream, meaning the last NAL picked from that packet is an IDR. This means the last NAL saved from first packet will be an IDR, but the next fragment will have... the header for SPS, but data for IDR, which is wrong.

It appears that the camera only does this for FU-A that has SPS & PPS. FU-As & single NAL units for other NAL types are conformant to spec.

I have only modified this logic for the FU-A flow.

Camera details

Name: V380 (It's a generic V380 outdoor camera)
Firmware: HwV380E31_WF8_PTZ_WIFI_20201218 (I had asked them for a firmware update file to enable RTSP support)

some cameras (e.g. v380 pro) send Annex B stream in FU-A, which is not
conformant to spec

add logic that checks for Annex B in FU-As and goes out of way to read
stream
@thatdevsherry thatdevsherry marked this pull request as ready for review March 28, 2024 21:28
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.

Exiting because of bad sps
1 participant