Closed WenzhiShao closed 2 years ago
What is the stack of coredump like? Can you execute bt
to check?
How high is the video bitrate?
TRANS_BY_GPT3
Hello, the content of the stack frame is as follows. The term "high bitrate" was a mistake on my part. After checking, I found that it is a regular video with a resolution of 1920x1080, 25fps, and 4081kbps. It is just higher compared to the default source.flv file. When I experimented, I noticed that this issue does not occur when pushing the source.flv file.
#1 0x000055ec3249e585 in SrsConfig::get_vhost_coworkers (this=0x55ec33e6d300,
vhost="__defaultVhost__") at src/app/srs_app_config.cpp:4955
#2 0x000055ec3243f381 in SrsRtmpConn::playing (this=0x55ec33ffd670, source=
0x55ec34019660) at src/app/srs_app_rtmp_conn.cpp:615
#3 0x000055ec3243e6f0 in SrsRtmpConn::stream_service_cycle (this=0x55ec33ffd670)
at src/app/srs_app_rtmp_conn.cpp:532
#4 0x000055ec3243d5d8 in SrsRtmpConn::service_cycle (this=0x55ec33ffd670)
at src/app/srs_app_rtmp_conn.cpp:403
#5 0x000055ec3243c0d8 in SrsRtmpConn::do_cycle (this=0x55ec33ffd670)
at src/app/srs_app_rtmp_conn.cpp:216
#6 0x000055ec32445180 in SrsRtmpConn::cycle (this=0x55ec33ffd670)
at src/app/srs_app_rtmp_conn.cpp:1457
#7 0x000055ec3247481e in SrsFastCoroutine::cycle (this=0x55ec33ffd800)
at src/app/srs_app_st.cpp:272
#8 0x000055ec324748ba in SrsFastCoroutine::pfn (arg=0x55ec33ffd800)
at src/app/srs_app_st.cpp:287
#9 0x000055ec3258a969 in _st_thread_main () at sched.c:363
#10 0x000055ec3258b205 in st_thread_create (
start=0x55ec3247489a <SrsFastCoroutine::pfn(void*)>, arg=0x55ec33ffd800, joinable=1,
stk_size=65536) at sched.c:694
TRANS_BY_GPT3
You have enabled the origin cluster origin_cluster on;
, but did not follow the configuration of the origin cluster, so there are issues.
Of course, there should not be a coredump here.
TRANS_BY_GPT3
Confirming that it is a configuration issue, enabling the origin server cluster origin_cluster on;
without configuring cluster.coworkers
will cause a crash, and it happens consistently.
vector<string> SrsConfig::get_vhost_coworkers(string vhost)
{
vector<string> coworkers;
SrsConfDirective* conf = get_vhost(vhost);
if (!conf) {
return coworkers;
}
conf = conf->get("cluster");
if (!conf) {
return coworkers;
}
conf = conf->get("coworkers");
for (int i = 0; i < (int)conf->args.size(); i++) {
Because there is no check here.
This issue is essentially a configuration problem, not a common problem, so it will only be fixed in version 5.0.
TRANS_BY_GPT3
Description (描述)
SRS Version (版本): 5.0
Make sure to maintain the markdown structure.
SRS Log (日志):
Make sure to maintain the markdown structure.
SRS Config (配置):
Make sure to maintain the markdown structure.
listen 1935; max_connections 1000;
srs_log_tank file;
srs_log_file ./objs/server.log; daemon on; pid objs/server.pid; http_api { enabled on; listen 1985; } http_server { enabled on; listen 8080; dir ./objs/nginx/html; } rtc_server { enabled on; listen 8000; # UDP port
@see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#config-candidate
} vhost defaultVhost { hls { enabled on; } http_remux { enabled on; mount [vhost]/[app]/[stream].flv; } rtc { enabled on;
@see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#rtmp-to-rtc
}
Core was generated by `./objs/srs -c ./myconfig/server.conf'. Program terminated with signal SIGSEGV, Segmentation fault.
0 0x0000556fbfec8272 in std::vector<std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std:: cxx11::basic_string<char, std::char_traits, std::allocator > > >::size (this=0x30)
671 { return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); }
import cv2 import subprocess
RTMP server address
rtmp = r'rtmp://localhost/live/123' # You can change the "123" to any other value, such as 123321/456, etc.
Read the video and get its properties
You can also replace the camera 0 with an RTSP address for RTSP streaming.
cap = cv2.VideoCapture('./video/303.mp4') size = (int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)), int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))) sizeStr = str(size[0]) + 'x' + str(size[1]) command = ['ffmpeg', '-y', '-an', '-f', 'rawvideo', '-vcodec', 'rawvideo', '-pix_fmt', 'bgr24', '-s', sizeStr, '-r', '25', '-i', '-', '-c:v', 'libx264', '-pix_fmt', 'yuv420p', '-preset', 'ultrafast', '-f', 'flv', rtmp] pipe = subprocess.Popen(command, shell=False, stdin=subprocess.PIPE ) while cap.isOpened(): success, frame = cap.read() if success: if cv2.waitKey(1) & 0xFF == ord('q'): break pipe.stdin.write(frame.tostring()) cap.release() pipe.terminate()