chatop2020 / AKStream

AKStream是一套全平台(Linux,MacOS,Windows)、全架构(X86_64,Arm...)、全功能的流媒体管理控制接口平台。集成GB28181,RTSP,RTMP,HTTP等设备推拉流控制、PTZ控制、音视频文件录制管理、音视频文件裁剪合并等功能与一体
MIT License
1.17k stars 327 forks source link

新版本相机不能自动推流,以前没这个问题,可能是数据库问题,报错: #57

Closed wilicyy closed 1 year ago

wilicyy commented 1 year ago

{ "Code": "Sys_DataBaseLimited", "Message": "数据库操作受限,请检查相关参数,如分页查询时每页不能超过10000行,第一页从1开始而不是从0开始" }

wilicyy commented 1 year ago

推其他流时有报错: 2022-11-23 05:21:57,626 [89] DEBUG AKStream - [AKStreamWeb]->HTTP-INPUT->::ffff:127.0.0.1->POST->/MediaServer/WebHook/OnStreamChanged -> {"req":{"MediaServerId":"your_server_id","App":"rtp","Schema":"ts","Stream":"0AE1F0F5","Vhost":"defaultVhost","Regist":false}} 2022-11-23 05:21:57,626 [95] DEBUG AKStream - [AKStreamWeb]->HTTP-INPUT->::ffff:127.0.0.1->POST->/MediaServer/WebHook/OnStreamChanged -> {"req":{"MediaServerId":"your_server_id","App":"rtp","Schema":"rtsp","Stream":"0AE1F0F5","Vhost":"defaultVhost","Regist":false}} 2022-11-23 05:21:57,626 [94] DEBUG AKStream - [AKStreamWeb]->HTTP-INPUT->::ffff:127.0.0.1->POST->/MediaServer/WebHook/OnStreamChanged -> {"req":{"MediaServerId":"your_server_id","App":"rtp","Schema":"hls","Stream":"0AE1F0F5","Vhost":"defaultVhost","Regist":false}} 2022-11-23 05:21:57,627 [86] DEBUG AKStream - [AKStreamWeb]->HTTP-INPUT->::ffff:127.0.0.1->POST->/MediaServer/WebHook/OnStreamChanged -> {"req":{"MediaServerId":"your_server_id","App":"rtp","Schema":"rtmp","Stream":"0AE1F0F5","Vhost":"defaultVhost","Regist":false}} 2022-11-23 05:21:57,692 [95] DEBUG AKStream - [AKStreamWeb]->HTTP-OUTPUT->::ffff:127.0.0.1->POST->/MediaServer/WebHook/OnStreamChanged->StatusCode:200->Body: {"Msg":"success","Code":0} 2022-11-23 05:21:57,693 [89] DEBUG AKStream - [AKStreamWeb]->HTTP-OUTPUT->::ffff:127.0.0.1->POST->/MediaServer/WebHook/OnStreamChanged->StatusCode:200->Body: {"Msg":"success","Code":0} 2022-11-23 05:21:57,697 [94] DEBUG AKStream - [AKStreamWeb]->HTTP-OUTPUT->::ffff:127.0.0.1->POST->/MediaServer/WebHook/OnStreamChanged->StatusCode:200->Body: {"Msg":"success","Code":0} 2022-11-23 05:21:57,697 [89] DEBUG AKStream - [AKStreamWeb]->HTTP-INPUT->::ffff:127.0.0.1->POST->/MediaServer/WebHook/OnStreamChanged -> {"req":{"MediaServerId":"your_server_id","App":"rtp","Schema":"fmp4","Stream":"0AE1F0F5","Vhost":"defaultVhost","Regist":false}} 2022-11-23 05:21:57,698 [89] DEBUG AKStream - [AKStreamWeb]->HTTP-OUTPUT->::ffff:127.0.0.1->POST->/MediaServer/WebHook/OnStreamChanged->StatusCode:200->Body: {"Msg":"success","Code":0} 2022-11-23 05:21:57,698 [86] INFO AKStream - [AKStreamWeb]->收到WebHook-OnStreamChanged回调(流移除)->{"MediaServerId":"your_server_id","App":"rtp","Schema":"rtmp","Stream":"0AE1F0F5","Vhost":"defaultVhost","Regist":false} 2022-11-23 05:21:57,705 [86] ERROR AKStream - [AKStreamWeb]->HTTP-OUTPUT->::ffff:127.0.0.1->POST->/MediaServer/WebHook/OnStreamChanged->StatusCode:200->Object reference not set to an instance of an object.-> at AKStreamWeb.Attributes.LogAttribute.OnActionExecuted(ActionExecutedContext context) in /home/wilson/sgsstream/ivisionnet/src/AKStream/AKStreamWeb/Attributes/LogAttribute.cs:line 42 2022-11-23 05:21:57,713 [86] ERROR AKStream - [AKStreamWeb]->HTTP-OUTPUT->::ffff:127.0.0.1->POST->/MediaServer/WebHook/OnStreamChanged->StatusCode:500->Body: 抱歉,出错了 Object reference not set to an instance of an object. at AKStreamWeb.Services.WebHookService.OnStreamChanged(ReqForWebHookOnStreamChange req) in /home/wilson/sgsstream/ivisionnet/src/AKStream/AKStreamWeb/Services/WebHookService.cs:line 454 at lambda_method770(Closure , Object , Object[] ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.gAwaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gAwaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gAwaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Routing.EndpointMiddleware.gAwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at AKStreamWeb.ExceptionMiddleware.Invoke(HttpContext context) in /home/wilson/sgsstream/ivisionnet/src/AKStream/AKStreamWeb/ExceptionMiddleware.cs:line 39 2022-11-23 05:22:00,718 [94] DEBUG AKStream - [AKStreamWeb]->HTTP-INPUT->::ffff:127.0.0.1->POST->/MediaServer/WebHook/OnStreamChanged -> {"req":{"MediaServerId":"your_server_id","App":"rtp","Schema":"rtmp","Stream":"0AE1F0F5","Vhost":"defaultVhost","Regist":false}} 2022-11-23 05:22:00,719 [94] INFO AKStream - [AKStreamWeb]->收到WebHook-OnStreamChanged回调(流移除)->{"MediaServerId":"your_server_id","App":"rtp","Schema":"rtmp","Stream":"0AE1F0F5","Vhost":"defaultVhost","Regist":false} 2022-11-23 05:22:00,725 [94] ERROR AKStream - [AKStreamWeb]->HTTP-OUTPUT->::ffff:127.0.0.1->POST->/MediaServer/WebHook/OnStreamChanged->StatusCode:200->Object reference not set to an instance of an object.-> at AKStreamWeb.Attributes.LogAttribute.OnActionExecuted(ActionExecutedContext context) in /home/wilson/sgsstream/ivisionnet/src/AKStream/AKStreamWeb/Attributes/LogAttribute.cs:line 42 2022-11-23 05:22:00,730 [94] ERROR AKStream - [AKStreamWeb]->HTTP-OUTPUT->::ffff:127.0.0.1->POST->/MediaServer/WebHook/OnStreamChanged->StatusCode:500->Body: 抱歉,出错了 Object reference not set to an instance of an object. at AKStreamWeb.Services.WebHookService.OnStreamChanged(ReqForWebHookOnStreamChange req) in /home/wilson/sgsstream/ivisionnet/src/AKStream/AKStreamWeb/Services/WebHookService.cs:line 454 at lambda_method770(Closure , Object , Object[] ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gAwaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gAwaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at AKStreamWeb.ExceptionMiddleware.Invoke(HttpContext context) in /home/wilson/sgsstream/ivisionnet/src/AKStream/AKStreamWeb/ExceptionMiddleware.cs:line 39 2022-11-23 05:22:01,016 [94] DEBUG AKStream - [AKStreamWeb]->HTTP-INPUT->::ffff:127.0.0.1->POST->/MediaServer/WebHook/MediaServerKeepAlive -> {"req":{"IpV4Address":"192.168.1.5","IpV6Address":"240e:3b7:3227:34b0:a5a0:2472:9d9:e693","KeeperWebApiPort":6880,"Secret":"035c73f7-bb6b-4889-a715-d9eb2d1925cc","MediaServerId":"your_server_id","MediaServerPid":5138,"RecordPathList":[{"Key":92033425408.0,"Value":"/home/wilson/sgsstream/ivisionnet/Downloads/record1"},{"Key":92033425408.0,"Value":"/home/wilson/sgsstream/ivisionnet/Downloads/record2"}],"RtpPortMin":10001,"RtpPortMax":20000,"RandomPort":false,"ServerDateTime":"2022-11-23 05:22:01","PerformanceInfo":{"SystemType":"Linux","Architecture":"Unknown","OsName":"Linux 4.9.253-tegra","FrameworkVersion":".NET 6.0.11","CpuCores":6,"MemoryInfo":{"Total":7951360,"Used":5211136,"Free":2740224,"FreePercent":34.462,"UpdateTime":"2022-11-23 05:21:52"},"CpuLoad":28.4,"NetWorkStat":{"Mac":"48-B0-2D-2F-73-19","TotalSendBytes":119958678,"TotalRecvBytes":1579048701,"CurrentSendBytes":0,"CurrentRecvBytes":0,"UpdateTime":"2022-11-23 05:22:00"},"DriveInfo":[{"Name":"/","IsReady":true,"Total":251286650880.0,"Used":159253225472.0,"Free":92033425408.0,"FreePercent":36.625,"UpdateTime":"2022-11-23 05:20:21"}],"UpdateTime":"2022-11-23 05:22:00","UpTimeSec":1419.5716324},"ZlmHttpPort":6080,"ZlmHttpsPort":443,"ZlmRtspPort":554,"ZlmRtmpPort":1935,"ZlmRtspsPort":0,"ZlmRtmpsPort":0,"ZlmRecordFileSec":120,"UseSsl":false,"FirstPost":false,"AccessKey":"047I4WS1-U51UBO6W-1J4BT21P-MF17IT99-92J8WIHU-944Q4KIW","MediaServerIsRunning":true,"Version":"4045D50C"}} 2022-11-23 05:22:01,017 [94] INFO AKStream - [AKStreamWeb]->收到WebHook-MediaServerKeepAlive回调->"your_server_id" 2022-11-23 05:22:01,017 [94] DEBUG AKStream - [AKStreamWeb]->HTTP-OUTPUT->::ffff:127.0.0.1->POST->/MediaServer/WebHook/MediaServerKeepAlive->StatusCode:200->Body: {"RecommendTimeSynchronization":false,"ServerDateTime":"2022-11-23 05:22:01","NeedRestartMediaServer":false,"Rs":{"Code":"None","Message":"无错误"}}

wilicyy commented 1 year ago

拉相机的RTSP流也报错: { "Code": "MediaServer_WaitWebHookTimeOut", "Message": "等待流媒体服务器回调响应超时" } ZLMediaKit的LOG是: 2022-11-23 06:04:40.992 I MediaServer[5138-event poller 2] MediaSource.cpp:517 emitEvent | 媒体注册:hls://defaultVhost/live/81E6E541 2022-11-23 06:04:40.997 W MediaServer[5138-event poller 2] WebHook.cpp:179 operator() | hook http://127.0.0.1:5800/MediaServer/WebHook/OnStreamChanged 6ms,failed[bad http status code]:400:{ "aliveSecond" : 4, "app" : "live", "bytesSpeed" : 258843, "createStamp" : 1669154676, "isRecordingHLS" : true, "isRecordingMP4" : false, "mediaServerId" : "your_server_id", "originSock" : { "identifier" : "", "local_ip" : "192.168.1.5", "local_port" : 42171, "peer_ip" : "192.168.1.10", "peer_port" : 554 }, "originType" : 4, "originTypeStr" : "pull", "originUrl" : "rtsp://admin:sgs123456@192.168.1.10/stream1", "readerCount" : 0, "regist" : true, "schema" : "hls", "stream" : "81E6E541", "totalReaderCount" : 0, "tracks" : [ { "channels" : 1, "codec_id" : 4, "codec_id_name" : "PCMU", "codec_type" : 1, "loss" : 0.0, "ready" : true, "sample_bit" : 16, "sample_rate" : 8000 }, { "codec_id" : 0, "codec_id_name" : "H264", "codec_type" : 0, "fps" : 15.0, "height" : 1080, "loss" : 0.0, "ready" : true, "width" : 1920 } ], "vhost" : "defaultVhost" }

2022-11-23 06:04:44.001 W MediaServer[5138-event poller 2] WebHook.cpp:179 operator() | hook http://127.0.0.1:5800/MediaServer/WebHook/OnStreamChanged 4ms,failed[bad http status code]:400:{ "aliveSecond" : 4, "app" : "live", "bytesSpeed" : 258843, "createStamp" : 1669154676, "isRecordingHLS" : true, "isRecordingMP4" : false, "mediaServerId" : "your_server_id", "originSock" : { "identifier" : "", "local_ip" : "192.168.1.5", "local_port" : 42171, "peer_ip" : "192.168.1.10",

chatop2020 commented 1 year ago

这个已经修复过了,你拉新代码试试

wilicyy commented 1 year ago

新代码国标相机还是无法自动推流,好像是找不到HttpSession,ZLM报错是:

2022-11-24 21:06:02.645 T MediaServer[19674-event poller 1] HttpSession.cpp:119 onError | 20-49(192.168.1.5:57150) close connection after send http body completed. 2022-11-24 21:06:02.645 T MediaServer[19674-event poller 1] HttpSession.cpp:33 ~HttpSession | 20-49(192.168.1.5:57150) 2022-11-24 21:06:02.711 T MediaServer[19674-event poller 1] HttpSession.cpp:27 HttpSession | 21-49(192.168.1.5:57156) 2022-11-24 21:06:02.712 D MediaServer[19674-event poller 1] WebApi.cpp:249 http api debug |

request:

POST /index/api/listRtpServer

header:

Accept : application/json,text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8 Connection : Keep-Alive Content-Length : 49 Content-Type : application/json;charset=utf-8 Host : 192.168.1.5:6080 traceparent : 00-1df410ce443652b94406f0dac4bca728-0cb27ec0b8a6f573-00

content:

{"Secret":"035c73f7-bb6b-4889-a715-d9eb2d1925cc"}

response:

{ "code" : 0 }

2022-11-24 21:06:02.713 T MediaServer[19674-event poller 1] HttpSession.cpp:119 onError | 21-49(192.168.1.5:57156) end of file 2022-11-24 21:06:02.713 T MediaServer[19674-event poller 1] HttpSession.cpp:33 ~HttpSession | 21-49(192.168.1.5:57156) 2022-11-24 21:06:03.213 T MediaServer[19674-event poller 1] HttpSession.cpp:27 HttpSession | 22-50(127.0.0.1:33429) 2022-11-24 21:06:03.225 D MediaServer[19674-event poller 1] WebApi.cpp:249 http api debug |

request:

POST /index/hook/on_server_keepalive

header:

Accept : / Accept-Language : zh-CN,zh;q=0.8 Connection : keep-alive Content-Length : 378 Content-Type : application/json Host : 127.0.0.1 User-Agent : ZLMediaKit(git hash:9fd5152/2022-11-19T09:52:10+08:00,branch:master,build time:2022-11-22T08:37:19)

content:

{ "data" : { "Buffer" : 7, "BufferLikeString" : 1, "BufferList" : 0, "BufferRaw" : 6, "Frame" : 0, "FrameImp" : 0, "MediaSource" : 0, "MultiMediaSourceMuxer" : 0, "RtmpPacket" : 0, "RtpPacket" : 0, "Socket" : 58, "TcpClient" : 0, "TcpServer" : 39, "TcpSession" : 1, "UdpServer" : 18, "UdpSession" : 0 }, "mediaServerId" : "your_server_id" }

wilicyy commented 1 year ago

新代码国标相机还是无法自动推流,好像是找不到HttpSession,ZLM报错是:

2022-11-24 21:06:02.645 T MediaServer[19674-event poller 1] HttpSession.cpp:119 onError | 20-49(192.168.1.5:57150) close connection after send http body completed. 2022-11-24 21:06:02.645 T MediaServer[19674-event poller 1] HttpSession.cpp:33 ~HttpSession | 20-49(192.168.1.5:57150) 2022-11-24 21:06:02.711 T MediaServer[19674-event poller 1] HttpSession.cpp:27 HttpSession | 21-49(192.168.1.5:57156) 2022-11-24 21:06:02.712 D MediaServer[19674-event poller 1] WebApi.cpp:249 http api debug |

request:

POST /index/api/listRtpServer

header:

Accept : application/json,text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8 Connection : Keep-Alive Content-Length : 49 Content-Type : application/json;charset=utf-8 Host : 192.168.1.5:6080 traceparent : 00-1df410ce443652b94406f0dac4bca728-0cb27ec0b8a6f573-00

content:

{"Secret":"035c73f7-bb6b-4889-a715-d9eb2d1925cc"}

response:

{ "code" : 0 }

2022-11-24 21:06:02.713 T MediaServer[19674-event poller 1] HttpSession.cpp:119 onError | 21-49(192.168.1.5:57156) end of file 2022-11-24 21:06:02.713 T MediaServer[19674-event poller 1] HttpSession.cpp:33 ~HttpSession | 21-49(192.168.1.5:57156) 2022-11-24 21:06:03.213 T MediaServer[19674-event poller 1] HttpSession.cpp:27 HttpSession | 22-50(127.0.0.1:33429) 2022-11-24 21:06:03.225 D MediaServer[19674-event poller 1] WebApi.cpp:249 http api debug |

request:

POST /index/hook/on_server_keepalive

header:

Accept : / Accept-Language : zh-CN,zh;q=0.8 Connection : keep-alive Content-Length : 378 Content-Type : application/json Host : 127.0.0.1 User-Agent : ZLMediaKit(git hash:9fd5152/2022-11-19T09:52:10+08:00,branch:master,build time:2022-11-22T08:37:19)

content:

{ "data" : { "Buffer" : 7, "BufferLikeString" : 1, "BufferList" : 0, "BufferRaw" : 6, "Frame" : 0, "FrameImp" : 0, "MediaSource" : 0, "MultiMediaSourceMuxer" : 0, "RtmpPacket" : 0, "RtpPacket" : 0, "Socket" : 58, "TcpClient" : 0, "TcpServer" : 39, "TcpSession" : 1, "UdpServer" : 18, "UdpSession" : 0 }, "mediaServerId" : "your_server_id" }

chatop2020 commented 1 year ago

国标我这两天自己测试过,正常的,你再拉新代码试试

wilicyy commented 1 year ago

拉的最新代码测试了下,国标相机自动接入后,写数据库的服务器ID错了,还是不能自动推流,上个月可以的: 2022-11-25 05-44-04屏幕截图

chatop2020 commented 1 year ago

服务器id哪错了?unkonw这个? 如果是这个明显就是没激活麻