ZLMediaKit icon indicating copy to clipboard operation
ZLMediaKit copied to clipboard

使用videoStack多视频拼接功能时程序崩溃闪退

Open zxvgf opened this issue 1 year ago • 5 comments

Phenomenon Description

In the Windows environment of zlmediakit, when calling the videoStack start interface using Postman, the mediaserver window flashes and crashes.

How to reproduce?

First, I enabled the three enables specified in the documentation during compilation, and when starting mediaServer.exe, I was informed that libx264.dll was missing. So I renamed the compiled libx264-164.dll to libx264.dll, and successfully started it. There was no problem with pushing and pulling streams. Then I pushed an RTSP stream using OBS Studio, and Postman modified the 16 streams in the interface example to the pushed stream. After that, Postman displayed success. After waiting for 5 seconds, mediaServer flashed and crashed.

Related logs or screenshots

Expand to view detailed logs
#Please paste the detailed log here!
2024-09-19 16:03:19.548 I [MediaServer.exe] [24420-18156] main.cpp:256 start_main | ZLMediaKit(git hash:7c5ba5a/2024-09-10T10:59:44+08:00,branch:master,build time:2024-09-18T16:18:54) 2024-09-19 16:03:19.560 D [MediaServer.exe] [24420-18156] SSLBox.cpp:174 setContext | Add certificate of: default.zlmediakit.com 2024-09-19 16:03:19.561 D [MediaServer.exe] [24420-stamp thread] util.cpp:366 operator () | Stamp thread started 2024-09-19 16:03:19.568 I [MediaServer.exe] [24420-18156] EventPoller.cpp:594 EventPollerPool | EventPoller created size: 16 2024-09-19 16:03:19.570 I [MediaServer.exe] [24420-18156] main.cpp:360 start_main | 已启动http api 接口 2024-09-19 16:03:19.570 I [MediaServer.exe] [24420-18156] main.cpp:362 start_main | 已启动http hook 接口 2024-09-19 16:03:19.572 I [MediaServer.exe] [24420-18156] TcpServer.cpp:221 start_l | TCP server listening on [::]: 554 2024-09-19 16:03:19.574 I [MediaServer.exe] [24420-18156] TcpServer.cpp:221 start_l | TCP server listening on [::]: 1935 2024-09-19 16:03:19.576 I [MediaServer.exe] [24420-18156] TcpServer.cpp:221 start_l | TCP server listening on [::]: 80 2024-09-19 16:03:19.578 I [MediaServer.exe] [24420-18156] TcpServer.cpp:221 start_l | TCP server listening on [::]: 443 2024-09-19 16:03:19.580 I [MediaServer.exe] [24420-18156] UdpServer.cpp:123 start_l | UDP server bind to [::]: 10000 2024-09-19 16:03:19.582 W [MediaServer.exe] [24420-18156] EventPoller.cpp:112 addEvent | take time: 15ms, thread may be overloaded 2024-09-19 16:03:19.583 I [MediaServer.exe] [24420-18156] TcpServer.cpp:221 start_l | TCP server listening on [::]: 10000 2024-09-19 16:03:19.585 I [MediaServer.exe] [24420-18156] UdpServer.cpp:123 start_l | UDP server bind to [::]: 8000 2024-09-19 16:03:19.588 I [MediaServer.exe] [24420-18156] TcpServer.cpp:221 start_l | TCP server listening on [::]: 8000 2024-09-19 16:03:19.588 D [MediaServer.exe] [24420-event poller 13] RtmpSession.cpp:128 operator () | 1-1068(192.168.2.142:55154) publish 回复时间:0ms 2024-09-19 16:03:19.590 I [MediaServer.exe] [24420-18156] UdpServer.cpp:123 start_l | UDP server bind to [::]: 9000 2024-09-19 16:03:19.797 I [MediaServer.exe] [24420-event poller 13] MediaSource.cpp:476 emitEvent | 媒体注册:rtmp://__defaultVhost__/live/stream1/test9 2024-09-19 16:03:19.846 D [MediaServer.exe] [24420-event poller 13] MediaSink.cpp:162 emitAllTrackReady | All track ready use 62ms 2024-09-19 16:03:19.847 I [MediaServer.exe] [24420-event poller 13] MediaSource.cpp:476 emitEvent | 媒体注册:fmp4://__defaultVhost__/live/stream1/test9 2024-09-19 16:03:19.847 I [MediaServer.exe] [24420-event poller 13] MultiMediaSourceMuxer.cpp:562 onAllTrackReady | stream: rtmp://__defaultVhost__/live/stream1/test9 , codec info: H264[1920/1080/60] mpeg4-generic[48000/2/16] 2024-09-19 16:03:19.847 I [MediaServer.exe] [24420-event poller 13] MediaSource.cpp:476 emitEvent | 媒体注册:rtsp://__defaultVhost__/live/stream1/test9 2024-09-19 16:03:19.847 I [MediaServer.exe] [24420-event poller 13] MediaSource.cpp:476 emitEvent | 媒体注册:ts://__defaultVhost__/live/stream1/test9 2024-09-19 16:03:23.823 I [MediaServer.exe] [24420-event poller 13] MediaSource.cpp:476 emitEvent | 媒体注册:hls://__defaultVhost__/live/stream1/test9 2024-09-19 16:03:25.698 D [MediaServer.exe] [24420-event poller 14] RtspPlayer.cpp:92 play | rtsp://192.168.2.142/live/stream1/test9 null null 0 2024-09-19 16:03:25.699 I [MediaServer.exe] [24420-event poller 14] Transcode.cpp:671 inputFrame | sws_getContext:yuv420p -> yuv420p 2024-09-19 16:03:25.699 I [MediaServer.exe] [24420-event poller 14] Transcode.cpp:671 inputFrame | sws_getContext:yuv420p -> yuv420p Last message repeated 2 times 2024-09-19 16:03:25.704 D [MediaServer.exe] [24420-event poller 14] WebApi.cpp:266 http api debug | # request: POST /index/api/stack/start?secret=XILeNmLQy3SB3ADfLsu69bIyQm2FEZJt # header: Accept : */* Accept-Encoding : gzip, deflate, br Authorization : bearer sk-23a72f7d52ad4e20aba380dcdaeb8396 Connection : keep-alive Content-Length : 1325 Content-Type : application/json Host : 192.168.2.142 Postman-Token : 9ffd9501-3da7-4eea-b0c7-fb99b4fe7d7c User-Agent : PostmanRuntime/7.42.0 # content: { "id": "stack_test", "row": 4, "col": 4, "gapv": 0.002, "gaph": 0.001, "width": 1920, "height": 1080, "url": [ [ "rtsp://192.168.2.142/live/stream1/test9", "rtsp://192.168.2.142/live/stream1/test9", "rtsp://192.168.2.142/live/stream1/test9", "rtsp://192.168.2.142/live/stream1/test9" ], [ "rtsp://192.168.2.142/live/stream1/test9", "rtsp://192.168.2.142/live/stream1/test9", "rtsp://192.168.2.142/live/stream1/test9", "rtsp://192.168.2.142/live/stream1/test9" ], [ "rtsp://192.168.2.142/live/stream1/test9", "rtsp://192.168.2.142/live/stream1/test9", "rtsp://192.168.2.142/live/stream1/test9", "rtsp://192.168.2.142/live/stream1/test9" ], [ "rtsp://192.168.2.142/live/stream1/test9", "rtsp://192.168.2.142/live/stream1/test9", "rtsp://192.168.2.142/live/stream1/test9", "rtsp://192.168.2.142/live/stream1/test9" ] ], "span": [ [ [0, 0], [1, 1] ], [ [3, 2], [3, 3] ] ] } # response: { "code" : 0, "msg" : "success" }

2024-09-19 16:03:25.708 I [MediaServer.exe] [24420-event poller 15] RtspSession.cpp:819 handleReq_Play | 3-1228(192.168.2.142:55190) rtsp seekTo(ms):0 2024-09-19 16:03:25.708 D [MediaServer.exe] [24420-event poller 14] RtspPlayer.cpp:494 handleResPAUSE | seekTo(ms):0 2024-09-19 16:03:25.708 W [MediaServer.exe] [24420-event poller 14] RtspPlayer.cpp:710 onPlayResult_l | 0 rtsp play success 2024-09-19 16:03:25.709 I [MediaServer.exe] [24420-event poller 14] Transcode.cpp:257 getCodec_l | got decoder:h264 2024-09-19 16:03:25.709 I [MediaServer.exe] [24420-event poller 14] Transcode.cpp:268 getCodec_l | got decoder:h264 2024-09-19 16:03:25.711 I [MediaServer.exe] [24420-event poller 14] Transcode.cpp:453 FFmpegDecoder | 打开解码器成功:h264 2024-09-19 16:03:25.713 W [MediaServer.exe] [24420-event poller 14] Transcode.cpp:142 addDecodeTask | decode thread start drop frame

Configuration

Please expand to view detailed configuration
#Please paste the contents of the config.ini file here!

Various environment information

  • Code commit record/git commit hash:
  • Operating system and version:
  • Hardware information:
  • crash backtrace:
#Paste the crash information backtrace here
  • Other information to be supplemented:

现象描述

在windows环境下的zlmediakit,使用postman调用videoStack的start接口时出现了mediaserver窗口闪退崩溃。

如何复现?

首先我在编译时启用了文档里规定的三个enable,然后在启动mediaServer.exe时,告知我缺少libx264.dll,于是我将已经编译好的libx264-164.dll改名为libx264.dll,成功启动了,推流拉流没有问题。 然后我使用obsstudio推送了一个rtsp流,然后postman按照接口示例,将示例中的16个流都改为了这个推送上去的流。 之后postman显示success。 等待5秒后,mediaServer闪退。

相关日志或截图

展开查看详细日志
#详细日志粘在这里!
2024-09-19 16:03:19.548 I [MediaServer.exe] [24420-18156] main.cpp:256 start_main | ZLMediaKit(git hash:7c5ba5a/2024-09-10T10:59:44+08:00,branch:master,build time:2024-09-18T16:18:54) 2024-09-19 16:03:19.560 D [MediaServer.exe] [24420-18156] SSLBox.cpp:174 setContext | Add certificate of: default.zlmediakit.com 2024-09-19 16:03:19.561 D [MediaServer.exe] [24420-stamp thread] util.cpp:366 operator () | Stamp thread started 2024-09-19 16:03:19.568 I [MediaServer.exe] [24420-18156] EventPoller.cpp:594 EventPollerPool | EventPoller created size: 16 2024-09-19 16:03:19.570 I [MediaServer.exe] [24420-18156] main.cpp:360 start_main | 已启动http api 接口 2024-09-19 16:03:19.570 I [MediaServer.exe] [24420-18156] main.cpp:362 start_main | 已启动http hook 接口 2024-09-19 16:03:19.572 I [MediaServer.exe] [24420-18156] TcpServer.cpp:221 start_l | TCP server listening on [::]: 554 2024-09-19 16:03:19.574 I [MediaServer.exe] [24420-18156] TcpServer.cpp:221 start_l | TCP server listening on [::]: 1935 2024-09-19 16:03:19.576 I [MediaServer.exe] [24420-18156] TcpServer.cpp:221 start_l | TCP server listening on [::]: 80 2024-09-19 16:03:19.578 I [MediaServer.exe] [24420-18156] TcpServer.cpp:221 start_l | TCP server listening on [::]: 443 2024-09-19 16:03:19.580 I [MediaServer.exe] [24420-18156] UdpServer.cpp:123 start_l | UDP server bind to [::]: 10000 2024-09-19 16:03:19.582 W [MediaServer.exe] [24420-18156] EventPoller.cpp:112 addEvent | take time: 15ms, thread may be overloaded 2024-09-19 16:03:19.583 I [MediaServer.exe] [24420-18156] TcpServer.cpp:221 start_l | TCP server listening on [::]: 10000 2024-09-19 16:03:19.585 I [MediaServer.exe] [24420-18156] UdpServer.cpp:123 start_l | UDP server bind to [::]: 8000 2024-09-19 16:03:19.588 I [MediaServer.exe] [24420-18156] TcpServer.cpp:221 start_l | TCP server listening on [::]: 8000 2024-09-19 16:03:19.588 D [MediaServer.exe] [24420-event poller 13] RtmpSession.cpp:128 operator () | 1-1068(192.168.2.142:55154) publish 回复时间:0ms 2024-09-19 16:03:19.590 I [MediaServer.exe] [24420-18156] UdpServer.cpp:123 start_l | UDP server bind to [::]: 9000 2024-09-19 16:03:19.797 I [MediaServer.exe] [24420-event poller 13] MediaSource.cpp:476 emitEvent | 媒体注册:rtmp://__defaultVhost__/live/stream1/test9 2024-09-19 16:03:19.846 D [MediaServer.exe] [24420-event poller 13] MediaSink.cpp:162 emitAllTrackReady | All track ready use 62ms 2024-09-19 16:03:19.847 I [MediaServer.exe] [24420-event poller 13] MediaSource.cpp:476 emitEvent | 媒体注册:fmp4://__defaultVhost__/live/stream1/test9 2024-09-19 16:03:19.847 I [MediaServer.exe] [24420-event poller 13] MultiMediaSourceMuxer.cpp:562 onAllTrackReady | stream: rtmp://__defaultVhost__/live/stream1/test9 , codec info: H264[1920/1080/60] mpeg4-generic[48000/2/16] 2024-09-19 16:03:19.847 I [MediaServer.exe] [24420-event poller 13] MediaSource.cpp:476 emitEvent | 媒体注册:rtsp://__defaultVhost__/live/stream1/test9 2024-09-19 16:03:19.847 I [MediaServer.exe] [24420-event poller 13] MediaSource.cpp:476 emitEvent | 媒体注册:ts://__defaultVhost__/live/stream1/test9 2024-09-19 16:03:23.823 I [MediaServer.exe] [24420-event poller 13] MediaSource.cpp:476 emitEvent | 媒体注册:hls://__defaultVhost__/live/stream1/test9 2024-09-19 16:03:25.698 D [MediaServer.exe] [24420-event poller 14] RtspPlayer.cpp:92 play | rtsp://192.168.2.142/live/stream1/test9 null null 0 2024-09-19 16:03:25.699 I [MediaServer.exe] [24420-event poller 14] Transcode.cpp:671 inputFrame | sws_getContext:yuv420p -> yuv420p 2024-09-19 16:03:25.699 I [MediaServer.exe] [24420-event poller 14] Transcode.cpp:671 inputFrame | sws_getContext:yuv420p -> yuv420p Last message repeated 2 times 2024-09-19 16:03:25.704 D [MediaServer.exe] [24420-event poller 14] WebApi.cpp:266 http api debug | # request: POST /index/api/stack/start?secret=XILeNmLQy3SB3ADfLsu69bIyQm2FEZJt # header: Accept : */* Accept-Encoding : gzip, deflate, br Authorization : bearer sk-23a72f7d52ad4e20aba380dcdaeb8396 Connection : keep-alive Content-Length : 1325 Content-Type : application/json Host : 192.168.2.142 Postman-Token : 9ffd9501-3da7-4eea-b0c7-fb99b4fe7d7c User-Agent : PostmanRuntime/7.42.0 # content: { "id": "stack_test", "row": 4, "col": 4, "gapv": 0.002, "gaph": 0.001, "width": 1920, "height": 1080, "url": [ [ "rtsp://192.168.2.142/live/stream1/test9", "rtsp://192.168.2.142/live/stream1/test9", "rtsp://192.168.2.142/live/stream1/test9", "rtsp://192.168.2.142/live/stream1/test9" ], [ "rtsp://192.168.2.142/live/stream1/test9", "rtsp://192.168.2.142/live/stream1/test9", "rtsp://192.168.2.142/live/stream1/test9", "rtsp://192.168.2.142/live/stream1/test9" ], [ "rtsp://192.168.2.142/live/stream1/test9", "rtsp://192.168.2.142/live/stream1/test9", "rtsp://192.168.2.142/live/stream1/test9", "rtsp://192.168.2.142/live/stream1/test9" ], [ "rtsp://192.168.2.142/live/stream1/test9", "rtsp://192.168.2.142/live/stream1/test9", "rtsp://192.168.2.142/live/stream1/test9", "rtsp://192.168.2.142/live/stream1/test9" ] ], "span": [ [ [0, 0], [1, 1] ], [ [3, 2], [3, 3] ] ] } # response: { "code" : 0, "msg" : "success" }

2024-09-19 16:03:25.708 I [MediaServer.exe] [24420-event poller 15] RtspSession.cpp:819 handleReq_Play | 3-1228(192.168.2.142:55190) rtsp seekTo(ms):0 2024-09-19 16:03:25.708 D [MediaServer.exe] [24420-event poller 14] RtspPlayer.cpp:494 handleResPAUSE | seekTo(ms):0 2024-09-19 16:03:25.708 W [MediaServer.exe] [24420-event poller 14] RtspPlayer.cpp:710 onPlayResult_l | 0 rtsp play success 2024-09-19 16:03:25.709 I [MediaServer.exe] [24420-event poller 14] Transcode.cpp:257 getCodec_l | got decoder:h264 2024-09-19 16:03:25.709 I [MediaServer.exe] [24420-event poller 14] Transcode.cpp:268 getCodec_l | got decoder:h264 2024-09-19 16:03:25.711 I [MediaServer.exe] [24420-event poller 14] Transcode.cpp:453 FFmpegDecoder | 打开解码器成功:h264 2024-09-19 16:03:25.713 W [MediaServer.exe] [24420-event poller 14] Transcode.cpp:142 addDecodeTask | decode thread start drop frame

配置

展开查看详细配置
#config.ini内容粘在这里!

各种环境信息

  • 代码提交记录/git commit hash:
  • 操作系统及版本:
  • 硬件信息:
  • crash backtrace:
#崩溃信息backtrace粘贴至此
  • 其他需要补充的信息:

TRANS_BY_GITHUB_AI_ASSISTANT

zxvgf avatar Sep 19 '24 08:09 zxvgf

windows上 我没怎么测试过,你可以试下在 linux上是否正常

KkemChen avatar Sep 23 '24 13:09 KkemChen

image

I just pulled the latest code. On Windows, I installed x264 and ffmpeg using vcpkg and tested it, and it works normally. You might want to check again if there's a problem with your libx264 or if it's caused by another reason.

我刚拉最新的代码 在windows上使用vcpkg安装的x264以及ffmpeg 测试了一下,是能正常使用的。你要不再检查一下你libx264是不是有问题还是别的原因导致的

TRANS_BY_GITHUB_AI_ASSISTANT

KkemChen avatar Sep 23 '24 13:09 KkemChen

image

I just pulled the latest code. On Windows, I installed x264 and ffmpeg using vcpkg and tested it, and it works normally. You might want to check again if there's a problem with your libx264 or if it's caused by another reason.

我刚拉最新的代码 在windows上使用vcpkg安装的x264以及ffmpeg 测试了一下,是能正常使用的。你要不再检查一下你libx264是不是有问题还是别的原因导致的

TRANS_BY_GITHUB_AI_ASSISTANT

大佬 能提供下编译后的版本吗 我也想使用这个功能 多谢

IOTWord avatar Oct 17 '24 08:10 IOTWord

image I just pulled the latest code. On Windows, I installed x264 and ffmpeg using vcpkg and tested it, and it works normally. You might want to check again if there's a problem with your libx264 or if it's caused by another reason. 我刚拉最新的代码 在windows上使用vcpkg安装的x264以及ffmpeg 测试了一下,是能正常使用的。你要不再检查一下你libx264是不是有问题还是别的原因导致的 TRANS_BY_GITHUB_AI_ASSISTANT

大佬 能提供下编译后的版本吗 我也想使用这个功能 多谢

文件超大小限制了,没法直接传上来

KkemChen avatar Oct 18 '24 03:10 KkemChen

image I just pulled the latest code. On Windows, I installed x264 and ffmpeg using vcpkg and tested it, and it works normally. You might want to check again if there's a problem with your libx264 or if it's caused by another reason. 我刚拉最新的代码 在windows上使用vcpkg安装的x264以及ffmpeg 测试了一下,是能正常使用的。你要不再检查一下你libx264是不是有问题还是别的原因导致的 TRANS_BY_GITHUB_AI_ASSISTANT

大佬 能提供下编译后的版本吗 我也想使用这个功能 多谢

文件超大小限制了,没法直接传上来

麻烦 您看下您的QQ邮箱

IOTWord avatar Oct 18 '24 06:10 IOTWord