File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -77,18 +77,11 @@ func UnmarshalSDP(rawSDP []byte) ([]*core.Media, error) {
7777 }
7878 case core .CodecH265 :
7979 if codec .FmtpLine != "" {
80- // All three parameters are needed for a valid fmtp line. If we're missing one
81- // then discard the entire line. The bitstream should contain the data in NAL units
82- //
83- // Some camera brands (notable Hikvision) don't include the vps property, rendering the entire
84- // line invalid, because the sps property references the non-existent vps proper. This invalid
85- // data will cause FFmpeg to crash with a `Could not write header (incorrect codec parameters ?): Invalid data found when processing input`
86- // error when attempting to repackage the HEVC stream into outgoing RTSP stream. Removing the
87- // fmtp line forces FFmpeg to rely on the bitstream directly, fixing this issue.
88- valid := strings .Contains (codec .FmtpLine , "sprop-vps=" )
89- valid = valid && strings .Contains (codec .FmtpLine , "sprop-sps=" )
90- valid = valid && strings .Contains (codec .FmtpLine , "sprop-pps=" )
91- if ! valid {
80+ // all three parameters are needed for a valid fmtp line
81+ // https://github.com/AlexxIT/go2rtc/pull/1588
82+ if ! strings .Contains (codec .FmtpLine , "sprop-vps=" ) ||
83+ ! strings .Contains (codec .FmtpLine , "sprop-sps=" ) ||
84+ ! strings .Contains (codec .FmtpLine , "sprop-pps=" ) {
9285 codec .FmtpLine = ""
9386 }
9487 }
You can’t perform that action at this time.
0 commit comments