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
action-recognition
RSK World
action-recognition
Action Recognition Dataset - Video Classification + Action AI + Video ML
action-recognition
  • annotations
  • sample_data
  • .gitignore1.2 KB
  • LICENSE.txt3.3 KB
  • README.md13.1 KB
  • RELEASE_NOTES.md4 KB
  • action-recognition.png150.5 KB
  • api_server.py16.1 KB
  • augmentation.py15.9 KB
  • benchmark.py20.6 KB
  • config.json2.8 KB
  • convert_videos.py3.5 KB
  • create_logo.py5.5 KB
  • demo.html28.3 KB
  • download_real_human_videos.py12.6 KB
  • download_real_videos.py21.1 KB
  • download_ucf101.py19.6 KB
  • download_youtube_videos.py10.1 KB
  • favicon.png786 B
  • generate_browser_videos.py10.7 KB
  • generate_samples.py19.4 KB
  • get_real_videos.py8.2 KB
  • index.html38.8 KB
  • loader.py8.9 KB
  • logo.png8.5 KB
  • process_downloaded.py4.6 KB
  • real_running_preview.png195.6 KB
  • real_video_preview.png330.6 KB
  • realtime_predictor.py14.3 KB
  • requirements.txt1.9 KB
  • script.js13.8 KB
  • styles.css39.4 KB
  • train_model.py20.5 KB
  • video_preview.png61.3 KB
  • visualize_dataset.py18 KB
database.cpython-313.pycanalyze_traffic_flow.pyadvanced_example.pyconvert_videos.py
convert_videos.py
Raw Download
Find: Go to:
"""
==================================================================================
    Action Recognition Dataset - Video Converter
==================================================================================
    Project: Action Recognition Dataset
    Category: Video Data / Data Science
    
    This script converts videos to browser-compatible H.264 format.
    
==================================================================================
    DEVELOPER INFORMATION
==================================================================================
    Website: RSK World (https://rskworld.in)
    Founded by: Molla Samser
    Designer & Tester: Rima Khatun
    
    Contact Information:
    - Email: help@rskworld.in
    - Email: support@rskworld.in
    - Phone: +91 93305 39277
    
==================================================================================
    COPYRIGHT
==================================================================================
    (C) 2026 RSK World. All Rights Reserved.
    
==================================================================================

Usage:
    python convert_videos.py
"""

import os
import subprocess
import sys
from pathlib import Path

def check_ffmpeg():
    """Check if FFmpeg is available"""
    try:
        subprocess.run(['ffmpeg', '-version'], capture_output=True, check=True)
        return True
    except (subprocess.CalledProcessError, FileNotFoundError):
        return False

def convert_video_ffmpeg(input_path, output_path):
    """Convert video using FFmpeg"""
    cmd = [
        'ffmpeg', '-y',
        '-i', str(input_path),
        '-c:v', 'libx264',
        '-preset', 'fast',
        '-crf', '23',
        '-c:a', 'aac',
        '-movflags', '+faststart',
        str(output_path)
    ]
    subprocess.run(cmd, capture_output=True, check=True)

def convert_all_videos():
    """Convert all videos in sample_data to browser-compatible format"""
    sample_dir = Path('sample_data')
    
    if not sample_dir.exists():
        print("No sample_data directory found!")
        return
    
    videos = list(sample_dir.glob('**/*.mp4'))
    print(f"Found {len(videos)} videos to convert")
    
    for i, video_path in enumerate(videos, 1):
        print(f"[{i}/{len(videos)}] Converting: {video_path}")
        
        # Create temporary output path
        temp_path = video_path.with_suffix('.temp.mp4')
        
        try:
            convert_video_ffmpeg(video_path, temp_path)
            
            # Replace original with converted
            os.remove(video_path)
            os.rename(temp_path, video_path)
            
            print(f"  [OK] Converted successfully")
        except Exception as e:
            print(f"  [ERROR] Failed to convert: {e}")
            if temp_path.exists():
                os.remove(temp_path)
    
    print("\nConversion complete!")

if __name__ == '__main__':
    if not check_ffmpeg():
        print("FFmpeg not found! Installing via pip...")
        print("Alternatively, download FFmpeg from: https://ffmpeg.org/download.html")
        print("\nTrying imageio-ffmpeg as fallback...")
        
        try:
            import imageio_ffmpeg
            print("imageio-ffmpeg is available")
        except ImportError:
            print("Installing imageio-ffmpeg...")
            subprocess.run([sys.executable, '-m', 'pip', 'install', 'imageio-ffmpeg'], check=True)
    
    convert_all_videos()

107 lines•3.5 KB
python
🚀 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