Handle malformed SDP from Hikvision cameras #1588
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds function to detect and remove malformed fmtp lines emitted by some camera when streaming H265. Malformed fmtp line can cause issues downstream, notably if FFmpeg is used to de-mux and remux the H265 stream without transcoding. Removal of malformed fmtp forces downstream process to extract the VPS, SPS and PPS value from bitstream NALs.
Example of an SDP with malformed fmtp:
Here there fmtp has a
sprop-sps
,sprop-pps
but is missingsprop-vps
. When attempting to decode with FFmpeg this non-fatal error will be emitted by the demuxer:And this fatal error will be emitted by the muxer when trying to restream using RTSP
Malformed fmtp lines is likely the cause of these issues: #1545, blakeblackshear/frigate#5585