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

GB28181: Internal network is normal, external network mapping is abnormal, using FFmpeg is normal #2773

Closed
cfeigithub opened this issue Dec 7, 2021 · 7 comments
Assignees
Labels
GB28181 For GB28181. TransByAI Translated by AI/GPT. Won't fix We won't fix it.

Comments

@cfeigithub
Copy link

cfeigithub commented Dec 7, 2021

Note: Before asking a question, please read the FAQ (Please read FAQ before filing an issue) #2716

Description

Please describe the issue you encountered:
GB28181: It works fine when using the internal network, and I can register and control the camera using the external network. However, I am unable to view the video. Additionally, the channels are initially available but disappear after a while.

  1. SRS Version: feature/gb28181

  2. The SRS log is as follows:

[2021-12-62 15:52:18.584][Trace][1117][4s55gi4] gb28181: client id-34020Q00132001634200Q131001, strem idle timeout , stop![2021-12-0215:52:88.584][Trace][1117][595gk4] gb28181: client id=-34020008132000016340200013100001 rtup muxer is remove
[2021-12-02 15:52:08.584][Trace][21117][qs595gk4] client finished.
[2021-12-02 15:52:08.584][Trace][21117][5577i380] cleanup when unpublish
  1. The SRS configuration is as follows:
Note: The CANDIDATE configuration file has been replaced with the external network address.
# push gb28181 stream to SRS.
# push gb28181 stream to SRS.

listen                  1935;
max_connections         1000;
daemon              on;
srs_log_tank        console;

http_api {
    enabled         on;
    listen          1985;
}

http_server {
    enabled         on;
    listen          8080;
}

stats {
    network         0;
}

stream_caster {
    enabled             on;
    caster              gb28181;

    # Forward the stream to the rtmp server address and port.
    # TODO: https://github.com/ossrs/srs/pull/1679/files#r400875104
    # [stream] is the VideoChannelCodecID for sip
    # The automatically created channel [stream] is 'chid[ssrc]', where [ssrc] is the rtp ssrc
    # [ssrc] is the ssrc in rtp
    output              rtmp://127.0.0.1:1935/live/[stream];
    
    # Multiplexing port for receiving rtp streams from the device end
    listen              9000;
    # Multiplexing port type, on for TCP, off for UDP
    # Default: on
    tcp_enable            on;

    # Range of RTP receiving listening ports, minimum value
    rtp_port_min        58200;
    # Range of RTP receiving listening ports, maximum value
    rtp_port_max        58300;

    # Whether to wait for a keyframe before forwarding,
    # off: No need to wait, forward directly
    # on: Wait for the first keyframe before forwarding
    wait_keyframe       on;
    
    # Idle waiting time for RTP packets, if no packets are received within the specified time
    # the RTP listening connection will automatically stop and send a BYE command.
    rtp_idle_timeout    30;

    # Whether to forward the audio stream
    # Currently only supports AAC format, so the device needs to support AAC format
    # on: forward audio
    # off: do not forward audio, only video
    # *Note*!!!: flv only supports three sample rates: 11025, 22050, 44100
    # If the device does not support any of these three, it will automatically select one format during forwarding
    # At the same time, the ADTS header will be encapsulated in the FLV AAC raw data
    # This allows the player to automatically select the sampling frequency based on the ADTS header
    # Players like ffplay and vlc can do this, but flash does not have sound
    # because flash only supports 11025, 22050, 44100.
    audio_enable        off;


    # Server host number, can be a domain name or IP address
    # This is the address to which the device sends the media. If the server is on an internal or external network,
    # the external network address needs to be specified.
    # When calling the API to create a stream session, the returned IP address is also the host.
    # $CANDIDATE is a system environment variable that retrieves the address from the environment variable. If it is not configured, use *
    # * represents the address of the network card specified by stats network. If network is not configured, the default is the address of network card 0.
    # TODO: https://github.com/ossrs/srs/pull/1679/files#r400917594
    host       $CANDIDATE;

    # Create an RTMP media channel based on the received PS RTP packets, no need to create an API interface
    # The RTMP address parameter [stream] is the channel ID in the format chid[ssrc]
    auto_create_channel   off;

    sip {
    # Enable internal SIP signaling in SRS
    # Set to 'on' to use SRS for signaling, 'off' to only forward PS streams
        enabled on;
        
    # SIP listening UDP port
        listen              5060;
        
    # SIP server ID.
    # The device configuration number needs to be consistent with this value, otherwise registration will fail.
        serial              34020000002000000001;

    # SIP server domain.

        realm               3402000000;

    # Timeout for receiving response after sending ACK from the server, in seconds.
    # If no response is received within the specified time, it is considered a failure.
        ack_timeout         30;

    # Device heartbeat maintenance time, if no heartbeat is received within the specified time (in seconds),
    # it is considered that the device is offline.
        keepalive_timeout   120;

    # Whether to automatically send an invite to the device after registration
    # on: yes  off: no, it needs to be controlled through the API.
        auto_play           on;
    # Whether the port for sending streams from the device is fixed
    # on: send streams to a multiplexing port like 9000
    # off: automatically select a port from the range between rtp_mix_port and rtp_max_port that is available.
        invite_port_fixed     on;

    # Interval for querying the device list from the device or subdomain, in seconds
    # Default is 60 seconds
        query_catalog_interval  60;
    }
}

rtc_server {
    enabled         on;
    # Listen at udp://8000
    listen          8000;
    #
    # The $CANDIDATE means fetch from env, if not configed, use * as default.
    #
    # The * means retrieving server IP automatically, from all network interfaces,
    # @see https://github.com/ossrs/srs/issues/307#issuecomment-599028124
    candidate       $CANDIDATE;
}

vhost __defaultVhost__ {
    hls {
        enabled         on;
    }
    rtc {
        enabled     on;
        bframe      discard;
    }

    http_remux {
        enabled     on;
        mount       [vhost]/[app]/[stream].flv;
    }
}

Replay

How to replay bug?

Steps to reproduce the bug

How to replay bug?

  1. Register the camera to gb28181.
  2. After the camera is registered, the channel can be seen. Click on the preview image, but there is no image. The camera can still be controlled.

Note: If it is an internal network, it is appropriate.

Expected behavior (Expect)

Describe your expectation:

  1. Analyze possible reasons.
  2. See if we can resolve this issue.

Please make sure to maintain the markdown structure.

TRANS_BY_GPT3

@cfeigithub cfeigithub changed the title GB28181:使用内网可以,使用外网可以注册,但不能看视频,摄像头也可以控制 GB28181:使用内网所有功能正常,使用外网可以注册,但不能看视频,摄像头也可以控制 Dec 7, 2021
@winlinvip winlinvip self-assigned this Dec 8, 2021
@winlinvip
Copy link
Member

winlinvip commented Dec 8, 2021

There is too little information, I suggest you investigate it yourself.

TRANS_BY_GPT3

@winlinvip winlinvip added the GB28181 For GB28181. label Dec 8, 2021
@iauhsil
Copy link

iauhsil commented Dec 18, 2021

I also have this problem. May I ask if there is any follow-up to this issue?

TRANS_BY_GPT3

@iauhsil
Copy link

iauhsil commented Dec 18, 2021

@cfeigithub

@cfeigithub
Copy link
Author

cfeigithub commented Dec 20, 2021

I also have this problem. May I ask if there is any follow-up to this issue?

I don't know. The reason was not identified, and it is suspected to be a port issue. I asked the official for some guidance, but they didn't provide any. In the end, I used ffmpeg.

TRANS_BY_GPT3

@cfeigithub
Copy link
Author

cfeigithub commented Dec 20, 2021

There is too little information, I suggest you investigate it yourself.
I think there is quite a lot of information.

TRANS_BY_GPT3

@cfeigithub
Copy link
Author

cfeigithub commented Dec 20, 2021 via email

@winlinvip
Copy link
Member

winlinvip commented Dec 21, 2021

  1. If FFmpeg can solve the problem, please use FFmpeg. The key is to solve the problem, not necessarily using SRS.
  2. If you expect the "official" to solve your problem, the official in the open-source community is every developer. The open-source community is not a company and does not have an official statement.
  3. Please have a more reasonable expectation for open-source projects. You are welcome to choose other commercial products or use whatever you think is suitable.

TRANS_BY_GPT3

@winlinvip winlinvip added the Won't fix We won't fix it. label Dec 21, 2021
@winlinvip winlinvip changed the title GB28181:使用内网所有功能正常,使用外网可以注册,但不能看视频,摄像头也可以控制 GB28181: 内网正常,外网映射异常,使用FFmpeg正常 Dec 21, 2021
@ossrs ossrs locked as spam and limited conversation to collaborators Dec 21, 2021
@winlinvip winlinvip changed the title GB28181: 内网正常,外网映射异常,使用FFmpeg正常 GB28181: Internal network is normal, external network mapping is abnormal, using FFmpeg is normal Jul 28, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
GB28181 For GB28181. TransByAI Translated by AI/GPT. Won't fix We won't fix it.
Projects
None yet
Development

No branches or pull requests

3 participants