Skip to content
This repository was archived by the owner on Feb 22, 2026. It is now read-only.

shivanandchikkalli/Cryptifyr

Repository files navigation

Media Processor

A production-grade C# console application that processes image and video files with frame extraction capabilities.

Features

  • File Validation: Validates media files for correct format and integrity
  • Temporary Folder Management: Creates isolated temporary folders for safe processing
  • Image Processing: Copies images to processing folder
  • Video Processing: Extracts all frames from video files using FFMpeg
  • Production-Grade Code: Clean architecture, proper error handling, and resource management

Supported Formats

Images

  • .jpg, .jpeg, .png, .gif, .bmp, .webp, .tiff, .ico

Videos

  • .mp4, .avi, .mkv, .mov, .flv, .wmv, .webm, .m4v, .mpg, .mpeg, .3gp

Prerequisites

  • .NET 8.0 or later
  • FFmpeg (required for video processing)

Installation

Build

dotnet build

Run

dotnet run -- "path/to/media/file"

Usage

Basic Usage

MediaProcessor.exe "C:\path\to\image.jpg"
MediaProcessor.exe "C:\path\to\video.mp4"

From Project

dotnet run -- "C:\path\to\media\file.mp4"

Project Structure

MediaProcessor/
├── Models/
│   ├── MediaType.cs              # Enum for media types
│   ├── MediaFile.cs              # Media file model
│   └── OperationResult.cs        # Result pattern for operations
├── Services/
│   ├── FileValidationService.cs  # File validation and format checking
│   ├── TemporaryFolderService.cs # Temp folder creation and cleanup
│   ├── ImageProcessingService.cs # Image operations
│   ├── VideoProcessingService.cs # Video frame extraction
│   └── MediaProcessorService.cs  # Main orchestrator
├── Program.cs                      # Entry point
└── MediaProcessor.csproj          # Project file

How It Works

  1. Validation Phase: Validates file exists and is in a supported format
  2. Folder Creation: Creates a unique temporary folder for the session
  3. Processing Phase:
    • For Images: Copies the image file to the temp folder
    • For Videos: Creates a video-frames subfolder and extracts all frames
  4. Cleanup: Temp folder is retained for user inspection (can be manually deleted)

Architecture

Service-Oriented Design

  • Each service handles a specific responsibility
  • Loose coupling through dependency injection
  • Easy to extend or modify individual components

Error Handling

  • All operations return OperationResult for consistent error reporting
  • Proper exception handling at all levels
  • Informative error messages for debugging

Resource Management

  • Implements IDisposable pattern for proper cleanup
  • Automatic temporary folder management
  • Efficient file handling

Example Output

=== Media Processor ===

Processing file: C:\video.mp4

✓ File validation successful - Type: Video
✓ Temporary folder created: C:\Users\...\AppData\Local\Temp\MediaProcessor\guid\
✓ Video frames folder created: C:\Users\...\AppData\Local\Temp\MediaProcessor\guid\video-frames
✓ Successfully extracted 150 frames from video

✓ Processing completed successfully!
✓ Output folder: C:\Users\...\AppData\Local\Temp\MediaProcessor\guid\

Note: Temporary folder will be retained for your use.
Temp folder location: C:\Users\...\AppData\Local\Temp\MediaProcessor\guid\

Dependencies

  • FFMpegCore (v5.1.0): .NET wrapper for FFmpeg for video frame extraction

Future Enhancements

As mentioned, the next phase will expand this foundation to include:

  • Advanced image processing
  • Video metadata extraction
  • Frame filtering and transformation
  • Batch processing capabilities
  • Output customization

License

[Your License Here]

Notes

  • The temporary folder is intentionally retained for user inspection
  • All file paths support both absolute and relative paths
  • The application uses FFmpeg for video processing, which must be installed separately

About

Encrypt sensitive videos into unplayable noise, decrypt them back anytime with your secret key. #vibecoding

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages