# sack-kazu/360videotopictures architecture

> Architecture diagram of the GitHub repository sack-kazu/360videotopictures, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sack-kazu/360videotopictures
- Repository: https://github.com/sack-kazu/360videotopictures

## Overview

##### Main Components
- Unity Engine Environment: The backbone of the project where the Scenes (e.g., 360VideoToPictures.unity), Prefabs (e.g., Cameras and UI_Canvas), and Asset management take place.
- User Interface (UI) Module: Represented by the UI_Canvas.prefab along with the VideoUIManager script. This component gathers input from the user (video file selection, frame rate, field of view, file save location).
- Video Processing Module: Governed by the VideoCaptureController script; this component is responsible for processing the input 360° video (mp4 format) and performing the extraction of images.
- File Browser Integration: Offered by the StandaloneFileBrowser folder and related scripts and plugins; this module facilitates the selection of video files and destination folders.
- Auxiliary Components: This includes the SystemMessage script (for in-game messaging/feedback) and supporting Unity assets (materials, cameras, etc.), making up various Unity prefabs that support visual and interaction layers.

##### Relationships and Interactions
- The UI Module captures user configuration details (save location, video file, frame rate, and horizontal field of view) and passes these parameters to the Video Processing Module.
- The Video Processing Module (VideoCaptureController) interacts with Unity’s rendering pipeline and possibly the camera Prefab components to simulate the four directional capture.
- The File Browser Integration component (via StandaloneFileBrowser) is used by the UI to open dialogs for file selection.
- The SystemMessage component provides system-level feedback or error messages across modules.
- The Unity Engine orchestrates these component interactions within the game loop (executing scenes, prefabs, and script updates).

##### Architectural Patterns and Design Principles
- Component-Based Architecture: Typical for Unity projects, where functionality is split into separate scripts attached to GameObjects (e.g., separate scripts for UI management and video capture).
- Separation of Concerns: Input collection (UI_Canvas and VideoUIManager) is separated from the video processing logic (VideoCaptureController), and file handling is isolated by the Standalone File Browser.
- Integration of External Plugins: The use of the StandaloneFileBrowser plugin shows a clean extension point for external file dialogs within Unity.

##### Relevant Technologies and Frameworks
- Core Platform: Unity (version 2021.3.4f1) with Built-in Render Pipeline (BRP).
- C# for script implementation.
- StandaloneFileBrowser open source project for handling file dialogs.
- Additional Unity asset configurations (Prefabs, Materials, Scenes).

## Diagram (Mermaid)

```mermaid
graph TD
    %% Unity Engine Environment Subgraph
    subgraph "Unity Engine Environment"
        USCENE["Scene: 360VideoToPictures.unity"]:::engine
        UPrefab["UI Prefab: UI_Canvas.prefab"]:::engine
        Cams["Camera Prefab: Cameras.prefab"]:::engine
        Mat["Materials"]:::engine
    end

    %% Application Modules Subgraph
    subgraph "Application Modules"
        UI["UI Module: VideoUIManager"]:::ui
        VP["Video Processing Module: VideoCaptureController"]:::processing
        FB["File Browser Integration: StandaloneFileBrowser"]:::filebrowser
        SM["Auxiliary Feedback: SystemMessage"]:::auxiliary
    end

    %% Relationships within Unity Environment
    USCENE -->|"loads"| UPrefab
    USCENE -->|"loads"| Cams

    %% Relationships among Modules and with Unity Environment
    UPrefab -->|"instantiates"| UI
    UI -->|"sendsInput"| VP
    UI -->|"opensDialog"| FB
    VP -->|"triggersCapture"| Cams
    VP -->|"reportsError"| SM
    SM -->|"feedbackTo"| UI

    %% Click Events
    click USCENE "https://github.com/sack-kazu/360videotopictures/blob/main/Assets/Scenes/360VideoToPictures.unity"
    click UPrefab "https://github.com/sack-kazu/360videotopictures/blob/main/Assets/Prefabs/UI_Canvas.prefab"
    click Cams "https://github.com/sack-kazu/360videotopictures/blob/main/Assets/Prefabs/Cameras.prefab"
    click Mat "https://github.com/sack-kazu/360videotopictures/tree/main/Assets/Materials"
    click UI "https://github.com/sack-kazu/360videotopictures/blob/main/Assets/Scripts/VideoUIManager.cs"
    click VP "https://github.com/sack-kazu/360videotopictures/blob/main/Assets/Scripts/VideoCaptureController.cs"
    click FB "https://github.com/sack-kazu/360videotopictures/tree/main/Assets/StandaloneFileBrowser"
    click SM "https://github.com/sack-kazu/360videotopictures/blob/main/Assets/Scripts/SystemMessage.cs"

    %% Styles
    classDef engine fill:#AED6F1,stroke:#1F618D,stroke-width:2px;
    classDef ui fill:#A9DFBF,stroke:#27AE60,stroke-width:2px;
    classDef processing fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef filebrowser fill:#F5B7B1,stroke:#C0392B,stroke-width:2px;
    classDef auxiliary fill:#D7BDE2,stroke:#8E44AD,stroke-width:2px;
```
