AirenSoft / OvenMediaEngine

OvenMediaEngine (OME) is a Sub-Second Latency Live Streaming Server with Large-Scale and High-Definition. #WebRTC #LLHLS
https://airensoft.com/ome.html
GNU Affero General Public License v3.0
2.57k stars 1.06k forks source link

LLHLS stream does not work when origin is in a push stream from the same server since v0.15.16 #1464

Closed nums closed 11 months ago

nums commented 11 months ago

Describe the bug My usage is a bit particular. I have a "source" application and an "app" application. I send stream to the source receives (srt stream with 3 audio tracks or a rtmp stream) and once this stream is received, we send this stream to the app application via the "startPush" API:

let res = await this.ome.startPushPublishing('default', 'source', {
     id: 'xxxx',
     stream: {
         name: 'yyyy',
         variantNames: ['bypass_video', 'bypass_audio']
     },
     protocol: 'srt',
     url: 'srt://127.0.0.1:9999?streamid=' + encodeURI(streamId)
})

I have also try to send stream with rtmp but there is the same issue

The response does not show error:

{ 
    app: 'source',
    createdTime: '2023-11-29T16:18:40.444+00:00',
    finishTime: '1970-01-01T00:00:00.000+00:00',
    id: 'xxxx',
    protocol: 'srt',
    sentBytes: 0,
    sentTime: 0,
    sequence: 0,
    startTime: '1970-01-01T00:00:00.000+00:00',
    state: 'ready',
    stream: { 
                name: 'yyyy',
        trackIds: [],
        variantNames: [ 'bypass_video', 'bypass_audio' ] 
        },
    totalsentBytes: 0,
    totalsentTime: 0,
    url: 'srt://127.0.0.1:9999?streamid=srt://127.0.0.1:9999/app/xxxx',
    vhost: 'default' 
}

The stream is created on the app side, the llhls.m3u8 file is available but I have these errors appearing: [StreamWorker:123] LLHLS Publisher | llhls_session.cpp:327 | Invalid chunklist file name requested: chunklist_0_video_xxxx_llhls.m3u8 On the other hand webrtc stream is OK. When I send the stream directly to the application "app" from obs, I don't have this issue, the LLHLS stream can be played.

When I'm using v0.15.15, there is no error and I can access to the LLHLS stream on "app" application

A part of my server.xml:

<Applications>
    <Application>
        <Name>source</Name>
        <!-- Application type (live/vod) -->
        <Type>live</Type>
        <OutputProfiles>
            <OutputProfile>
                <Name>bypass_stream</Name>
                <OutputStreamName>${OriginStreamName}</OutputStreamName>    
                <Playlist>
                    <Name>Webrtc</Name>
                    <FileName>webrtc</FileName>
                    <Options>
                        <WebRtcAutoAbr>true</WebRtcAutoAbr>
                    </Options>                                  
                    <!--<Rendition>
                        <Name>360p</Name>
                        <Video>360p</Video>
                        <Audio>opus</Audio>
                    </Rendition>-->
                    <Rendition>
                        <Name>bypass</Name>
                        <Video>bypass_video</Video>
                        <Audio>opus</Audio>
                    </Rendition>
                </Playlist>
                <Encodes>                                                               
                    <Video>
                        <Name>bypass_video</Name>
                        <Bypass>true</Bypass>
                    </Video>
                    <Audio>
                        <Name>opus</Name>
                        <Codec>opus</Codec>
                        <Bitrate>128000</Bitrate>
                        <Samplerate>48000</Samplerate>
                        <Channel>2</Channel>
                        <BypassIfMatch>
                        <Codec>eq</Codec>
                        </BypassIfMatch>
                    </Audio>                                
                    <Audio>
                        <Name>bypass_audio</Name>
                        <Bypass>true</Bypass>
                    </Audio>                                
                </Encodes>                          
            </OutputProfile>
        </OutputProfiles>
        <Providers>
            <OVT />
            <WebRTC>
                <Timeout>30000</Timeout>
                <CrossDomains>
                    <Url>*</Url>
                </CrossDomains>
            </WebRTC>
            <RTMP />
            <SRT>
                <AudioMap>
                    <Item>
                        <Name>English</Name>
                        <Language>en</Language> <!-- RFC 5646 -->
                    </Item>
                    <Item>
                        <Name>Korean</Name>
                        <Language>ko</Language> <!-- RFC 5646 -->
                    </Item>
                    <Item>
                        <Name>Japanese</Name>
                        <Language>ja</Language> <!-- RFC 5646 -->
                    </Item>
                </AudioMap>
            </SRT>
            <RTSPPull />
        </Providers>
        <Publishers>
            <AppWorkerCount>1</AppWorkerCount>
            <StreamWorkerCount>1</StreamWorkerCount>
            <OVT />
            <WebRTC>
                <Timeout>30000</Timeout>
                <Rtx>false</Rtx>
                <Ulpfec>false</Ulpfec>
                <JitterBuffer>false</JitterBuffer>
            </WebRTC>
            <LLHLS>
                <OriginMode>true</OriginMode>
                <ChunkDuration>0.5</ChunkDuration>
                <!-- PartHoldBack SHOULD be at least three times the Part Target Duration -->
                <PartHoldBack>1.5</PartHoldBack>
                <SegmentDuration>6</SegmentDuration>
                <SegmentCount>10</SegmentCount>
                <CrossDomains>
                    <Url>*</Url>
                </CrossDomains>
            </LLHLS>
            <RTMPPush>
            </RTMPPush>
            <MPEGTSPush>
            </MPEGTSPush>
            <SRTPush>
            </SRTPush>

            <FILE>
                <RootPath>/opt/ovenmediaengine/bin/dumps/recordings/files</RootPath>
                <FilePath>/${VirtualHost}/${Application}/${Stream}/${StartTime:YYYYMMDDhhmmss}_${EndTime:YYYYMMDDhhmmss}.mp4</FilePath>
                <InfoPath>/${VirtualHost}/${Application}/${Stream}.xml</InfoPath>
            </FILE> 

        </Publishers>
    </Application>
    <Application>
        <Name>app</Name>
        <!-- Application type (live/vod) -->
        <Type>live</Type>
        <OutputProfiles>
            <OutputProfile>
                <Name>bypass_stream</Name>
                <OutputStreamName>${OriginStreamName}</OutputStreamName>
                <Playlist>
                    <Name>ll-HLS</Name>
                    <FileName>llhls</FileName>
                    <Rendition>
                        <Name>Origin</Name>
                        <Video>bypass_video</Video>
                        <Audio>aac</Audio>
                    </Rendition>
                    <Rendition>
                        <Name>480p</Name>
                        <Video>480p</Video>
                        <Audio>aac</Audio>
                    </Rendition>
                </Playlist>
                <Playlist>
                    <Name>Webrtc</Name>
                    <FileName>webrtc</FileName>
                    <Options>
                        <WebRtcAutoAbr>true</WebRtcAutoAbr>
                    </Options>                              
                    <Rendition>
                        <Name>720p bypass</Name>
                        <Video>bypass_video</Video>
                        <Audio>opus</Audio>
                    </Rendition>                                
                </Playlist>
                <Encodes>
                    <Video>
                        <Name>bypass_video</Name>
                        <Bypass>true</Bypass>
                    </Video>
                    <Audio>
                        <Name>bypass_audio</Name>
                        <Bypass>true</Bypass>
                    </Audio>    
                    <Video>
                        <Name>480p</Name>
                        <Codec>h264</Codec>
                        <Bitrate>1000000</Bitrate>
                        <Framerate>30</Framerate>
                        <Width>854</Width>
                        <Height>480</Height>
                        <Preset>faster</Preset>
                    </Video>                                                                
                    <Audio>
                        <Name>aac</Name>
                        <Codec>aac</Codec>
                        <Bitrate>128000</Bitrate>
                        <Samplerate>48000</Samplerate>
                        <Channel>2</Channel>
                        <BypassIfMatch>
                            <Codec>eq</Codec>
                        </BypassIfMatch>
                    </Audio>
                    <Audio>
                        <Name>opus</Name>
                        <Codec>opus</Codec>
                        <Bitrate>128000</Bitrate>
                        <Samplerate>48000</Samplerate>
                        <Channel>2</Channel>
                        <BypassIfMatch>
                            <Codec>eq</Codec>
                        </BypassIfMatch>
                    </Audio>
                </Encodes>
            </OutputProfile>
        </OutputProfiles>
        <Providers>
            <OVT />
            <WebRTC>
                <Timeout>30000</Timeout>
                <CrossDomains>
                    <Url>*</Url>
                </CrossDomains>
            </WebRTC>
            <RTMP />
            <SRT>
                <AudioMap>
                    <Item>
                        <Name>English</Name>
                        <Language>en</Language> <!-- RFC 5646 -->
                    </Item>
                    <Item>
                        <Name>Korean</Name>
                        <Language>ko</Language> <!-- RFC 5646 -->
                    </Item>
                    <Item>
                        <Name>Japanese</Name>
                        <Language>ja</Language> <!-- RFC 5646 -->
                    </Item>
                </AudioMap>
            </SRT>
            <RTSPPull />
        </Providers>
        <Publishers>
            <AppWorkerCount>1</AppWorkerCount>
            <StreamWorkerCount>8</StreamWorkerCount>
            <OVT />
            <WebRTC>
                <Timeout>30000</Timeout>
                <Rtx>false</Rtx>
                <Ulpfec>false</Ulpfec>
                <JitterBuffer>false</JitterBuffer>
            </WebRTC>
            <LLHLS>
                <OriginMode>true</OriginMode>
                <Dumps>
                    <Dump>
                        <Enable>false</Enable>
                        <TargetStreamName>*</TargetStreamName>
                        <Playlists>
                            <Playlist>llhls.m3u8</Playlist>
                        </Playlists>
                        <OutputPath>/opt/ovenmediaengine/bin/dumps/recordings/hls/${VHostName}_${AppName}_${StreamName}/${YYYY}_${MM}_${DD}_${hh}_${mm}_${ss}</OutputPath>
                    </Dump>
                </Dumps>
                <DVR>
                    <Enable>true</Enable>
                    <TempStoragePath>/opt/ovenmediaengine/bin/dumps/ome_dvr/</TempStoragePath>
                    <MaxDuration>36000</MaxDuration>
                </DVR>                          
                <ChunkDuration>0.5</ChunkDuration>
                <!-- PartHoldBack SHOULD be at least three times the Part Target Duration -->
                <PartHoldBack>1.5</PartHoldBack>
                <SegmentDuration>6</SegmentDuration>
                <SegmentCount>10</SegmentCount>
                <CrossDomains>
                    <Url>*</Url>
                </CrossDomains>
            </LLHLS>
            <RTMPPush>
            </RTMPPush>
            <MPEGTSPush>
            </MPEGTSPush>
            <SRTPush>
            </SRTPush>
        </Publishers>
    </Application>
</Applications>
getroot commented 11 months ago

This problem occurs when there is an underbar ( _ ) in the stream name, and has already been patched in the master branch. Before 0.16.3 lands, try removing underbar from the stream name.

getroot commented 11 months ago

This is fixed in 0.16.3. Please check if your issue has been resolved as well.

nums commented 11 months ago

Thanks, it's ok with v0.16.3

nums commented 11 months ago

it's fixed