Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Using another video source instead of device camera #290

Open
khallaghi opened this issue Jul 4, 2019 · 0 comments
Open

Question: Using another video source instead of device camera #290

khallaghi opened this issue Jul 4, 2019 · 0 comments

Comments

@khallaghi
Copy link

khallaghi commented Jul 4, 2019

I want to use another video source and stream it using libstreaming but as I understand there is no way to change the source video and libstreaming automatically use device camera as source video.
to be more specific I have an external camera that I can get video as a raw ByteBuffer and I wanted to stream it over network.

I call this function in onCreate

private void initListener() {

        hdCameraManager = (HDCameraManager) getUnitManager(FuncConstant.HDCAMERA_MANAGER);

        Log.i(TAG, "Now in initListener start");

        hdCameraManager.setMediaListener(new MediaStreamListener() {
            @Override
            public void getVideoStream(int i, byte[] bytes, int i1, int i2) {
                drawVideoSample(ByteBuffer.wrap(bytes));
            }

            @Override
            public void getAudioStream(int i, byte[] bytes) {

            }
        });
    }

it's not important what is HdCameraManager and other stuff the only important thing is in getVideoStream function I get the raw video data as bytes and wrap it up in a ByteBuffer and pass it to another function.

@Override
 public void getVideoStream(int i, byte[] bytes, int i1, int i2) {
        drawVideoSample(ByteBuffer.wrap(bytes));
}

so How can I be able to send this raw stream to external encoder like Wowza or FFmpeg using Libstreaming?
Should I use MediaCodec and other stuff to make it through?
Should I change the libstreaming source code to make it happen?
Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant