Sathwikchowdary commited on
Commit
d131efd
·
verified ·
1 Parent(s): d24a621

Update pages/Info_of_Video.py

Browse files
Files changed (1) hide show
  1. pages/Info_of_Video.py +87 -0
pages/Info_of_Video.py CHANGED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pandas as pd
3
+ import numpy as np
4
+
5
+ # Custom CSS for styling
6
+ custom_css = """
7
+ <style>
8
+ html, body, [data-testid="stAppViewContainer"] {
9
+ background-image: linear-gradient(
10
+ rgba(0, 0, 0, 0.6),
11
+ rgba(0, 0, 0, 0.6)
12
+ ),
13
+ url("https://www.istockphoto.com/photo/tech-or-space-background-abstract-3d-illustration-gm1367865109-437999705?utm_source=pixabay&utm_medium=affiliate&utm_campaign=SRP_photo_sponsored&utm_content=https%3A%2F%2Fpixabay.com%2Fphotos%2Fsearch%2Fbackground%2520datascience%2F&utm_term=background+datascience.jpg");
14
+ background-size: cover;
15
+ background-position: center;
16
+ background-repeat: no-repeat;
17
+ background-attachment: fixed;
18
+ color: white; /* Ensures all text is readable */
19
+ }
20
+ h2, h3 {
21
+ color: #FFD700; /* Gold color for headings */
22
+ }
23
+ p {
24
+ color: #FFFFFF; /* White text for paragraphs */
25
+ }
26
+ </style>
27
+ """
28
+
29
+ # Inject the CSS into the app
30
+ st.markdown(custom_css, unsafe_allow_html=True)
31
+
32
+ st.markdown("<h2 style='text-align: left; color: Black;'>What is Video</h2>", unsafe_allow_html=True)
33
+ st.markdown(
34
+ "<p style='font-size: 16px; color: White; font-style: italic;'>"
35
+ "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."
36
+ "</p>",
37
+ unsafe_allow_html=True
38
+ )
39
+
40
+ # Features of an videos using opencv
41
+ st.markdown("<h2 style='text-align: left; color: Black;'>Featrures of video using opencv</h2>", unsafe_allow_html=True)
42
+ st.markdown(
43
+ "<p style='font-size: 16px; color: White; font-style: italic;'>"
44
+ "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."
45
+ "</p>",
46
+ unsafe_allow_html=True
47
+ )
48
+ st.markdown("<h2 style='text-align: left; color: Black;'>Common Methods Video Processing with OpenCV:</h2>", unsafe_allow_html=True)
49
+ st.markdown(
50
+ "<p style='font-size: 16px; color: White; font-style: italic;'>"
51
+ "Reading Videos: cv2.VideoCapture: Opens and reads video files or streams."
52
+ "Writing Videos: cv2.VideoWriter: Saves video frames into a file."
53
+ "Displaying Video: Use cv2.imshow to display video frames as they are read."
54
+ "Apply real-time frame manipulation, such as applying filters or transformations."
55
+ "Convert video frames to grayscale: cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)"
56
+ "</p>",
57
+ unsafe_allow_html=True
58
+ )
59
+ st.markdown("<h2 style='text-align: left; color: Black;'>Accessing WebCam with OpenCV:</h2>", unsafe_allow_html=True)
60
+ st.markdown(
61
+ "<p style='font-size: 16px; color: White; font-style: italic;'>"
62
+ "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."
63
+ "</p>",
64
+ unsafe_allow_html=True
65
+ )
66
+ st.markdown("<h2 style='text-align: left; color: Black;'>Steps to Access Webcam:</h2>", unsafe_allow_html=True)
67
+ st.markdown(
68
+ "<p style='font-size: 16px; color: White; font-style: italic;'>"
69
+ "Import OpenCV: Ensure OpenCV is installed (pip install opencv-python) and import it."
70
+ "Initialize Webcam: Use cv2.VideoCapture(0) to access the default webcam (replace 0 with the device index for other cameras)."
71
+ "Read Frames: Use read() method to grab individual frames from the webcam feed."
72
+ "Display Frames: Use cv2.imshow() to view the frames in a window."
73
+ "Close Webcam: Release the webcam and close all OpenCV windows using cv2.VideoCapture.release() and cv2.destroyAllWindows()."
74
+ "</p>",
75
+ unsafe_allow_html=True
76
+ )
77
+
78
+ # Adding the link to the code
79
+ st.markdown(
80
+ "<h2 style='text-align: left; color: Black;'>Link to Full Code:</h2>", unsafe_allow_html=True
81
+ )
82
+ st.markdown(
83
+ "<p style='font-size: 16px; color: White;'>"
84
+ "You can view the full code for video processing using OpenCV on [GitHub](https://github.com/Sathwik4119/IMAGE/blob/main/video_using.cv2.ipynb)."
85
+ "</p>",
86
+ unsafe_allow_html=True
87
+ )