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.55k stars 1.06k forks source link

Failed to start recording with WebRTC #799

Closed kage212 closed 2 years ago

kage212 commented 2 years ago

Hello OME team!

Describe the bug When I try to record a WebRTC stream its does not start.

To Reproduce Steps to reproduce the behavior:

  1. Set Server.xml `` <?xml version="1.0" encoding="UTF-8"?>
OvenMediaEngine origin * false stun.l.google.com:19302 true true false 2 ${env:OME_API_PORT:8081} ${env:OME_API_TLSPORT:8082} 1 1 1 ${env:OME_RTMP_PROV_PORT:1960} 1 ${env:OME_SRT_PROV_PORT:9999} 1 ${env:OME_MPEGTS_PROV_PORT:4000/udp} 3333 3334 1 ${env:OME_ICE_CANDIDATES:*:10000-10005/udp} ${env:OME_TCP_RELAY_ADDRESS:*:3478} true 1 ${env:OME_ORIGIN_PORT:9000} 1 3333 3334 1 ${env:OME_SIGNALLING_PORT:3333} 3334 1 ${env:OME_ICE_CANDIDATES:*:10000-10005/udp} ${env:OME_TCP_RELAY_ADDRESS:*:3478} true 1 * ${env:OME_ACCESS_TOKEN} default ovenmediaengine.com * ssl/x.cert.crt ssl/x.key ssl/x.chain.crt https://backend:xxxx/api/ ${env:OME_SECRET} 3000 rtmp,webrtc,srt webrtc,hls,llhls,dash,lldash app live false bypass_stream ${OriginStreamName} stream_${Port} 4000 30000 1 8 30000 false false false 0.5 6 10 * ${env:OME_RECORD_PATH} /${VirtualHost}/${Application}/${Stream}/${StartTime:YYYYMMDDhhmmss}_${EndTime:YYYYMMDDhhmmss}.ts /${VirtualHost}/${Application}/${Stream}.xml

``

  1. Then a POST request like this 'domain/v1/vhosts/default/apps/app:startRecord'. { 'id': key, 'stream': { 'name': uid, 'tracks': [100, 200] }, 'filePath': ${key} + '/file_${Sequence}.ts', 'infoPath': ${key}/file.xml, 'interval': 60000, 'segmentationRule': 'continuity', }

  2. Using OvenLiveKit to stream

  3. See error

Expected behavior A recorded stream.

Logs log.txt

Important parts: [2022-06-20 15:07:36.018] W [SPRtcSig-T3334:13] Transcoder | transcoder_stream.cpp:425 | OPUS codec only supports 48000Hz samplerate. Do not create bypass track [2022-06-20 15:07:36.018] W [SPRtcSig-T3334:13] Transcoder | transcoder_stream.cpp:545 | Encoding codec set is not a audio codec, track_id(-807287834) [2022-06-20 15:07:36.554] I [OutboundWorker:36] Publisher | stream.cpp:202 | WebRTC Publisher Application application has started [67ZyaYHkxY(3843573246)] stream (MSID : 0) [2022-06-20 15:07:36.555] I [OutboundWorker:36] LLHLS Publisher | llhls_stream.cpp:81 | LLHlsStream(#default#app/67ZyaYHkxY) - Ignore unsupported codec(OPUS) [2022-06-20 15:07:36.557] E [OutboundWorker:36] FFmpeg | third_parties.cpp:111 | [AVFormatContext: 0x7fc6f80057c0] No streams to mux were specified [2022-06-20 15:07:36.557] I [OutboundWorker:36] Publisher | stream.cpp:202 | FilePublisher Application application has started [67ZyaYHkxY(3843573246)] stream (MSID : 0) [2022-06-20 15:07:36.557] E [OutboundWorker:36] FILE | file_session.cpp:47 | Failed to start recording. id(100)

Server (please complete the following information):

Thanks for your time

Keukhan commented 2 years ago

@kage212

The cause of the problem is that you tried to record a track that did not exist. In conclusion, this is a situation that occurs when there is no track to be saved.

Origin Stream Info id(100), output(67ZyaYHkxY), SourceType(WebRTC), Created Time (Mon Jun 20 15:06:09 2022) Audio Track #1: Bypass(false) Bitrate(128.00Kb) codec(8, OPUS) samplerate(48.0K) format(none, 0) channel(stereo, 2) timebase(1/48000) Video Track #2: Bypass(true) Bitrate(96.90Kb) codec(1, H264) resolution(640x360) framerate(10.49fps) timebase(1/90000)

Tracks of the output stream(67ZyaYHkxY) can be identified as #1(Audio) and #2(Video). However, it was requested as 'tracks': [100, 200] }in startRecord. To solve the problem, remove the trackstag and try to record the all track, or put the correct track id in the tracks.

Thanks

kage212 commented 2 years ago

You're right! Thanks

getroot commented 2 years ago

If your issue is resolved, please close this issue.