push browser camera to aws rtmp server
i am using python and in frontend javascript.
I am using ffmpeg
to push video to rtmp server.
ffmpeg -y -f mp4 -stream_loop -1 -re -i myvideo.mp4
-b:v 3M -vcodec libx264 -r 30.0 -s 1280x720
-c:a copy -b:a 96k
-f flv "rtmps://dfdf222.global-contribute.live-video.net:443/app/"
I test with OBS software, it is working well. It is working well but I am not getting how to push to rtmp server of my browser camera? i mean from javascript?
i am trying like this:
<body>
<video id="vid" autoplay></video>
<a href="#" onclick="streamVideo()">open and stream</a>
<script>
function streamVideo () {
console.log('ddd')
navigator.mediaDevices.getUserMedia({
video: {
},
audio: {
}
}).then(stream=>{
console.log(stream)
document.getElementById('vid').srcObject = stream;
})
}
</script>
</body>
It is working but not getting any way to push from browser to rtmp server. I know browser doesnt support rtmp protocol, we need to send it from the backend but can I push it to the server so that it pushes to rtmp server?
Does anyone know the way?
Hi,
You may have to include both Stream URL and the Stream key in the FLV endpoint:
Example FFmpeg command:
ffmpeg -re -1 -i $VIDEO_FILEPATH -r 30 -c:v libx264 -pix_fmt yuv420p -profile:v main -preset veryfast -x264opts "nal-hrd=cbr:no-scenecut" -minrate 3000 -maxrate 3000 -g 60 -c:a aac -b:a 160k -ac 2 -ar 44100 -f flv rtmps://**INGEST_ENDPOINT**:443/app/**STREAM_KEY**
Please refer the following document for more details: https://docs.aws.amazon.com/ivs/latest/userguide/getting-started-set-up-streaming.html#ffmpeg
Relevant questions
RTMP pull/push and Zoom
asked a year agoVideo on Demand with MediaPackage, S3 and ffmpeg
asked 3 years agoCannot get to 30fps when livestream with ffmpeg + xvfb
asked a year agoHow to publish live stream to MediaPackage using FFmpeg?
asked 6 hours agoMediaLive - Start RTMP (output) push separately from channel start
asked 2 months agoHot configure the newtork between gstreamer and Kinesis Video Stream?
asked 3 years agoLive Stream to Twitch rtmp
Accepted Answerasked 3 years agopush browser camera to aws rtmp server
asked 14 days agoPinpoint might be using the legacy cloud messaging API for push notification
asked a month agoFacing issues in rtmp push inputs
asked 3 years ago
Hi, You have not understand questions, i am not streaming recorded videos ! I want to live stream my webcam. like when user signup to my application, they can go live. but I am not getting any way to push from browser to rtmp. can you please help in this case?