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
Maybe you already did, if not, you should take a look to these questions.
Accessing the output video while recording
Transfer InputStream to another Service (across process boundaries) with ParcelFileDescriptor.createPipe() failes with "EBADF (Bad file number)"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With