import streamlit as st import pandas as pd import numpy as np # Custom CSS for styling custom_css = """ """ # Inject the CSS into the app st.markdown(custom_css, unsafe_allow_html=True) st.markdown("

What is Video

", unsafe_allow_html=True) st.markdown( "

" "A video is a series of images (frames) shown in quick succession to create the perception of motion. Each frame is a static image, and the frame rate (e.g., 24, 30, or 60 frames per second) specifies the number of frames displayed per second." "

", unsafe_allow_html=True ) # Features of an videos using opencv st.markdown("

Featrures of video using opencv

", unsafe_allow_html=True) st.markdown( "

" "OpenCV (Open Source Computer Vision Library) is a powerful tool for video processing. Using OpenCV, Python can perform a variety of operations on video files and streams." "

", unsafe_allow_html=True ) st.markdown("

Common Methods Video Processing with OpenCV:

", unsafe_allow_html=True) st.markdown( "

" "Reading Videos: cv2.VideoCapture: Opens and reads video files or streams." "

", unsafe_allow_html=True ) st.markdown( "

" "Writing Videos: cv2.VideoWriter: Saves video frames into a file." "

", unsafe_allow_html=True ) st.markdown( "

" "Displaying Video: Use cv2.imshow to display video frames as they are read." "

", unsafe_allow_html=True ) st.markdown( "

" "Apply real-time frame manipulation, such as applying filters or transformations." "

", unsafe_allow_html=True ) st.markdown( "

" "Convert video frames to grayscale: cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)" "

", unsafe_allow_html=True ) st.markdown("

Accessing WebCam with OpenCV:

", unsafe_allow_html=True) st.markdown( "

" "Accessing a webcam in Python is simple and efficient using OpenCV. The library provides the cv2.VideoCapture() function, which allows you to capture live video feed from your webcam." "

", unsafe_allow_html=True ) st.markdown("

Steps to Access Webcam:

", unsafe_allow_html=True) st.markdown( "

" "Import OpenCV: Ensure OpenCV is installed (pip install opencv-python) and import it." "

", unsafe_allow_html=True ) st.markdown( "

" "Initialize Webcam: Use cv2.VideoCapture(0) to access the default webcam (replace 0 with the device index for other cameras)." "

", unsafe_allow_html=True ) st.markdown( "

" "Read Frames: Use read() method to grab individual frames from the webcam feed." "

", unsafe_allow_html=True ) st.markdown( "

" "Display Frames: Use cv2.imshow() to view the frames in a window." "

", unsafe_allow_html=True ) st.markdown( "

" "Close Webcam: Release the webcam and close all OpenCV windows using cv2.VideoCapture.release() and cv2.destroyAllWindows()." "

", unsafe_allow_html=True ) # Add links to the GitHub repositories st.markdown( "

" "You can explore the code examples on GitHub:
" "Basic Operations on Video" "

", unsafe_allow_html=True )