问题
I would like to stream my Android phone camera to a server, but my server only accepts RTSP. I have tried using react-native-nodemediaclient output RTMP which working well, but I don't want to write a RTMP to RTSP converter which is not optimal solution. So is there any way to implement it, I have searched Google but I cannot find the answer.
回答1:
You can use the following library react-native-vlc-player to stream rtsp
Example
<View style={styles.body}>
<VLCPlayer
ref={(ref) => (this.vlcPlayer = ref)}
style={{width: '100%', height: 200}}
videoAspectRatio="16:9"
source={{
uri:
'rtsp://admin:pass@IP:554/Streaming/Channels/102',
}}
/>
</View>
来源:https://stackoverflow.com/questions/59151067/react-native-stream-camera-of-android-phone-output-to-rtsp