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

You need to change the resolution on the fly #832

Open
thegobot opened this issue Nov 11, 2021 · 0 comments
Open

You need to change the resolution on the fly #832

thegobot opened this issue Nov 11, 2021 · 0 comments

Comments

@thegobot
Copy link
Contributor

thegobot commented Nov 11, 2021

Please give advice

When changing cameras, the resolution does not change. It needs to be changed if the current resolution is not supported in the camera being changed. Otherwise the error Set parameters failed...

How can I change the resolution on the fly? No need to reconnect to the server..
What am I doing

mPublisher.stopEncode();
mPublisher.setPreviewResolution();
mPublisher.setOutputResolution()

mCameraView.setCameraId(0);
mEncoder.setCameraBackFace();

mPublisher.startEncode();
mPublisher.startCamera();

Yes, encoding continues, but players crash at this point in time. What else needs to be done to force the encoder to reconfigure correctly?

UPD: if you turn off audio and streaming only video, then there is no problem

thegobot added a commit to thegobot/yasea that referenced this issue Nov 28, 2021
It is also necessary to send the SPS\PPS along with the keyframe, in addition to the AVCSequenceHeader

Now all players do not freeze and change resolution anywhere in the stream!
Tested: PotPlayer, MPC (hard accel\soft), Chrome, Forefox, FFplay (also with h264_qsv decoder)

See
begeekmyfriend#832
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