-
I'm trying to use the API to set up re-streaming capabilities to a different NGINX RTMP server and Twitch. I am able to start pushing stream to both destinations, but unable to get audio to play. Is this expected behavior for restreaming to Twitch? I know the audio track is being sent because my NGINX RTMP server can relay the RTMP stream to VLC directly. VLC does play audio and detects the audio track correctly. I'm not sure if the reason that Twitch/my server are unable to play audio is that the video and audio tracks are being split up in a certain way? Not sure how to resolve this issue. Is there a way to send some sort of combined track? Is there a way to just send/retransmit the original RTMP stream instead of the encoded tracks? Here is the status of the pushed stream: {"message":"OK","response":{"app":"app","createdTime":"2023-06-05T23:44:34.013+00:00","finishTime":"1970-01-01T00:00:00.000+00:00","id":"pbtv","protocol":"rtmp","sentBytes":0,"sentTime":0,"sequence":0,"startTime":"2023-06-05T23:44:34.013+00:00","state":"Pushing","stream":{"name":"stream","trackIds":[],"variantNames":["1080p","aac"]},"streamKey":"broadcast","totalsentBytes":0,"totalsentTime":0,"url":"rtmp://plantbaked.tv:1935/live","vhost":"default"},"statusCode":200} OME logs: 2023-06-05 19:52:08 [2023-06-05 23:52:08.602] I [SPAPISvr-t8081:35] FFmpeg | third_parties.cpp:119 | Output #0, flv, to 'rtmp://plantbaked.tv:1935/live/broadcast':
2023-06-05 19:52:08 [2023-06-05 23:52:08.603] I [SPAPISvr-t8081:35] FFmpeg | third_parties.cpp:119 | Metadata:
2023-06-05 19:52:08 [2023-06-05 23:52:08.603] I [SPAPISvr-t8081:35] FFmpeg | third_parties.cpp:119 | encoder :
2023-06-05 19:52:08 [2023-06-05 23:52:08.603] I [SPAPISvr-t8081:35] FFmpeg | third_parties.cpp:119 | Lavf59.16.100
2023-06-05 19:52:08 [2023-06-05 23:52:08.603] I [SPAPISvr-t8081:35] FFmpeg | third_parties.cpp:119 |
2023-06-05 19:52:08 [2023-06-05 23:52:08.604] I [SPAPISvr-t8081:35] FFmpeg | third_parties.cpp:119 | Stream #0:0
2023-06-05 19:52:08 [2023-06-05 23:52:08.604] I [SPAPISvr-t8081:35] FFmpeg | third_parties.cpp:119 | : Video: h264, 1 reference frame ([7][0][0][0] / 0x0007), yuv420p, 1920x1080 (0x0) [SAR 1:1 DAR 16:9], 0/1, q=2-31, 5000 kb/s
2023-06-05 19:52:08 [2023-06-05 23:52:08.604] I [SPAPISvr-t8081:35] FFmpeg | third_parties.cpp:119 | ,
2023-06-05 19:52:08 [2023-06-05 23:52:08.604] I [SPAPISvr-t8081:35] FFmpeg | third_parties.cpp:119 | 1k tbn
2023-06-05 19:52:08 [2023-06-05 23:52:08.605] I [SPAPISvr-t8081:35] FFmpeg | third_parties.cpp:119 |
2023-06-05 19:52:08 [2023-06-05 23:52:08.605] I [SPAPISvr-t8081:35] FFmpeg | third_parties.cpp:119 | Stream #0:1
2023-06-05 19:52:08 [2023-06-05 23:52:08.605] I [SPAPISvr-t8081:35] FFmpeg | third_parties.cpp:119 | : Audio: aac ([10][0][0][0] / 0x000A), 48000 Hz, mono, 128 kb/s
2023-06-05 19:52:08 [2023-06-05 23:52:08.605] I [SPAPISvr-t8081:35] FFmpeg | third_parties.cpp:119 |
2023-06-05 19:52:08 [2023-06-05 23:52:08.714] I [AW-RTMPPush0:30] FFmpeg | third_parties.cpp:119 | Output #0, flv, to 'rtmp://plantbaked.tv:1935/live/broadcast':
2023-06-05 19:52:08 [2023-06-05 23:52:08.715] I [AW-RTMPPush0:30] FFmpeg | third_parties.cpp:119 | Metadata:
2023-06-05 19:52:08 [2023-06-05 23:52:08.715] I [AW-RTMPPush0:30] FFmpeg | third_parties.cpp:119 | encoder :
2023-06-05 19:52:08 [2023-06-05 23:52:08.715] I [AW-RTMPPush0:30] FFmpeg | third_parties.cpp:119 | Lavf59.16.100
2023-06-05 19:52:08 [2023-06-05 23:52:08.715] I [AW-RTMPPush0:30] FFmpeg | third_parties.cpp:119 |
2023-06-05 19:52:08 [2023-06-05 23:52:08.715] I [AW-RTMPPush0:30] FFmpeg | third_parties.cpp:119 | Stream #0:0
2023-06-05 19:52:08 [2023-06-05 23:52:08.716] I [AW-RTMPPush0:30] FFmpeg | third_parties.cpp:119 | : Video: h264, 1 reference frame ([7][0][0][0] / 0x0007), yuv420p, 1920x1080 (0x0) [SAR 1:1 DAR 16:9], 0/1, q=2-31, 5000 kb/s
2023-06-05 19:52:08 [2023-06-05 23:52:08.716] I [AW-RTMPPush0:30] FFmpeg | third_parties.cpp:119 | ,
2023-06-05 19:52:08 [2023-06-05 23:52:08.716] I [AW-RTMPPush0:30] FFmpeg | third_parties.cpp:119 | 1k tbn
2023-06-05 19:52:08 [2023-06-05 23:52:08.716] I [AW-RTMPPush0:30] FFmpeg | third_parties.cpp:119 |
2023-06-05 19:52:08 [2023-06-05 23:52:08.716] I [AW-RTMPPush0:30] FFmpeg | third_parties.cpp:119 | Stream #0:1
2023-06-05 19:52:08 [2023-06-05 23:52:08.717] I [AW-RTMPPush0:30] FFmpeg | third_parties.cpp:119 | : Audio: aac ([10][0][0][0] / 0x000A), 48000 Hz, mono, 128 kb/s
2023-06-05 19:52:08 [2023-06-05 23:52:08.717] I [AW-RTMPPush0:30] FFmpeg | third_parties.cpp:119 | Here is the information of the pushed (relayed) stream from VLC Here is the body of the API request I'm sending/how I am defining variants. var raw = JSON.stringify({
"id": "pbtv",
"stream": {
"name": "stream",
"variantNames": ["1080p","aac"]
},
"protocol": "rtmp",
"url": "rtmp://mydomain.com:1935/live",
"streamKey": "broadcast"
});
var rawTwitch = JSON.stringify({
"id": "twitch",
"stream": {
"name": "stream",
"variantNames": ["1080p","aac"]
},
"protocol": "rtmp",
"url": "rtmp://jfk.contribute.live-video.net/app/",
"streamKey": "mystreamkey"
}); Here is my server.xml <?xml version="1.0" encoding="UTF-8" ?>
<Server version="8">
<Name>OvenMediaEngine</Name>
<!-- Host type (origin/edge) -->
<Type>origin</Type>
<!-- Specify IP address to bind (* means all IPs) -->
<IP>*</IP>
<PrivacyProtection>false</PrivacyProtection>
<!--
To get the public IP address(mapped address of stun) of the local server.
This is useful when OME cannot obtain a public IP from an interface, such as AWS or docker environment.
If this is successful, you can use ${PublicIP} in your settings.
-->
<StunServer>stun.ovenmediaengine.com:13478</StunServer>
<Modules>
<!--
Currently OME only supports h2 like all browsers do. Therefore, HTTP/2 only works on TLS ports.
-->
<HTTP2>
<Enable>true</Enable>
</HTTP2>
<LLHLS>
<Enable>true</Enable>
</LLHLS>
<!-- P2P works only in WebRTC and is experiment feature -->
<P2P>
<!-- disabled by default -->
<Enable>false</Enable>
<MaxClientPeersPerHostPeer>2</MaxClientPeersPerHostPeer>
</P2P>
</Modules>
<!-- Settings for the ports to bind -->
<Bind>
<!-- Enable this configuration if you want to use API Server -->
<Managers>
<API>
<Port>${env:OME_API_PORT:8081}</Port>
<TLSPort>8082</TLSPort>
<WorkerCount>1</WorkerCount>
</API>
</Managers>
<Providers>
<!-- Pull providers -->
<RTSPC>
<WorkerCount>1</WorkerCount>
</RTSPC>
<OVT>
<WorkerCount>1</WorkerCount>
</OVT>
<!-- Push providers -->
<RTMP>
<Port>${env:OME_RTMP_PROV_PORT:1935}</Port>
<WorkerCount>1</WorkerCount>
</RTMP>
<SRT>
<Port>${env:OME_SRT_PROV_PORT:9999}</Port>
<WorkerCount>1</WorkerCount>
</SRT>
<!--
<MPEGTS>
<- Listen on port 4000
This is just a demonstration to show that you can configure the port in several ways ->
<Port>${env:OME_MPEGTS_PROV_PORT:4000-4001,4004,4005/udp}</Port>
<Port>${env:OME_MPEGTS_PROV_PORT:4000-4005/udp}</Port>
</MPEGTS>
-->
<WebRTC>
<Signalling>
<Port>${env:OME_WEBRTC_SIGNALLING_PORT:3333}</Port>
<TLSPort>${env:OME_WEBRTC_SIGNALLING_TLS_PORT:3334}</TLSPort>
<WorkerCount>1</WorkerCount>
</Signalling>
<IceCandidates>
<IceCandidate>${env:OME_HOST_IP:*}:${env:OME_WEBRTC_CANDIDATE_PORT:10000-10004/udp}</IceCandidate>
<TcpRelay>${env:OME_HOST_IP:*}:${env:OME_WEBRTC_TCP_RELAY_PORT:3478}</TcpRelay>
<TcpForce>true</TcpForce>
<TcpRelayWorkerCount>1</TcpRelayWorkerCount>
</IceCandidates>
</WebRTC>
</Providers>
<Publishers>
<!-- The OVT is protocol for ORIGIN-EDGE -->
<OVT>
<Port>${env:OME_ORIGIN_PORT:9000}</Port>
<WorkerCount>1</WorkerCount>
</OVT>
<LLHLS>
<!--
OME only supports h2, so LLHLS works over HTTP/1.1 on non-TLS port.
Note that LLHLS runs higher performance over HTTP/2.
Therefore, it is recommended to use TLS Port.
-->
<Port>${env:OME_LLHLS_STREAM_PORT:3333}</Port>
<TLSPort>${env:OME_LLHLS_STREAM_TLS_PORT:3334}</TLSPort>
<WorkerCount>1</WorkerCount>
</LLHLS>
<WebRTC>
<Signalling>
<Port>${env:OME_WEBRTC_SIGNALLING_PORT:3333}</Port>
<TLSPort>${env:OME_WEBRTC_SIGNALLING_TLS_PORT:3334}</TLSPort>
<WorkerCount>1</WorkerCount>
</Signalling>
<IceCandidates>
<IceCandidate>${env:OME_WEBRTC_CANDIDATE_IP:*}:${env:OME_WEBRTC_CANDIDATE_PORT:10000-10004/udp}</IceCandidate>
<TcpRelay>${env:OME_WEBRTC_CANDIDATE_IP:*}:${env:OME_WEBRTC_TCP_RELAY_PORT:3478}</TcpRelay>
<TcpForce>true</TcpForce>
<TcpRelayWorkerCount>1</TcpRelayWorkerCount>
</IceCandidates>
</WebRTC>
</Publishers>
</Bind>
<Managers>
<Host>
<Names>
<Name>mydomain</Name>
<Name>*</Name>
</Names>
<TLS>
<CertPath>/cert.pem</CertPath>
<KeyPath>/privkey.pem</KeyPath>
<ChainCertPath>/fullchain.pem</ChainCertPath>
</TLS>
</Host>
<API>
<AccessToken>token</AccessToken>
<CrossDomains>
<Url>*</Url>
</CrossDomains>
</API>
</Managers>
<VirtualHosts>
<!--
You can include multiple XML files by doing the following:
<VirtualHost include="sites-enabled/*.xml" />
-->
<VirtualHost include="VHost*.xml" />
<VirtualHost>
<Name>default</Name>
<!--Distribution is a value that can be used when grouping the same vhost distributed across multiple servers. This value is output to the events log, so you can use it to aggregate statistics. -->
<Distribution>ovenmediaengine.com</Distribution>
<!-- Settings for multi ip/domain and TLS -->
<Host>
<Names>
<Name>mydomain</Name>
<Name>*</Name>
</Names>
<TLS>
<CertPath>cert.pem</CertPath>
<KeyPath>privkey.pem</KeyPath>
<ChainCertPath>fullchain.pem</ChainCertPath>
</TLS>
</Host>
<!-- Refer https://airensoft.gitbook.io/ovenmediaengine/signedpolicy
<SignedPolicy>
<PolicyQueryKeyName>policy</PolicyQueryKeyName>
<SignatureQueryKeyName>signature</SignatureQueryKeyName>
<SecretKey>aKq#1kj</SecretKey>
<Enables>
<Providers>rtmp,webrtc,srt</Providers>
<Publishers>webrtc,hls,llhls,dash,lldash</Publishers>
</Enables>
</SignedPolicy>
-->
<!--
<OriginMapStore>
In order to use OriginMap, you must enable OVT Publisher in Origin and OVT Provider in Edge.
<RedisServer>
<Host>192.168.0.160:6379</Host>
<Auth>!@#ovenmediaengine</Auth>
</RedisServer>
This is only needed for the origin server and used to register the ovt address of the stream.
<OriginHostName>${env:OME_HOST_IP:192.168.0.160}</OriginHostName>
</OriginMapStore>
-->
<!-- Default CORS Settings -->
<CrossDomains>
<Url>*</Url>
</CrossDomains>
<!-- Settings for applications -->
<Applications>
<Application>
<Name>app</Name>
<!-- Application type (live/vod) -->
<Type>live</Type>
<OutputProfiles>
<HardwareAcceleration>true</HardwareAcceleration>
<OutputProfile>
<Name>bypass_stream</Name>
<OutputStreamName>${OriginStreamName}</OutputStreamName>
<!--LLHLS URL : https://domain/app/stream/abr.m3u8 -->
<Playlist>
<Name>for Webrtc</Name>
<FileName>abr</FileName>
<Options> <!-- Optinal -->
<!--
Automatically switch rendition in WebRTC ABR
[Default] : true
-->
<WebRtcAutoAbr>true</WebRtcAutoAbr>
</Options>
<Rendition>
<Name>Bypass</Name>
<Video>bypass_video</Video>
<Audio>bypass_audio</Audio>
</Rendition>
<Rendition>
<Name>1080p</Name>
<Video>1080p</Video>
<Audio>opus</Audio>
</Rendition>
<Rendition>
<Name>480p</Name>
<Video>480p</Video>
<Audio>opus</Audio>
</Rendition>
<Rendition>
<Name>720p</Name>
<Video>720p</Video>
<Audio>opus</Audio>
</Rendition>
</Playlist>
<Playlist>
<Name>For LLHLS</Name>
<FileName>llabr</FileName>
<Rendition>
<Name>Bypass</Name>
<Video>bypass_video</Video>
<Audio>bypass_audio</Audio>
</Rendition>
<Rendition>
<Name>FHD</Name>
<Video>1080p</Video>
<Audio>bypass_audio</Audio>
</Rendition>
<Rendition>
<Name>HD</Name>
<Video>720p</Video>
<Audio>bypass_audio</Audio>
</Rendition>
<Rendition>
<Name>SD</Name>
<Video>480p</Video>
<Audio>opus</Audio>
</Rendition>
</Playlist>
<!--LLHLS URL : https://domain/app/stream/llhls.m3u8 -->
<Playlist>
<Name>Change Default</Name>
<FileName>llhls</FileName>
<Rendition>
<Name>HD</Name>
<Video>720p</Video>
<Audio>bypass_audio</Audio>
</Rendition>
</Playlist>
<Encodes>
<Video>
<Name>bypass_video</Name>
<Bypass>true</Bypass>
</Video>
<Video>
<Name>480p</Name>
<Codec>h264</Codec>
<Width>640</Width>
<Height>480</Height>
<Bitrate>500000</Bitrate>
<Framerate>30</Framerate>
</Video>
<Video>
<Name>720p</Name>
<Codec>h264</Codec>
<Width>1280</Width>
<Height>720</Height>
<Bitrate>2000000</Bitrate>
<Framerate>30</Framerate>
</Video>
<Video>
<Name>1080p</Name>
<Codec>h264</Codec>
<Width>1920</Width>
<Height>1080</Height>
<Bitrate>5000000</Bitrate>
<Framerate>30</Framerate>
</Video>
<Audio>
<Name>bypass_audio</Name>
<Bypass>True</Bypass>
</Audio>
<Audio>
<Name>opus</Name>
<Codec>opus</Codec>
<Bitrate>128000</Bitrate>
<Samplerate>48000</Samplerate>
<Channel>2</Channel>
</Audio>
<Audio>
<Name>aac</Name>
<Codec>aac</Codec>
<Bitrate>128000</Bitrate>
<Samplerate>48000</Samplerate>
<Channel>2</Channel>
</Audio>
</Encodes>
</OutputProfile>
</OutputProfiles>
<Providers>
<OVT />
<WebRTC>
<Timeout>30000</Timeout>
<CrossDomains>
<Url>*</Url>
</CrossDomains>
</WebRTC>
<RTMP />
<SRT />
<RTSPPull />
<!-- <MPEGTS>
<StreamMap>
<- Set the stream name of the client connected to the port to "stream_${Port}"
For example, if a client connets to port 4000, OME creates a "stream_4000" stream ->
<Stream>
<Name>stream_${Port}</Name>
<Port>4000,4001-4004</Port>
</Stream>
<Stream>
<Name>stream_4005</Name>
<Port>4005</Port>
</Stream>
<Stream>
<Name>stream_${Port}</Name>
<Port>${env:OME_MPEGTS_PROV_PORT:4000-4005/udp}</Port>
</Stream>
</StreamMap>
</MPEGTS> -->
</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>
<!--
<CacheControl>
<MasterPlaylistMaxAge>0</MasterPlaylistMaxAge>
<ChunklistMaxAge>0</ChunklistMaxAge>
<ChunklistWithDirectivesMaxAge>60</ChunklistWithDirectivesMaxAge>
<SegmentMaxAge>-1</SegmentMaxAge>
<PartialSegmentMaxAge>-1</PartialSegmentMaxAge>
</CacheControl>
-->
<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>
</Publishers>
</Application>
</Applications>
</VirtualHost>
</VirtualHosts>
</Server> |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Audio works restreaming to YouTube as well, so this may be due to some particularity about how OME is sending the audio track that prevents Twitch from seeing it? |
Beta Was this translation helpful? Give feedback.
-
Has anyone been able to get restreaming to Twitch working with any settings using the latest dev docker image? |
Beta Was this translation helpful? Give feedback.
-
Could you please confirm if the issue is reproducible with the latest master branch? I fixed one problem on the rtmp push side today. |
Beta Was this translation helpful? Give feedback.
Could you please confirm if the issue is reproducible with the latest master branch? I fixed one problem on the rtmp push side today.