srs icon indicating copy to clipboard operation
srs copied to clipboard

demux SPS/PPS : avc decode sequence header

Open tianyi14 opened this issue 2 years ago • 5 comments

Note: Please read FAQ before file an issue, see #2716

Description

On my side, I am using C++ to encode and push the stream. I want to know where the problem is with the error message from SRS. Is it missing the SPS (Sequence Parameter Set) or is there an extra one (seems to have no impact, as I have already fixed it before)?

  1. SRS Version: 5.0.89 windows

  2. SRS Log:

[2023-05-25 17:45:46.933][INFO][944][4pnjo38h] Hybrid cpu=0.00%,27MB, cid=1,0, timer=44,0,0, clock=0,0,1,1,31,1,1,0,0
[2023-05-25 17:45:51.935][INFO][944][4pnjo38h] Hybrid cpu=1.50%,27MB, cid=1,0, timer=44,0,0, clock=0,0,1,1,31,1,1,0,0
[2023-05-25 17:45:52.687][INFO][944][rjd97586] RTMP client ip=192.168.50.175:60549, fd=8, trace=, span=
[2023-05-25 17:45:52.691][INFO][944][rjd97586] complex handshake success
[2023-05-25 17:45:52.693][INFO][944][rjd97586] connect app, tcUrl=rtmp://192.168.50.174:1935/live, pageUrl=, swfUrl=, schema=rtmp, vhost=192.168.50.174, port=1935, app=live, args=null
[2023-05-25 17:45:52.694][INFO][944][rjd97586] protocol in.buffer=0, in.ack=0, out.ack=0, in.chunk=128, out.chunk=128
[2023-05-25 17:45:52.748][INFO][944][rjd97586] client identified, type=fmle-publish, vhost=192.168.50.174, app=live, stream=livestream, param=, duration=0ms
[2023-05-25 17:45:52.749][INFO][944][rjd97586] connected stream, tcUrl=rtmp://192.168.50.174:1935/live, pageUrl=, swfUrl=, schema=rtmp, vhost=__defaultVhost__, port=1935, app=live, stream=livestream, param=, args=null
[2023-05-25 17:45:52.751][INFO][944][rjd97586] new live source, stream_url=/live/livestream
[2023-05-25 17:45:52.751][INFO][944][rjd97586] source url=/live/livestream, ip=192.168.50.175, cache=1, is_edge=0, source_id=/
[2023-05-25 17:45:52.816][INFO][944][rjd97586] hls: win=60000ms, frag=10000ms, prefix=, path=./objs/nginx/html, m3u8=[app]/[stream].m3u8, ts=[app]/[stream]-[seq].ts, aof=2.00, floor=0, clean=1, waitk=1, dispose=0ms, dts_directly=1
[2023-05-25 17:45:52.819][INFO][944][rjd97586] ignore disabled exec for vhost=__defaultVhost__
[2023-05-25 17:45:52.833][INFO][944][rjd97586] start publish mr=0/350, p1stpt=20000, pnt=5000, tcp_nodelay=0
[2023-05-25 17:45:52.871][INFO][944][rjd97586] got metadata, width=1920, height=1080, vcodec=7, acodec=10
[2023-05-25 17:45:52.872][INFO][944][rjd97586] Drop ts segment, sequence_no=0, uri=livestream-0.ts, duration=0ms
[2023-05-25 17:45:52.873][INFO][944][rjd97586] cleanup when unpublish
[2023-05-25 17:45:52.873][INFO][944][rjd97586] TCP: before dispose resource(RtmpConn)(0x8000ee8d0), conns=1, zombies=0, ign=0, inz=0, ind=0
[2023-05-25 17:45:52.874][ERROR][944][rjd97586][4] serve error code=3001(HlsDecode)(HLS decode av stream failed) : 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
thread [944][rjd97586]: do_cycle() [./src/app/srs_app_rtmp_conn.cpp:248][errno=4]
thread [944][rjd97586]: service_cycle() [./src/app/srs_app_rtmp_conn.cpp:440][errno=4]
thread [944][rjd97586]: do_publishing() [./src/app/srs_app_rtmp_conn.cpp:987][errno=11]
thread [944][rjd97586]: consume() [./src/app/srs_app_recv_thread.cpp:380][errno=11]
thread [944][rjd97586]: handle_publish_message() [./src/app/srs_app_rtmp_conn.cpp:1122][errno=11]
thread [944][rjd97586]: process_publish_message() [./src/app/srs_app_rtmp_conn.cpp:1150][errno=11]
thread [944][rjd97586]: on_video_imp() [./src/app/srs_app_source.cpp:2419][errno=11]
thread [944][rjd97586]: video_avc_demux() [./src/kernel/srs_kernel_codec.cpp:806][errno=11]
thread [944][rjd97586]: avc_demux_sps_pps() [./src/kernel/srs_kernel_codec.cpp:833][errno=11](Interrupted system call)
[2023-05-25 17:45:52.875][INFO][944][fc56bg12] TCP: clear zombies=1 resources, conns=1, removing=0, unsubs=0
[2023-05-25 17:45:52.875][INFO][944][rjd97586] TCP: disposing #0 resource(RtmpConn)(0x8000ee8d0), conns=1, disposing=1, zombies=0
[2023-05-25 17:45:56.936][INFO][944][4pnjo38h] Hybrid cpu=1.59%,27MB, cid=1,0, timer=44,0,0, clock=0,0,1,1,31,1,1,0,0
[2023-05-25 17:46:01.944][INFO][944][4pnjo38h] Hybrid cpu=0.00%,27MB, cid=3,1, timer=44,0,0, clock=0,0,1,1,31,1,1,0,0, free=1, objs=(pkt:0,raw:0,fua:0,msg:1,oth:0,buf:0)
[2023-05-25 17:46:04.247][INFO][944][9e6229uf] sig=2, user terminate program, fast quit
[2023-05-25 17:46:04.665][INFO][944][9e6229uf] cleanup for quit signal fast=1, grace=0

  1. SRS Config:
listen              1935;
max_connections     1000;
daemon              off;
srs_log_tank        console;

http_server {
    enabled         on;
    listen          8080;
    dir             ./objs/nginx/html;
}

# Default vhost configuration section
vhost __defaultVhost__ {
	publish {
        parse_sps   off;
    }

    hls {
        enabled         on;
        hls_path        ./objs/nginx/html;
        hls_fragment    10;
        hls_window      60;
    }
}

Expect

The streaming is expected to be error-free.

TRANS_BY_GPT3

tianyi14 avatar May 25 '23 11:05 tianyi14

if (!stream->require(6)) { return srs_error_new(ERROR_HLS_DECODE_ERROR, "avc decode sequence header"); } I found that the exception was thrown here. I set parse_sps off in the configuration file to disable SPS parsing. Why is it still happening like this?

TRANS_BY_GPT3

tianyi14 avatar May 25 '23 11:05 tianyi14

@tianyi14 you how to resolve the problem? I have the same problem

lshuangquan avatar Feb 24 '25 07:02 lshuangquan

  1. Can the issue be reproduced? Please provide a detailed description of the steps to reproduce the problem, and if possible, upload the test file.
  2. Is there a core dump file available?

TRANS_BY_GPT4

duiniuluantanqin avatar Feb 24 '25 08:02 duiniuluantanqin

srs version: 5.0.213 c++ publish stream code :

Image

srs server error msg:

Image

lshuangquan avatar Feb 26 '25 03:02 lshuangquan

Please record the stream and send the file over.

TRANS_BY_GPT4

duiniuluantanqin avatar Mar 24 '25 06:03 duiniuluantanqin

Cannot reproduce this issue.

winlinvip avatar Oct 30 '25 02:10 winlinvip