It's easy to use openrtsp in live555 to save the h264 file.
However, the h264 file stored by the attacker cannot be directly played by VCL.
The h264 files stored in vcl of the same rtsp source can be directly played.
After research, it is found that openrtsp does notSDP
IncludingSPS
&Save PPS data to a file
Set
The first two 00 00 01 data of the h264 file saved by VCL isSPS
&PPS Replication
The files saved by openrtsp can be played at the beginning.
Modification Method
} Else if (strcmp (subsession-> mediumname (), "video") = 0 & <br/> (strcmp (subsession-> codecname (), "h264 ") = 0) {<br/> // for H. 264 video stream, we use a special sink that insert start_codes: <br/> unsigned int num = 0; <br/> sproprecord * SPS = parsespropparametersets (subsession-> fmtp_spropparametersets (), num); <br/> filesink = hsf-videofilesink: createnew (* ENV, outfilename, <br/> filesinkbuffersize, onefileperframe); <br/> struct timeval TV = {0, 0 }; <br/> unsigned char start_code [4] = {0x00, 0x00, 0x00, 0x01}; <br/> filesink-> adddata (start_code, 4, TV); <br/> filesink-> adddata (SPS [0]. spropbytes, SPS [0]. sproplength, TV); <br/> filesink-> adddata (start_code, 4, TV); <br/> filesink-> adddata (SPS [1]. spropbytes, SPS [1]. sproplength, TV); <br/> Delete [] SPS; <br/>} else {