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

Adjusting Size of Webcam Video #226

Closed
jasonchanhku opened this issue Jun 7, 2021 · 4 comments
Closed

Adjusting Size of Webcam Video #226

jasonchanhku opened this issue Jun 7, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@jasonchanhku
Copy link

Hi @whitphx , first and foremost, thanks for this amazing component of Streamlit and your contributions. I would like to ask if there is a way to adjust the webcam video sizes after clicking "start"? As I switched into a large monitor and the video size seems to have quadrupled. I appreciate your feedback on this. Thanks

Regards and thanks.

@whitphx whitphx added the enhancement New feature or request label Jun 7, 2021
@jasonchanhku
Copy link
Author

I experimented myself on some things and below are my findings:

  • the frame returned is always the same (by checking the frame's ndarray shape)
  • current workaround is I currently manually change the value of k={width:"100%"} in the main.e8ebcbb7.chunk.js file

Thanks.

@whitphx
Copy link
Owner

whitphx commented Jun 8, 2021

The input camera resolution is not changed (as you may know from that the frame sizes are always the same) and the rendered video element width is adjusted to outer frame of the Streamlit app (this is controlled via the "100%" specification you found).
However it sounds a little bit weird as I think this behavior is same as other Streamlit components. How do you see other components like st.slider, st.text_input, st.textarea, or st.DataFrame on your high-res screen?. Is only this component's appearance strange?

@jasonchanhku
Copy link
Author

Thanks for your response. Let me further investigate this and get back to you.

@jasonchanhku
Copy link
Author

jasonchanhku commented Jun 9, 2021

Finally figured it out. I didn't realize i had layout=wide in st.set_page_config(). Setting is back to centered fixed it. Apologies for the inconvenience caused. Thanks for the prompt response! Appreciate it! Closing this now.

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

No branches or pull requests

2 participants