Reputation: 95
I was searching in all stackoverflow posts , but not find ask for this question. I need stream video from android camera to rtmp server. In this time, I make rtmp packet, put in rtmp body buffer from pipe:
mediaRecorder.setOutputFile(pipe[1].getFileDescriptor());
Settings for media:
camera = Camera.open();
mediaRecorder.setCamera(camera);
mediaRecorder.setVideoSource(0);
mediaRecorder.setOutputFormat(8);
mediaRecorder.setVideoSize(640, 480);
mediaRecorder.setVideoEncodingBitRate(10000);
mediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
mediaRecorder.setPreviewDisplay(previewHolder.getSurface());
Then reading data from inputStream into array and put this data to rtmpbody I`m understand, thats wrong, but I have no idea how make raw h264 streamable
Upvotes: 3
Views: 2386
Reputation: 9793
I've got a small project that shows how to put raw h264 into an RTMP format here; its not perfect, but it mostly works.
Upvotes: 0
Reputation: 4371
Maybe you already did, if not, you should take a look to these questions.
Accessing the output video while recording
Upvotes: 3