SRS reports errors as follows:
[31m[2021-10-23 17:43:55.682][Error][31374][5ns94367][4] serve error
code=3001 : service cycle : rtmp: stream service : rtmp: receive
thread : handle publish message : rtmp: consume message : rtmp:
consume video : meta update video : demux SPS/PPS : avc decode
sequence header
This error means that SRS cannot obtain SPS and PPS information when receiving the code stream.
then select to disconnect from the streaming end. At this time, if the streaming end continues to push the stream, av_interleaved_write_frame (…) will report – 32, and the print log is:
broken pipe
The following encoder parameters need to be set:
if(octx->oformat->flags & AVFMT_GLOBALHEADER)
{
printf("set video GLOBAL_HEADER\n");
enc_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
}
octx Represents the output context
Explain PPS and SPS, two-byte areas in the code stream, which are very important for decoding. If they are not found, decoding will
fail because they store the parameters set by the encoder, such as the height and width of the video, the sampling rate of the audio, the number of channels, etc
explain the meaning of the above code segment. It will detect the encapsulation format of the output context to determine whether AV is set_CODEC_FLAG_GLOBAL_HEADER.
The function of the AV_CODEC_FLAG_GLOBAL_header flag is to add PPS and SPS in front of each keyframe from the original encoding to the byte area of extradate. Then, when decoding, you have to read PPS and SPS from extradate and put them in front of each keyframe.
Read More:
- SRS5.0 Error: srt serve error code=6006 [How to Solve]
- [Solved] VINS-MONO: integer_sequence_algorithm.h:64:21: error: ‘integer_sequence’ is not a member of ‘std’
- Python draw error: ValueError: ‘color’ kwarg must be a color or sequence of color specs. For a sequence of values to b
- Tomcat Error parsing HTTP request header Note: further occurrences of HTTP header parsing errors
- [Solved] error converting to execution character set illegal byte sequence
- [How to Solve] java.lang.IllegalArgumentException: Request header is too large
- Implement base64_decode in GO language to solve the problem of illegal characters
- [Solved] PCH Warning: header stop not at file scope
- Error (17) solves the problem of losing the request header of multithread asynchronous feign call
- [Solved] Opencv error: assertion__acrt_first_block == header
- [Solved] Browser Access Error: Request Header or Cookie too large
- [Solved] Nginx Error: 400 Request Header Or Cookie Too Large
- [Solved] A-LOAM Ceres Compile Error: error: ‘integer_sequence’ is not a member of ‘std‘
- jupyter notebook Sets Default Browser Error: SyntaxError: (unicode error) ‘utf-8‘ codec can‘t decode byte 0xd4
- [Solved] BLAST Database error: Error pre-fetching sequence data
- [Solved] fatal error: bits/libc-header-start.h: No such file or directory
- [Solved] redis Error: AttributeError: ‘list‘ object has no attribute ‘decode‘
- Mac Vscode C++ Customize Header File Error: linker command failed
- ApplicationContext.xml file header error Referenced file contains errors