ossrs / srs

SRS is a simple, high-efficiency, real-time media server supporting RTMP, WebRTC, HLS, HTTP-FLV, HTTP-TS, SRT, MPEG-DASH, and GB28181.
https://ossrs.io
MIT License
25.57k stars 5.37k forks source link

May I ask how to configure HTTP access to simultaneously push FLV and AAC using only one SRS? #2806

Closed lin557 closed 2 years ago

lin557 commented 2 years ago

Description'

Please ensure that the markdown structure is maintained.

How should I configure HTTP access if I want to use only one SRS to simultaneously push FLV and AAC?

Please describe the issue you are facing.

  1. SRS version: v3.0

  2. SRS configuration is as follows:

    vhost your_vhost {
    http_remux {
        enabled     on;
        fast_cache  30;
        mount       [vhost]/[app]/[stream].aac;
    }
    }
    vhost your_vhost {
    http_remux {
        enabled     on;
        fast_cache  30;
        mount       [vhost]/[app]/[stream].flv;
    }
    }

Expected behavior

To push different stream formats based on different [app] in SRS, you can configure it as follows:

For rtmp://xxx/live/test, you can access it through http://xxx:8080/live/test.flv. For rtmp://xxx/audio/test, you can access it through http://xxx:8080/audio/test.aac.

To achieve this using only one SRS instance, you need to configure it accordingly.

I have read the documentation regarding forwarding to other vhosts, but I am not clear on how to configure it.

TRANS_BY_GPT3

chundonglinlin commented 2 years ago

Based on your needs, are you looking to push audio and video streams to SRS and then specify parameters when pulling the stream? For example: Pushing stream: ffmpeg -re -i source.200kbps.768x320.flv -c copy -f flv rtmp://xxxxxx/live/livestream Playback: Audio only: 'http://xxxxxx/live/livestream.flv?only-audio=1' Video only: 'http://xxxxxx/live/livestream.flv?only-video=1

TRANS_BY_GPT3

lin557 commented 2 years ago

Yes, indeed I want it this way. The jtt1078 protocol has a voice intercom, and I only want to use one srs to achieve real-time streaming of http-flv and aac.

Based on your needs, are you looking to push audio and video streams to srs, but specify parameters when pulling the stream? For example: Pushing stream: ffmpeg -re -i source.200kbps.768x320.flv -c copy -f flv rtmp://xxxxxx/live/livestream Playing: Audio only: http://xxxxxx/live/livestream.flv?only-audio=1 Video only: http://xxxxxx/live/livestream.flv?only-video=1

TRANS_BY_GPT3

chundonglinlin commented 2 years ago

If using http-flv for voice intercom, the real-time performance may not be sufficient. It is recommended to configure the RTC module instead! Also, if it is only for voice, why bother streaming video? Video consumes bandwidth resources. (The srs service currently does not support specifying parameters for pulling streams, such as only-audio or only-video).

TRANS_BY_GPT3

lin557 commented 2 years ago

Okay, thank you

TRANS_BY_GPT3

winlinvip commented 2 years ago

This is not a bug, it belongs to 'How do I?' and can be submitted to StackOverflow. This issue will be deleted.

Please ask questions on Stack Overflow using the #simple-realtime-server tag. This issue will be eliminated, see #2716

TRANS_BY_GPT3