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

How to set video encode bitrate? #55

Open
KTOC opened this issue May 29, 2020 · 0 comments
Open

How to set video encode bitrate? #55

KTOC opened this issue May 29, 2020 · 0 comments

Comments

@KTOC
Copy link

KTOC commented May 29, 2020

Hello,

I tried to reduce the video record file size (without losing quality) but not successful. My goal is to record 720p 25fps video. The current video size is 100mb for 5 minutes record, which is large for upload. I tried to change the code in MediaVideoEncoder.java in librestreaming/encoder as follow:

final MediaFormat format = MediaFormat.createVideoFormat(MIME_TYPE, mWidth, mHeight);
format.setInteger(MediaFormat.KEY_COLOR_FORMAT,MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface);    // API >= 18
format.setInteger(MediaFormat.KEY_BIT_RATE, 300000); <—- HERE
format.setInteger(MediaFormat.KEY_FRAME_RATE, FRAME_RATE);
format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 6);

After changing the bitrate, the video size is still remain (around 100mb for 5minute at 720p).

Is this correct way to do or I have to set somewhere else?

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