react-native-nodemediaclient
react-native-nodemediaclient copied to clipboard
How can set camera to HD or full HD?
When i set preset=4 it just resize video size, no HD or full HD capture from Camera. The server and Android camera both tested using Larix Broadcasterand i see full HD there.
My camera setup is as below, still I am getting low quality video.
<NodeCameraView
style={styles.nodeCameraView}
ref={(vb) => { this.vb = vb }}
outputUrl = {`rtmp://live.mux.com/app/${this.state.streamId}`}
camera={{ cameraId: 0, cameraFrontMirror: true }}
audio={{ bitrate: 32000, profile: 1, samplerate: 44100 }}
video={{
preset: 4,
bitrate: 400000,
profile: 2,
fps: 30,
videoFrontMirror: false
}}
autopreview={true}
/>
Anyone have any idea to improving quality ?
@cybercoder @kishanbharda did you managed to fix?
@cybercoder @kishanbharda did you managed to fix?
No there is problem with Native part and i don't know native programming.
@cybercoder @kishanbharda @ManigandanRaamanathan
Hi, I know this answer is kinda late. I've just used this library for a project of ours and had the same problems. I managed to get the quality better though
Turned out the bitrate option is essential see below:
<NodeCameraView
outputUrl={RTMP_URI}
camera={{cameraId: 1, cameraFrontMirror: true}}
audio={{bitrate: 32000, profile: 1, samplerate: 44100}}
video={{
preset: 1,
bitrate: 32000000,
profile: 0,
fps: 30,
videoFrontMirror: true,
}}
autopreview={true}
/>
the video bitrate takes bit units and not KB. so for HD720 1280x720 video it is recommended to have 4,000 kbps of bitrate. by conversion 4,000 kbps is 3.2e+7 ~ 32,000,000 (correct me if I'm wrong)
With the fix above the camera streams better quality on our project now. try it out and would appreciate if you could tag me here if things don't work on your end
Thanks
"preset" is used to set the video resolution. The reference for this value is as follows: https://github.com/NodeMedia/NodeMediaClient-iOS/blob/master/docs/NodePublisher_API_CN.md#videopreset
@BoyKagud How did you determine that it was in bits?
It's definitely not KB but I can't find where in the source code it specifies it as bits.
@agconti did you find out something about this ? Thank you !
@agconti did you find out something about this ? Thank you !
(Unfortunately) no
Does anyone here is aware of a high level solution to stream rtmp to MUX from a react-native app ? I would really really really appreciate any help 🙌 Thank you !