Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTSP streaming, SRS occasionally crashes. #2185

Closed
xujunjie21 opened this issue Feb 4, 2021 · 5 comments
Closed

RTSP streaming, SRS occasionally crashes. #2185

xujunjie21 opened this issue Feb 4, 2021 · 5 comments
Assignees
Labels
TransByAI Translated by AI/GPT. Won't fix We won't fix it.
Milestone

Comments

@xujunjie21
Copy link

xujunjie21 commented Feb 4, 2021

Description
SRS occasionally experiences service crashes, and after running for a period of time, the log continues to print the following situation. All SRS services cannot be used normally.

Description
Please describe the issue you have encountered.

1. SRS Version: 4.0.57
1. SRS Log:

[2021-01-26 22:06:05.572][Trace][30129][26354k23] shrinking, size=0, removed=1150, max=30000ms
[2021-01-26 22:06:05.628][Trace][30129][26354k23] shrinking, size=0, removed=1149, max=30000ms
[2021-01-26 22:06:05.726][Trace][30129][26354k23] shrinking, size=0, removed=1150, max=30000ms
[2021-01-26 22:06:05.786][Trace][30129][26354k23] shrinking, size=0, removed=1149, max=30000ms
[2021-01-26 22:06:05.889][Trace][30129][26354k23] shrinking, size=0, removed=1150, max=30000ms
[2021-01-26 22:06:05.947][Trace][30129][26354k23] shrinking, size=0, removed=1150, max=30000ms
[2021-01-26 22:06:06.047][Trace][30129][26354k23] shrinking, size=0, removed=1149, max=30000ms
[2021-01-26 22:06:06.100][Trace][30129][26354k23] shrinking, size=0, removed=1150, max=30000ms
[2021-01-26 22:06:06.198][Trace][30129][26354k23] shrinking, size=0, removed=1149, max=30000ms
[2021-01-26 22:06:06.250][Trace][30129][26354k23] shrinking, size=0, removed=1150, max=30000ms
[2021-01-26 22:06:06.351][Trace][
**Always appearing**

1. The configuration of SRS is as follows (Config):

  ingest test2local {
    enabled           on;
    input {
      type            stream;
**url             rtsp://address:6301/pss/111;**
    }
    ffmpeg            /usr/local/bin/ffmpeg;
     engine {
      enabled         on;
      output          rtmp://127.0.0.1:1935/M_1080_2K_4K?vhost=livepush.test.com/test;
    }
  }

Replay

How to replay bug?

Steps to reproduce the bug

How to replay bug?

  1. Start the collection and push the stream to the local vhost for a period of about 12-24 hours.
  2. SRS becomes unresponsive, leading to a complete crash of the system.

TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented Feb 28, 2021

See if you can find a way to reproduce it quickly.

TRANS_BY_GPT3

@winlinvip winlinvip changed the title SRS偶现服务崩溃 RTSP推流,SRS偶现服务崩溃 Feb 28, 2021
@ChvFily
Copy link

ChvFily commented Mar 9, 2021

On the basis of SRS, how can we modify it to accept RTSP streams?

This is my configuration: SRS parameters (but the streaming fails rtsp://IP:1935/live/test1)

max_connections     1000;
srs_log_tank        file;
srs_log_file        ./objs/srs.log;
daemon              on;
http_api {
    enabled         on;
    listen          1985;
    crossdomain     on;
}
http_server {
    enabled         on;
    listen          8585;
    dir             ./objs/nginx/html;
}
stats {
    network         0;
    disk            sda sdb xvda xvdb;
}
stream_caster {
    enabled         on;
    caster          rtsp;
    output          rtmp:// 127.0.0.1/[app]/[stream];
    listen          554;
    rtp_port_min    57200;
    rtp_port_max    57300;
}

vhost __defaultVhost__ {
    hls {
        enabled       on;
        hls_fragment  10;
        hls_window    60;
        hls_path     ./objs/nginx/html;
    }
    http_remux {
        enabled     on;
        mount       [vhost]/[app]/[stream].flv;
        hstrs       on;
    }
    http_hooks{
        enabled         on;
```
on_dvr          http://myip:8085/srs/dvr;
#on_connect     http://myip:8085/srs/connect;
```

Note: Please replace "myip" with the actual IP address.
    }
    dvr{
        enabled         on;
        #dvr_apply      dvr/a
        dvr_path        /var/www/html/[app]/[stream].[2006][01][02][15][04][05][999].mp4;
        dvr_plan        session;
        dvr_duration    30;
        dvr_wait_keyframe       on;
        time_jitter             full;
    }
}

``

`TRANS_BY_GPT3`

@ChvFily
Copy link

ChvFily commented Mar 21, 2021

According to the configuration in srs.conf, use ffmpeg to push the stream: ffmpeg -re -i 4k.mp4 -vcodec copy -codec copy -f rtsp rtsp://210.37..:554/live/rtsp
The error message printed by the server is:
error log: (I have hidden the IP with ***)

[2021-03-10 02:10:18.900][Warn][27390][971][32] client disconnect peer. ret=1009
[2021-03-10 02:10:49.566][Trace][27390][973] rtsp: serve 10.132.**.**
[2021-03-10 02:10:49.580][Trace][27390][973] rtsp: ignore header User-Agent=Lavf58.47.100
[2021-03-10 02:10:49.586][Trace][27390][973] rtsp: ignore header User-Agent=Lavf58.47.100
[2021-03-10 02:10:49.632][Trace][27390][973] rtsp: video(#0, H264, RTP/AVP/96), audio(#1, MPEG4-GENERIC, RTP/AVP/97, 48000HZ 2channels), rtsp://210.37.*.**:554/live/rtsp
[2021-03-10 02:10:49.638][Trace][27390][973] rtsp: ignore header User-Agent=Lavf58.47.100
[2021-03-10 02:10:49.639][Trace][27390][973] rtsp: #0 Video over RTP/AVP/UDP unicast client-port=27152-27153, server-port=57200-57201
[2021-03-10 02:10:49.646][Trace][27390][973] rtsp: ignore header User-Agent=Lavf58.47.100
[2021-03-10 02:10:49.646][Trace][27390][973] rtsp: #1 Audio over RTP/AVP/UDP unicast client-port=27154-27155, server-port=57202-57203
[2021-03-10 02:10:49.656][Trace][27390][973] rtsp: ignore header Range=npt=0.000-
[2021-03-10 02:10:49.656][Trace][27390][973] rtsp: ignore header User-Agent=Lavf58.47.100
[2021-03-10 02:10:59.668][Trace][27390][976] API server client, ip=210.37.**.**
[2021-03-10 02:10:59.668][Trace][27390][976] HTTP API GET http://210.37.*.**:1985/api/v1/streams/, content-length=-1, chunked=0/0


[2021-03-10 02:48:28.512][Trace][28510][556] rtsp: serve 10.132.147.42
[2021-03-10 02:48:28.531][Trace][28510][556] rtsp: ignore header User-Agent=Lavf58.47.100
[2021-03-10 02:48:28.535][Trace][28510][556] rtsp: ignore header User-Agent=Lavf58.47.100
[2021-03-10 02:48:28.579][Trace][28510][556] rtsp: video(#0, H264, RTP/AVP/96), audio(#1, MPEG4-GENERIC, RTP/AVP/97, 48000HZ 2channels), rtsp://210.37.8.148:554/live/rtsp
[2021-03-10 02:48:28.584][Trace][28510][556] rtsp: ignore header User-Agent=Lavf58.47.100
[2021-03-10 02:48:28.584][Trace][28510][556] rtsp: #0 Video over RTP/AVP/UDP unicast client-port=7204-7205, server-port=57200-57201
[2021-03-10 02:48:28.588][Trace][28510][556] rtsp: ignore header User-Agent=Lavf58.47.100
[2021-03-10 02:48:28.588][Trace][28510][556] rtsp: #1 Audio over RTP/AVP/UDP unicast client-port=7206-7207, server-port=57202-57203
[2021-03-10 02:48:28.594][Trace][28510][556] rtsp: ignore header Range=npt=0.000-
[2021-03-10 02:48:28.594][Trace][28510][556] rtsp: ignore header User-Agent=Lavf58.47.100

Both SRS 3.0 and 4.0 are experiencing the same error.

Does SRS support RTSP?

TRANS_BY_GPT3

@guofeiwu
Copy link

guofeiwu commented Apr 29, 2021

Both SRS3.0 and 4.0 have the same error.

Hello, may I ask if the issue has been resolved? I am encountering the same problem.

TRANS_BY_GPT3

@winlinvip winlinvip added the Won't fix We won't fix it. label Aug 22, 2021
@winlinvip
Copy link
Member

winlinvip commented Aug 22, 2021

In actual scenarios, there is no need to promote RTSP, so the RTSP server will be removed in the future.

The camera does not support pushing RTSP streams to SRS. It only supports Ingest/FFmpeg to pull RTSP streams from the camera and then forward them to SRS. Please refer to: #2304 (comment)

TRANS_BY_GPT3

@winlinvip winlinvip self-assigned this Aug 28, 2021
@winlinvip winlinvip added this to the 3.0 milestone Sep 4, 2021
@winlinvip winlinvip changed the title RTSP推流,SRS偶现服务崩溃 RTSP streaming, SRS occasionally crashes. Jul 28, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TransByAI Translated by AI/GPT. Won't fix We won't fix it.
Projects
None yet
Development

No branches or pull requests

4 participants