help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • Blog
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
surveillance-video
RSK World
surveillance-video
Surveillance Video Dataset - Security Camera + Person Detection + Anomaly Detection + OpenCV + YOLO
surveillance-video
  • __pycache__
  • annotations
  • config
  • frames
  • models
  • output
  • videos
  • .gitignore713 B
  • GITHUB_DEPLOYMENT.md3.5 KB
  • LICENSE1.3 KB
  • README.md13 KB
  • RELEASE_NOTES.md5.6 KB
  • alert_system.py12 KB
  • analytics.js9.2 KB
  • analytics_dashboard.html9.3 KB
  • api_server.py10.7 KB
  • batch_processor.py8.3 KB
  • config.py1.2 KB
  • create_sample_video.py7.4 KB
  • create_zip.py2.6 KB
  • detect_anomalies.py7.2 KB
  • detect_persons.py6.3 KB
  • download_sample_videos.py2.5 KB
  • extract_frames.py4.5 KB
  • index.html62.2 KB
  • multi_camera_system.py12.5 KB
  • package.json1.2 KB
  • process_video.py4.4 KB
  • project_data.json1.3 KB
  • project_data.php1.6 KB
  • project_data.py1.7 KB
  • requirements.txt372 B
  • script.js6.6 KB
  • setup.py2 KB
  • styles.css13.4 KB
  • surveillance-video.zip1.2 MB
  • train_ml_model.py9 KB
  • verify_project.py5 KB
  • video_quality_analyzer.py9.5 KB
  • video_search.py10.7 KB
extract_frames.pystyles.css
extract_frames.py
Raw Download
Find: Go to:
# Project: Surveillance Video Dataset
# Author: Molla Samser
# Website: https://rskworld.in/
# Contact: help@rskworld.in
# Phone: +91 93305 39277
# Address: Nutanhat, Mongolkote, Purba Burdwan, West Bengal, India, 713147

"""
Frame extraction script for surveillance video dataset.
This script extracts frames from video files at specified intervals.
"""

import cv2
import os
import argparse
from pathlib import Path


def extract_frames(video_path, output_dir='frames/extracted_frames', interval=30, start_frame=0, end_frame=None):
    """
    Extract frames from video at specified intervals.
    
    Args:
        video_path: Path to the input video file
        output_dir: Directory to save extracted frames
        interval: Extract every Nth frame
        start_frame: Starting frame number
        end_frame: Ending frame number (None for all frames)
    """
    # Create output directory
    os.makedirs(output_dir, exist_ok=True)
    
    # Open video
    cap = cv2.VideoCapture(video_path)
    if not cap.isOpened():
        print(f"Error: Could not open video file {video_path}")
        return
    
    # Get video properties
    fps = cap.get(cv2.CAP_PROP_FPS)
    total_frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
    
    if end_frame is None:
        end_frame = total_frames
    
    print(f"Video: {video_path}")
    print(f"Total frames: {total_frames}")
    print(f"FPS: {fps}")
    print(f"Extracting frames {start_frame} to {end_frame} (interval: {interval})")
    
    frame_count = 0
    saved_count = 0
    
    # Seek to start frame
    cap.set(cv2.CAP_PROP_POS_FRAMES, start_frame)
    
    while cap.isOpened() and frame_count < end_frame:
        ret, frame = cap.read()
        if not ret:
            break
        
        current_frame = start_frame + frame_count
        
        # Save frame at specified interval
        if current_frame % interval == 0:
            frame_filename = os.path.join(output_dir, f"frame_{current_frame:06d}.jpg")
            cv2.imwrite(frame_filename, frame)
            saved_count += 1
            
            if saved_count % 10 == 0:
                print(f"Extracted {saved_count} frames...")
        
        frame_count += 1
    
    cap.release()
    print(f"Extraction complete. Saved {saved_count} frames to {output_dir}")


def extract_all_frames(video_path, output_dir='frames/extracted_frames'):
    """
    Extract all frames from video.
    
    Args:
        video_path: Path to the input video file
        output_dir: Directory to save extracted frames
    """
    extract_frames(video_path, output_dir, interval=1)


def extract_by_time_interval(video_path, output_dir='frames/extracted_frames', time_interval=1.0):
    """
    Extract frames at specified time intervals.
    
    Args:
        video_path: Path to the input video file
        output_dir: Directory to save extracted frames
        time_interval: Extract frame every N seconds
    """
    cap = cv2.VideoCapture(video_path)
    if not cap.isOpened():
        print(f"Error: Could not open video file {video_path}")
        return
    
    fps = cap.get(cv2.CAP_PROP_FPS)
    frame_interval = int(fps * time_interval)
    
    print(f"Extracting frames every {time_interval} seconds (every {frame_interval} frames)")
    extract_frames(video_path, output_dir, interval=frame_interval)


if __name__ == "__main__":
    parser = argparse.ArgumentParser(description='Extract frames from surveillance video')
    parser.add_argument('--video', type=str, default='videos/sample.mp4', help='Path to video file')
    parser.add_argument('--output', type=str, default='frames/extracted_frames', help='Output directory')
    parser.add_argument('--interval', type=int, default=30, help='Extract every Nth frame')
    parser.add_argument('--start', type=int, default=0, help='Starting frame number')
    parser.add_argument('--end', type=int, default=None, help='Ending frame number')
    parser.add_argument('--time-interval', type=float, default=None, help='Extract every N seconds')
    
    args = parser.parse_args()
    
    if os.path.exists(args.video):
        if args.time_interval:
            extract_by_time_interval(args.video, args.output, args.time_interval)
        else:
            extract_frames(args.video, args.output, args.interval, args.start, args.end)
    else:
        print(f"Video file not found: {args.video}")
        print("Usage: python extract_frames.py --video <video_path> [options]")

131 lines•4.5 KB
python
styles.css
Raw Download
Find: Go to:
/*
    Project: Surveillance Video Dataset
    Author: Molla Samser
    Website: https://rskworld.in/
    Contact: help@rskworld.in
    Phone: +91 93305 39277
    Address: Nutanhat, Mongolkote, Purba Burdwan, West Bengal, India, 713147
*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 0;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    padding: 8px 15px;
    border-radius: 5px;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 15s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

header h1 {
    font-size: 3em;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

header h1 i {
    margin-right: 15px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.subtitle {
    font-size: 1.3em;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

.content {
    padding: 50px 40px;
}

section {
    margin-bottom: 50px;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h2 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 2em;
    font-weight: 700;
    position: relative;
    padding-bottom: 10px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

h2 i {
    margin-right: 15px;
    color: #764ba2;
}

.info-section {
    margin-bottom: 40px;
}

.info-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 30px;
    border-radius: 15px;
    border-left: 5px solid #667eea;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.info-item {
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.info-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.feature-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.feature-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.feature-card i {
    font-size: 3em;
    color: #667eea;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.feature-card:hover i {
    transform: scale(1.2) rotate(5deg);
}

.feature-card h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2em;
}

.feature-card p {
    color: #666;
    font-size: 0.95em;
}

.video-container {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 15px;
    padding: 25px;
    margin-top: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#surveillanceVideo {
    width: 100%;
    max-height: 600px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
}

.video-controls {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn:active {
    transform: translateY(-1px);
}

.description-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.description-section ul {
    margin-left: 25px;
    margin-top: 20px;
}

.description-section li {
    margin-bottom: 12px;
    padding-left: 10px;
    position: relative;
}

.description-section li::before {
    content: '✓';
    position: absolute;
    left: -20px;
    color: #667eea;
    font-weight: bold;
}

.download-section {
    text-align: center;
}

.download-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 50px;
    border-radius: 15px;
    margin-top: 25px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.download-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.download-card p {
    position: relative;
    z-index: 1;
    font-size: 1.2em;
    margin-bottom: 20px;
}

.btn-download {
    display: inline-block;
    background: white;
    color: #667eea;
    padding: 18px 40px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    margin-top: 20px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-download:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.code-section {
    background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%);
    border-radius: 15px;
    padding: 30px;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.code-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.tab-btn {
    background: #333;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.tab-btn:hover {
    background: #444;
    transform: translateY(-2px);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tab-content.active {
    display: block;
}

.tab-content pre {
    background: #2d2d2d;
    padding: 25px;
    border-radius: 10px;
    overflow-x: auto;
    border: 1px solid #444;
}

.tab-content code {
    color: #d4d4d4;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 0.95em;
    line-height: 1.8;
}

/* Installation Steps */
.installation-steps {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 30px;
    border-radius: 15px;
    margin: 25px 0;
    border-left: 5px solid #667eea;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.step {
    margin: 25px 0;
    padding: 20px;
    background: white;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.step:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.step-number {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    text-align: center;
    line-height: 35px;
    margin-right: 15px;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}

.feature-detail {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin: 20px 0;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.feature-detail:hover {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
    transform: translateY(-3px);
}

.feature-detail h4 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.feature-detail .file-name {
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    padding: 8px 15px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    display: inline-block;
    margin: 8px 5px;
    font-weight: 600;
    color: #667eea;
    border: 1px solid #ddd;
}

.command-box {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 18px;
    border-radius: 8px;
    margin: 15px 0;
    font-family: 'Courier New', 'Consolas', monospace;
    overflow-x: auto;
    border: 1px solid #444;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.3);
}

/* Footer */
footer {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    color: white;
    padding: 50px 40px 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    margin-bottom: 20px;
    color: #667eea;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin: 12px 0;
    transition: transform 0.3s ease;
}

.footer-section ul li:hover {
    transform: translateX(5px);
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #667eea;
    text-decoration: underline;
}

footer > div:last-child {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #444;
    color: #aaa;
}

footer > div:last-child a {
    color: #667eea;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .content {
        padding: 30px 20px;
    }
    
    h2 {
        font-size: 1.5em;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .video-controls {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3d8a 100%);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection Color */
::selection {
    background: #667eea;
    color: white;
}

::-moz-selection {
    background: #667eea;
    color: white;
}
677 lines•13.4 KB
css
🚀 Support RSK World

Subscribe to our YouTube channel for latest tutorials & updates!



Click subscribe & support our work ❤️

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer