deepch / RTSPtoWeb

RTSP Stream to WebBrowser
MIT License
1.26k stars 300 forks source link

panic: runtime error: index out of range [1] with length 0 #98

Open Links2004 opened 2 years ago

Links2004 commented 2 years ago

Hi,

I tried to connect RTSPtoWeb to my cameras some of them are working fine, but others are crashing the RTSPtoWeb server If I try to watch them in the demo UI. the type of stream used in the UI makes no difference.

log with debug enabled:

2022/02/19 20:55:21 [RTSP/1.0 200 OK                                                                                                   
CSeq: 2                                                                                                                                
Content-Base: rtsp://rtsp.xxxxxx:8554/carport_2/                                                                
Content-Length: 189                                                                                                                    
Content-Type: application/sdp                                                                                                          
Server: gortsplib                                                                                                                      

v=0                                                                                                                                    
o=- 0 0 IN IP4 127.0.0.1                                                                                                               
s=Stream                                                                                                                               
c=IN IP4 0.0.0.0                                                                                                                       
t=0 0                                                                                                                                  
m=video 0 RTP/AVP 96                                                                                                                   
a=rtpmap:96 H264/90000                                                                                                                 
a=fmtp:96 packetization-mode=1; sprop-parameter-sets=,                                                                                 
a=control:trackID=0                                                                                                                    
]                                                                                                                                      
2022/02/19 20:55:21 [SETUP rtsp://rtsp.xxxxxx:8554/carport_2/trackID=0 RTSP/1.0                                 
CSeq: 3                                                                                                                                
Transport: RTP/AVP/TCP;unicast;interleaved=0-1                                                                                         
User-Agent: Lavf58.76.100                                                                                                              

]                                                                                                                                      
2022/02/19 20:55:21 [RTSP/1.0 200 OK                                                                                                   
CSeq: 3                                                                                                                                
Server: gortsplib                                                                                                                      
Session: 2386298836;timeout=60                                                                                                         
Transport: RTP/AVP/TCP;unicast;interleaved=0-1;ssrc=70991763                                                                           

]                                                                                                                                      
panic: runtime error: index out of range [1] with length 0                                                                             

goroutine 210 [running]:                                                                                                               
github.com/deepch/vdk/codec/h264parser.NewCodecDataFromSPSAndPPS({0x1283658?, 0x0?, 0x0?}, {0x1283658?, 0x0?, 0x0?})                   
    /go/pkg/mod/github.com/deepch/vdk@v0.0.0-20220210205025-4054700600bf/codec/h264parser/parser.go:703 +0x485                         
github.com/deepch/vdk/format/rtspv2.Dial({0x1, {0xc0004288c0, 0x38}, 0xb2d05e00, 0x12a05f200, 0x1, 0x1, 0x0})                          
    /go/pkg/mod/github.com/deepch/vdk@v0.0.0-20220210205025-4054700600bf/format/rtspv2/client.go:161 +0xdde                            
main.StreamServerRunStream({0xc000224349, 0x9}, {0xc00022435b, 0x1}, 0xc00036c000)                                                     
    /go/src/app/streamCore.go:68 +0x166                                                                                                
main.StreamServerRunStreamDo({0xc000224349, 0x9}, {0xc00022435b, 0x1})                                                                 
    /go/src/app/streamCore.go:43 +0x465                                                                                                
created by main.(*StorageST).StreamChannelRun                                                                                          
    /go/src/app/storageStreamChannel.go:49 +0x33e  
deepch commented 2 years ago

no sps and pps on sdp i fix it

deepch commented 2 years ago

sorry you can say camera model sprop-parameter-sets=nill strange

Links2004 commented 2 years ago

the problem happens with my Jovision JVS-N815-B-PE

datasheet: https://www.pollin.de/productdownloads/D580917D.PDF

image

deepch commented 2 years ago

you can share you stream over internet

Links2004 commented 2 years ago

sharing is not easy since they are in a Isolated Network. will a TCP dump of the connection help?

deepch commented 2 years ago

no ok im emulate it

Links2004 commented 2 years ago

Hi, any updates on this? I really link RTSPtoWeb but I currently can not use it for all my cameras.

deepch commented 2 years ago

Hello

Give me access to your camera.