### Install NVIDIA Container Toolkit on Debian/Ubuntu Source: https://github.com/jms1717/8mb.local/blob/main/README.md Install the NVIDIA Container Toolkit, which is required for GPU access within Docker containers. This involves adding the NVIDIA repository and installing the toolkit package. Restart Docker after installation. ```bash curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey \ | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg distribution=$(. /etc/os-release; echo $ID$VERSION_ID) curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list \ | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' \ | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit sudo systemctl restart docker ``` -------------------------------- ### Get Size Buttons Source: https://context7.com/jms1717/8mb.local/llms.txt Retrieves the list of quick-pick target size values (in MB) displayed as buttons in the UI. ```bash curl http://localhost:8001/api/settings/size-buttons # Response: {"buttons": [8.0, 9.7, 25.0, 50.0, 100.0]} ``` -------------------------------- ### Get Startup Information Source: https://context7.com/jms1717/8mb.local/llms.txt Exposes container boot ID and codec-visibility sync status, useful for the UI to detect restarts and display sync banners. ```bash curl http://localhost:8001/api/startup/info # Response: # { # "boot_id": "4f8a1bc2d3e4f5a6b7c8d9e0f1a2b3c4", # "boot_ts": 1714000000, # "codec_visibility_synced": true, # "codec_visibility_synced_at": 1714000012 # } ``` -------------------------------- ### Build and Run from Source (NVIDIA GPU) Source: https://github.com/jms1717/8mb.local/blob/main/README.md Builds the 8mb.local Docker image from source and starts the services using Docker Compose, enabling NVIDIA GPU support. Requires the NVIDIA Container Toolkit. ```bash git clone https://github.com/JMS1717/8mb.local.git cd 8mb.local docker compose up -d --build ``` -------------------------------- ### Get Size Buttons Source: https://context7.com/jms1717/8mb.local/llms.txt Retrieves the list of quick-pick target size values (MB) displayed as buttons in the UI. ```APIDOC ## GET /api/settings/size-buttons ### Description Gets the list of quick-pick target size values (MB) shown as buttons in the UI. ### Method GET ### Endpoint /api/settings/size-buttons ### Response #### Success Response (200) - **buttons** (array) - An array of numbers representing target sizes in MB. ### Response Example ```json { "buttons": [8.0, 9.7, 25.0, 50.0, 100.0] } ``` ``` -------------------------------- ### Get System Capabilities Source: https://context7.com/jms1717/8mb.local/llms.txt Returns detailed system information: CPU, memory, GPU list (via `nvidia-smi`), and worker hardware type. ```APIDOC ## GET /api/system/capabilities ### Description Returns detailed system information: CPU, memory, GPU list (via `nvidia-smi`), and worker hardware type. ### Method GET ### Endpoint /api/system/capabilities ### Response #### Success Response (200) - **cpu_count** (integer) - Number of CPU cores. - **memory_gb** (number) - Total system memory in gigabytes. - **gpus** (array) - List of detected GPUs. - **name** (string) - Name of the GPU. - **vram_mb** (integer) - Video RAM in megabytes. - **hardware** (object) - Information about the worker hardware. ``` -------------------------------- ### Get Available Codecs Source: https://context7.com/jms1717/8mb.local/llms.txt Returns the list of codecs enabled by the user's Settings UI combined with hardware detection results. ```APIDOC ## GET /api/codecs/available ### Description Returns the list of codecs enabled by the user's Settings UI combined with hardware detection results. ### Method GET ### Endpoint /api/codecs/available ### Response #### Success Response (200) - **hardware_type** (string) - The detected hardware type (e.g., "nvidia"). - **available_encoders** (object) - A map of available hardware encoders. - **h264** (string) - Encoder for H.264. - **hevc** (string) - Encoder for HEVC. - **av1** (string) - Encoder for AV1. - **enabled_codecs** (array) - A list of all enabled codec strings. ``` -------------------------------- ### Get Startup Information Source: https://context7.com/jms1717/8mb.local/llms.txt Retrieves container boot ID and codec-visibility sync status, used by the UI to detect restarts and display sync banners. No authentication is required. ```APIDOC ## GET /api/startup/info ### Description Expose container boot ID and codec-visibility sync status — used by the UI to detect restarts and show sync banners. ### Method GET ### Endpoint /api/startup/info ### Response #### Success Response (200) - **boot_id** (string) - The unique identifier for the container boot. - **boot_ts** (integer) - The timestamp when the container booted. - **codec_visibility_synced** (boolean) - Indicates if codec visibility is synced. - **codec_visibility_synced_at** (integer) - The timestamp when codec visibility was last synced. #### Response Example ```json { "boot_id": "4f8a1bc2d3e4f5a6b7c8d9e0f1a2b3c4", "boot_ts": 1714000000, "codec_visibility_synced": true, "codec_visibility_synced_at": 1714000012 } ``` ``` -------------------------------- ### Get Codec Visibility Flags Source: https://context7.com/jms1717/8mb.local/llms.txt Retrieves the UI visibility status for each available codec. No authentication is required. ```bash curl http://localhost:8001/api/settings/codecs # Response: # { # "h264_nvenc": true, # "hevc_nvenc": true, # "av1_nvenc": true, # "libx264": true, # "libx265": true, # "libsvtav1": true, # "libaom_av1": false # } ``` -------------------------------- ### Check Docker Container Logs Source: https://github.com/jms1717/8mb.local/blob/main/README.md Use `docker logs` to inspect startup and runtime errors for the container. This is helpful for diagnosing why a container might not be starting correctly. ```bash docker logs 8mblocal ``` -------------------------------- ### Get Codec Visibility Source: https://context7.com/jms1717/8mb.local/llms.txt Retrieves the per-codec UI visibility flags. No authentication required. ```APIDOC ## GET /api/settings/codecs ### Description Gets per-codec UI visibility flags. ### Method GET ### Endpoint /api/settings/codecs ### Response #### Success Response (200) - **codec_name** (boolean) - Indicates if the codec is visible in the UI. ### Response Example ```json { "h264_nvenc": true, "hevc_nvenc": true, "av1_nvenc": true, "libx264": true, "libx265": true, "libsvtav1": true, "libaom_av1": false } ``` ``` -------------------------------- ### Verify Docker Installation and GPU Access Source: https://github.com/jms1717/8mb.local/blob/main/README.md A set of commands to verify the 8mb.local container is running, check NVIDIA GPU accessibility within the container, list available FFmpeg encoders, and view container logs. ```bash # Check container status docker ps | grep 8mblocal # Check NVIDIA GPU access docker exec 8mblocal nvidia-smi # List available encoders docker exec 8mblocal bash -c "ffmpeg -hide_banner -encoders | grep -E 'nvenc|264|265|av1'" # View startup logs docker logs 8mblocal ``` -------------------------------- ### Get Available Enabled Codecs Source: https://context7.com/jms1717/8mb.local/llms.txt Lists all codecs that are enabled in the user's settings and also detected as available through hardware acceleration. This helps determine which codecs can be used for encoding. ```bash curl http://localhost:8001/api/codecs/available # Response: # { # "hardware_type": "nvidia", # "available_encoders": {"h264": "h264_nvenc", "hevc": "hevc_nvenc", "av1": "av1_nvenc"}, # "enabled_codecs": ["h264_nvenc", "hevc_nvenc", "av1_nvenc", "libx264", "libx265", "libsvtav1"] # } ``` -------------------------------- ### GET /api/version Source: https://context7.com/jms1717/8mb.local/llms.txt Retrieves the application version that was baked into the Docker image at build time. ```APIDOC ## GET /api/version ### Description Returns the application version baked into the image at build time. ### Method GET ### Endpoint /api/version ### Response #### Success Response (200) - **version** (string) - The application version. ``` -------------------------------- ### Get Default Preset Values Source: https://context7.com/jms1717/8mb.local/llms.txt Retrieves the current default preset values used by the UI. This endpoint does not require authentication. ```bash curl http://localhost:8001/api/settings/presets ``` -------------------------------- ### Update NVIDIA Driver on Debian 12 Source: https://github.com/jms1717/8mb.local/blob/main/README.md Install the latest NVIDIA driver (550+) on Debian 12 to resolve NVENC API version mismatches. Ensure to reboot after installation. ```bash wget https://developer.download.nvidia.com/compute/cuda/repos/debian12/x86_64/cuda-keyring_1.1-1_all.deb sudo dpkg -i cuda-keyring_1.1-1_all.deb sudo apt update && sudo apt install nvidia-driver sudo reboot ``` -------------------------------- ### GET /api/settings/presets Source: https://context7.com/jms1717/8mb.local/llms.txt Retrieves the current default preset values that are loaded by the UI when it opens. This endpoint does not require authentication. ```APIDOC ## GET /api/settings/presets ### Description Get current default preset values loaded by the UI on page open. No auth required. ### Method GET ### Endpoint /api/settings/presets ### Request Example ```bash curl http://localhost:8001/api/settings/presets ``` ### Response #### Success Response (200) - **target_mb** (number) - Target file size in megabytes. - **video_codec** (string) - The video codec to use. - **audio_codec** (string) - The audio codec to use. - **preset** (string) - The encoding preset to use. - **audio_kbps** (number) - The audio bitrate in kilobits per second. - **container** (string) - The container format. - **tune** (string) - The encoding tune profile. #### Response Example ```json { "target_mb": 9.7, "video_codec": "av1_nvenc", "audio_codec": "libopus", "preset": "p6", "audio_kbps": 128, "container": "mp4", "tune": "hq" } ``` ``` -------------------------------- ### POST /api/upload Source: https://context7.com/jms1717/8mb.local/llms.txt Uploads a single video file to the server. After saving the file, it runs ffprobe to get metadata and provides bitrate estimates for compression settings. ```APIDOC ## POST /api/upload ### Description Upload a single video file. The backend saves the file, runs `ffprobe` to extract metadata, and returns bitrate estimates to help the caller choose compression settings. Requires Basic auth when `AUTH_ENABLED=true`. ### Method POST ### Endpoint /api/upload ### Parameters #### Form Data - **file** (file) - Required - The video file to upload. - **target_size_mb** (number) - Optional - The target compressed file size in megabytes. - **audio_bitrate_kbps** (integer) - Optional - The desired audio bitrate in kilobits per second. ### Request Example ```bash curl -X POST http://localhost:8001/api/upload \ -u admin:changeme \ -F "file=@sample.mp4" \ -F "target_size_mb=9.7" \ -F "audio_bitrate_kbps=128" ``` ### Response #### Success Response (200) - **job_id** (string) - Unique identifier for the compression job. - **filename** (string) - The filename of the saved video. - **duration_s** (number) - The duration of the video in seconds. - **original_video_bitrate_kbps** (number) - The original video bitrate in kbps. - **original_audio_bitrate_kbps** (number) - The original audio bitrate in kbps. - **original_width** (integer) - The original video width. - **original_height** (integer) - The original video height. - **original_video_fps** (number) - The original video frames per second. - **estimate_total_kbps** (number) - Estimated total bitrate in kbps for the compressed file. - **estimate_video_kbps** (number) - Estimated video bitrate in kbps for the compressed file. - **warn_low_quality** (boolean) - Flag indicating if the estimated quality is low. ``` -------------------------------- ### Run Docker Container with NVIDIA GPU Source: https://github.com/jms1717/8mb.local/blob/main/README.md Use this command to run the 8mb.local Docker container with NVIDIA GPU acceleration. Ensure the NVIDIA Container Toolkit is installed on the host. ```bash docker run -d \ --name 8mblocal \ --gpus all \ -e NVIDIA_DRIVER_CAPABILITIES=compute,video,utility \ -p 8001:8001 \ -v ./uploads:/app/uploads \ -v ./outputs:/app/outputs \ jms1717/8mblocal:latest ``` -------------------------------- ### Get System Capabilities Source: https://context7.com/jms1717/8mb.local/llms.txt Retrieve detailed system information, including CPU core count, available memory, GPU details (if applicable), and the detected worker hardware type. ```bash curl http://localhost:8001/api/system/capabilities # Response includes cpu_count, memory_gb, gpus: [{name, vram_mb}], hardware: {...} ``` -------------------------------- ### Get Application Version API Source: https://context7.com/jms1717/8mb.local/llms.txt Retrieve the current version of the 8mb.local application. This version is baked into the Docker image at build time. ```bash curl http://localhost:8001/api/version # Response: {"version":"137"} ``` -------------------------------- ### GET /api/settings/preset-profiles Source: https://context7.com/jms1717/8mb.local/llms.txt Lists all saved named preset profiles and identifies the currently active default profile. This endpoint does not require authentication. ```APIDOC ## GET /api/settings/preset-profiles ### Description List all saved named preset profiles and the currently active default profile name. No auth required. ### Method GET ### Endpoint /api/settings/preset-profiles ### Request Example ```bash curl http://localhost:8001/api/settings/preset-profiles ``` ### Response #### Success Response (200) - **profiles** (array of objects) - A list of saved preset profiles. - **name** (string) - The name of the preset profile. - **target_mb** (number) - Target file size in megabytes. - **video_codec** (string) - The video codec used. - **audio_codec** (string) - The audio codec used. - **preset** (string) - The encoding preset. - **audio_kbps** (number) - The audio bitrate in kilobits per second. - **container** (string) - The container format. - **tune** (string) - The encoding tune profile. - **max_output_fps** (number or null) - Maximum output frames per second, if set. - **default** (string) - The name of the currently active default profile. #### Response Example ```json { "profiles": [ { "name": "Discord 8MB", "target_mb": 9.7, "video_codec": "av1_nvenc", "audio_codec": "libopus", "preset": "p6", "audio_kbps": 128, "container": "mp4", "tune": "hq", "max_output_fps": null } ], "default": "Discord 8MB" } ``` ``` -------------------------------- ### Update NVIDIA Driver on Ubuntu Source: https://github.com/jms1717/8mb.local/blob/main/README.md Update to NVIDIA driver 550+ on Ubuntu using the graphics-drivers PPA. A reboot is required after the installation. ```bash sudo add-apt-repository ppa:graphics-drivers/ppa sudo apt update && sudo apt install nvidia-driver-550 sudo reboot ``` -------------------------------- ### GET /api/stream/{task_id} Source: https://context7.com/jms1717/8mb.local/llms.txt Open a Server-Sent Events stream for real-time progress, FFmpeg log lines, ETA, and completion notification. No authentication required. ```APIDOC ## GET /api/stream/{task_id} ### Description Open a Server-Sent Events stream for real-time progress, FFmpeg log lines, ETA, and completion notification. No authentication required. ### Method GET ### Endpoint /api/stream/{task_id} ### Parameters #### Path Parameters - **task_id** (string) - Required - The ID of the task to stream progress for. ### Request Example ```javascript // Browser / JavaScript const es = new EventSource(`http://localhost:8001/api/stream/${taskId}`); es.onmessage = (event) => { const msg = JSON.parse(event.data); // msg.type: "connected" | "progress" | "log" | "done" | "error" | "canceled" | "retry" | "ping" if (msg.type === "progress") { console.log(`Progress: ${msg.progress}% Phase: ${msg.phase} ETA: ${msg.eta_seconds}s Speed: ${msg.speed_x}x`); } else if (msg.type === "log") { console.log("FFmpeg:", msg.message); } else if (msg.type === "done") { console.log("Done!", msg.stats); // msg.stats: { input_path, output_path, duration_s, target_size_mb, final_size_mb } es.close(); } else if (msg.type === "error") { console.error("Error:", msg.message); es.close(); } }; // With credentials (when auth enabled) const es = new EventSource(`http://localhost:8001/api/stream/${taskId}`, { withCredentials: true, }); ``` ```bash # curl – observe raw SSE frames curl -N http://localhost:8001/api/stream/a1b2c3d4-e5f6-7890-abcd-ef1234567890 # data: {"type":"connected","task_id":"a1b2c3d4...","ts":1714000000.0} # data: {"type":"log","message":"Initializing: detecting hardware…","task_id":"a1b2c3d4..."} # data: {"type":"progress","progress":12.5,"phase":"encoding","eta_seconds":38.2,"speed_x":2.1,"task_id":"a1b2c3d4..."} # data: {"type":"progress","progress":90.0,"phase":"finalizing","task_id":"a1b2c3d4..."} # data: {"type":"done","stats":{"final_size_mb":9.6,"duration_s":62.4,...},"task_id":"a1b2c3d4..."} ``` > **Reverse proxy note:** SSE requires `proxy_buffering off` in nginx or equivalent to prevent events being batched. See the README for Nginx/Traefik/Apache snippets. ``` -------------------------------- ### GET /api/jobs/{task_id}/download Source: https://context7.com/jms1717/8mb.local/llms.txt Download the compressed output file. Supports optional `?wait=` (max 5 s) to poll briefly for file availability. Returns `video/mp4` or `video/x-matroska`. ```APIDOC ## GET /api/jobs/{task_id}/download ### Description Download the compressed output file. Supports optional `?wait=` (max 5 s) to poll briefly for file availability. Returns `video/mp4` or `video/x-matroska`. ### Method GET ### Endpoint /api/jobs/{task_id}/download ### Parameters #### Path Parameters - **task_id** (string) - Required - The ID of the task whose output file should be downloaded. #### Query Parameters - **wait** (integer) - Optional - Maximum seconds to wait for file availability (max 5). ### Request Example ```bash # Poll and download in a shell script TASK_ID="a1b2c3d4-e5f6-7890-abcd-ef1234567890" # Wait for completion by watching SSE, then download curl -u admin:changeme \ "http://localhost:8001/api/jobs/${TASK_ID}/download?wait=5" \ -o compressed_output.mp4 # Check return code if [ $? -eq 0 ]; then echo "Download complete" else echo "File not ready yet (404 with Retry-After: 1 header)" fi ``` ``` -------------------------------- ### Get Hardware Information Source: https://context7.com/jms1717/8mb.local/llms.txt Returns detected hardware acceleration type and available NVENC encoder map, plus the recommended codec chosen by priority (AV1 > HEVC > H.264). ```APIDOC ## GET /api/hardware ### Description Returns detected hardware acceleration type and available NVENC encoder map, plus the recommended codec chosen by priority (AV1 > HEVC > H.264). ### Method GET ### Endpoint /api/hardware ### Response #### Success Response (200) - **type** (string) - The detected hardware type (e.g., "nvidia", "cpu"). - **available_encoders** (object) - A map of available encoders. - **h264** (string) - Encoder for H.264. - **hevc** (string) - Encoder for HEVC. - **av1** (string) - Encoder for AV1. - **decode_method** (string) - The hardware decode method (e.g., "cuda"). - **preferred** (object) - The preferred encoding settings. - **base** (string) - The base preferred codec (e.g., "av1"). - **encoder** (string) - The preferred encoder string. - **hardware** (boolean) - Indicates if hardware acceleration is preferred. ``` -------------------------------- ### Get Hardware Acceleration Information Source: https://context7.com/jms1717/8mb.local/llms.txt Retrieve information about detected hardware acceleration types, available NVENC encoders, and the system's preferred video codec. This response varies based on whether NVIDIA hardware is present or if the system relies on CPU encoding. ```bash curl http://localhost:8001/api/hardware # NVIDIA response: # { # "type": "nvidia", # "available_encoders": { # "h264": "h264_nvenc", # "hevc": "hevc_nvenc", # "av1": "av1_nvenc" # }, # "decode_method": "cuda", # "preferred": { # "base": "av1", # "encoder": "av1_nvenc", # "hardware": true # } # } # CPU-only response: # { # "type": "cpu", # "available_encoders": { # "h264": "libx264", # "hevc": "libx265", # "av1": "libsvtav1" # }, # "preferred": {"base": "av1", "encoder": "libsvtav1", "hardware": false} # } ``` -------------------------------- ### GET /api/diagnostics/gpu Source: https://context7.com/jms1717/8mb.local/llms.txt Runs live GPU diagnostic checks within the container, including device file presence, nvidia-smi output, ffmpeg hardware acceleration and encoder information, and an NVENC smoke encode. All checks run concurrently and require Basic authentication. ```APIDOC ## GET /api/diagnostics/gpu ### Description Run live GPU diagnostic checks inside the container: device file presence, `nvidia-smi -L`, `ffmpeg -hwaccels`, `ffmpeg -encoders`, and an NVENC smoke encode. All checks run concurrently. Requires Basic auth. ### Method GET ### Endpoint /api/diagnostics/gpu ### Request Example ```bash curl -u admin:changeme http://localhost:8001/api/diagnostics/gpu ``` ### Response #### Success Response (200) - **summary** (object) - Summary of diagnostic check results. - **nvidia_device_present** (boolean) - **nvidia_smi_ok** (boolean) - **ffmpeg_sees_cuda** (boolean) - **ffmpeg_has_nvenc** (boolean) - **nvenc_encode_ok** (boolean) - **checks** (object) - Detailed results of individual checks. - **device_files** (array of objects) - **nvidia_smi_L** (object) - **ffmpeg_hwaccels** (object) - **nvenc_smoke_test** (object) #### Response Example ```json { "summary": { "nvidia_device_present": true, "nvidia_smi_ok": true, "ffmpeg_sees_cuda": true, "ffmpeg_has_nvenc": true, "nvenc_encode_ok": true }, "checks": { "device_files": [{"path": "/dev/nvidia0", "exists": true}], "nvidia_smi_L": {"cmd": "nvidia-smi -L", "rc": 0, "stdout": "GPU 0: NVIDIA ..."}, "ffmpeg_hwaccels": {"rc": 0, "stdout": "Hardware acceleration methods:\n cuda\n..."}, "nvenc_smoke_test": {"rc": 0, "stdout": "", "stderr": ""} } } ``` ``` -------------------------------- ### Get Compression History Source: https://context7.com/jms1717/8mb.local/llms.txt Retrieves compression history entries, with an optional limit parameter. Returns an empty list and disabled status if history is not enabled. Requires Basic authentication. ```bash curl -u admin:changeme "http://localhost:8001/api/history?limit=20" # Response: # { # "entries": [ # { # "task_id": "a1b2c3...", # "filename": "uuid_clip.mp4", # "original_size_mb": 245.3, # "compressed_size_mb": 9.6, # "video_codec": "av1_nvenc", # "audio_codec": "libopus", # "target_mb": 9.7, # "preset": "p6", # "duration": 22.4, # "container": "mp4", # "timestamp": 1714000120.0 # } # ], # "enabled": true # } ``` -------------------------------- ### Get Compression History Source: https://context7.com/jms1717/8mb.local/llms.txt Retrieves compression history entries. Requires Basic Authentication. Returns `{"entries": [], "enabled": false}` when history is disabled. ```APIDOC ## GET /api/history ### Description Retrieves compression history entries. ### Method GET ### Endpoint /api/history ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of entries to retrieve. ### Response #### Success Response (200) - **entries** (array) - An array of history entry objects. - **task_id** (string) - The ID of the compression task. - **filename** (string) - The name of the file. - **original_size_mb** (number) - The original size of the file in MB. - **compressed_size_mb** (number) - The compressed size of the file in MB. - **video_codec** (string) - The video codec used. - **audio_codec** (string) - The audio codec used. - **target_mb** (number) - The target size in MB. - **preset** (string) - The encoding preset used. - **duration** (number) - The duration of the compression in seconds. - **container** (string) - The container format. - **timestamp** (number) - The Unix timestamp of the compression. - **enabled** (boolean) - Indicates if history tracking is enabled. ### Response Example ```json { "entries": [ { "task_id": "a1b2c3...", "filename": "uuid_clip.mp4", "original_size_mb": 245.3, "compressed_size_mb": 9.6, "video_codec": "av1_nvenc", "audio_codec": "libopus", "target_mb": 9.7, "preset": "p6", "duration": 22.4, "container": "mp4", "timestamp": 1714000120.0 } ], "enabled": true } ``` ``` -------------------------------- ### Fix Reverse Proxy Buffering for SSE Source: https://github.com/jms1717/8mb.local/blob/main/README.md If the progress bar gets stuck at 0%, this is likely due to reverse proxy buffering Server-Sent Events (SSE) responses. Add `proxy_buffering off;` to the relevant location in your reverse proxy configuration. ```nginx proxy_buffering off; ``` -------------------------------- ### Get Queue Status Source: https://context7.com/jms1717/8mb.local/llms.txt Get live queue state: all active, running, and recently completed jobs (last hour). Requires Basic auth. ```APIDOC ## GET /api/queue/status ### Description Get live queue state: all active, running, and recently completed jobs (last hour). Requires Basic auth. ### Method GET ### Endpoint /api/queue/status ### Authentication Basic Auth ### Request Example ```bash curl -u admin:changeme http://localhost:8001/api/queue/status ``` ### Response #### Success Response (200) - **active_jobs** (array) - List of active jobs. - **task_id** (string) - The ID of the task. - **job_id** (string) - The ID of the job. - **filename** (string) - The name of the file. - **target_size_mb** (number) - The target size in megabytes. - **video_codec** (string) - The video codec used. - **state** (string) - The current state of the job (e.g., "running"). - **progress** (number) - The progress of the job in percentage. - **phase** (string) - The current phase of the job (e.g., "encoding"). - **created_at** (number) - Timestamp when the job was created. - **started_at** (number) - Timestamp when the job started. - **completed_at** (number | null) - Timestamp when the job completed. - **error** (string | null) - Any error message associated with the job. - **final_size_mb** (number | null) - The final size of the output file in megabytes. - **estimated_completion_time** (number) - Estimated time of completion in seconds. - **queued_count** (integer) - Number of jobs in the queue. - **running_count** (integer) - Number of currently running jobs. - **completed_count** (integer) - Number of completed jobs. ``` -------------------------------- ### Set Size Buttons Source: https://context7.com/jms1717/8mb.local/llms.txt Configures custom target size quick-pick buttons for the UI. Requires Basic authentication. ```bash curl -X PUT http://localhost:8001/api/settings/size-buttons \ -u admin:changeme \ -H "Content-Type: application/json" \ -d '{"buttons": [8.0, 9.7, 25.0, 50.0, 100.0, 500.0]}' # Response: {"status": "success"} ``` -------------------------------- ### Create New Preset Profile Source: https://context7.com/jms1717/8mb.local/llms.txt Creates a new named preset profile with specified video and audio settings, including target bitrate, codecs, preset, container, and tune. Requires Basic authentication. ```bash curl -X POST http://localhost:8001/api/settings/preset-profiles \ -u admin:changeme \ -H "Content-Type: application/json" \ -d '{ "name": "Telegram 50MB", "target_mb": 49.0, "video_codec": "h264_nvenc", "audio_codec": "aac", "preset": "p4", "audio_kbps": 128, "container": "mp4", "tune": "hq", "max_output_fps": 30.0 }' ``` -------------------------------- ### Get Batch Status Source: https://context7.com/jms1717/8mb.local/llms.txt Poll progress for all items in a batch. ```APIDOC ## GET /api/batches/{batch_id}/status ### Description Poll progress for all items in a batch. ### Method GET ### Endpoint /api/batches/{batch_id}/status ### Authentication Basic Auth ### Parameters #### Path Parameters - **batch_id** (string) - Required - The ID of the batch to query. ### Request Example ```bash curl -u admin:changeme \ http://localhost:8001/api/batches/b1c2d3e4-f5a6-7890-bcde-f12345678901/status ``` ### Response #### Success Response (200) - **batch_id** (string) - The ID of the batch. - **state** (string) - The overall state of the batch (e.g., "running"). - **item_count** (integer) - Total number of items in the batch. - **queued_count** (integer) - Number of items currently queued. - **running_count** (integer) - Number of items currently running. - **completed_count** (integer) - Number of items completed. - **failed_count** (integer) - Number of items that failed. - **overall_progress** (number) - The overall progress of the batch in percentage. - **items** (array) - A list of items within the batch (structure similar to upload response items). - **zip_download_url** (string | null) - URL to download the batch as a ZIP archive if available. ``` -------------------------------- ### Build and Run from Source (CPU Only) Source: https://github.com/jms1717/8mb.local/blob/main/README.md Builds and runs the 8mb.local Docker image from source using a specific Compose file for CPU-only environments. This is suitable for macOS or systems without NVIDIA GPU passthrough. ```bash docker compose -f docker-compose.cpu.yml up -d --build ``` -------------------------------- ### Quick Diagnostic Commands for 8mb.local Source: https://github.com/jms1717/8mb.local/blob/main/README.md A collection of useful Docker commands for diagnosing issues with the 8mb.local container, including checking its status, viewing logs, verifying GPU visibility, and checking NVENC availability. ```bash docker ps | grep 8mblocal ``` ```bash docker logs 8mblocal ``` ```bash docker exec 8mblocal nvidia-smi ``` ```bash docker exec 8mblocal ffmpeg -hide_banner -encoders 2>&1 | grep nvenc ``` ```bash docker restart 8mblocal ``` ```bash docker logs -f 8mblocal ``` -------------------------------- ### Get Retention Hours Source: https://context7.com/jms1717/8mb.local/llms.txt Retrieves the file retention period in hours after which uploads and outputs are auto-deleted. ```APIDOC ## GET /api/settings/retention-hours ### Description Gets the file retention period (hours) after which uploads and outputs are auto-deleted. ### Method GET ### Endpoint /api/settings/retention-hours ### Response #### Success Response (200) - **hours** (integer) - The retention period in hours. ### Response Example ```json { "hours": 1 } ``` ``` -------------------------------- ### Get Worker Concurrency Source: https://context7.com/jms1717/8mb.local/llms.txt Retrieves the configured maximum number of parallel compression jobs. Requires Basic Authentication. ```APIDOC ## GET /api/settings/worker-concurrency ### Description Gets the configured maximum number of parallel compression jobs. ### Method GET ### Endpoint /api/settings/worker-concurrency ### Response #### Success Response (200) - **concurrency** (integer) - The maximum number of parallel compression jobs. ### Response Example ```json { "concurrency": 4 } ``` ``` -------------------------------- ### Get Worker Concurrency Source: https://context7.com/jms1717/8mb.local/llms.txt Retrieves the configured maximum number of parallel compression jobs. Requires Basic authentication. ```bash curl -u admin:changeme http://localhost:8001/api/settings/worker-concurrency # Response: {"concurrency": 4} ``` -------------------------------- ### Get Retention Hours Source: https://context7.com/jms1717/8mb.local/llms.txt Retrieves the current file retention period in hours, after which uploads and outputs are automatically deleted. ```bash curl -u admin:changeme http://localhost:8001/api/settings/retention-hours # Response: {"hours": 1} ``` -------------------------------- ### Adjust File Permissions Source: https://github.com/jms1717/8mb.local/blob/main/README.md If you encounter 'Permission denied' errors for uploads or outputs, use these commands to set appropriate permissions or ownership for the respective directories. ```bash chmod 777 uploads outputs ``` ```bash chown $USER:$USER uploads outputs ``` -------------------------------- ### Docker Deployment (NVIDIA GPU) Source: https://context7.com/jms1717/8mb.local/llms.txt Command to run the 8mb.local Docker container with NVIDIA GPU support. Requires setting environment variables for authentication, worker concurrency, and volume mounts. ```bash # NVIDIA GPU docker run -d \ --name 8mblocal \ --gpus all \ -e NVIDIA_DRIVER_CAPABILITIES=compute,video,utility \ -e AUTH_ENABLED=false \ -e WORKER_CONCURRENCY=6 \ -p 8001:8001 \ -v ./uploads:/app/uploads \ -v ./outputs:/app/outputs \ -v ./.env:/app/.env \ jms1717/8mblocal:latest ``` -------------------------------- ### GET /api/jobs/{task_id}/status Source: https://context7.com/jms1717/8mb.local/llms.txt Poll Celery task state. Useful as a lightweight alternative to SSE for headless clients. ```APIDOC ## GET /api/jobs/{task_id}/status ### Description Poll Celery task state. Useful as a lightweight alternative to SSE for headless clients. ### Method GET ### Endpoint /api/jobs/{task_id}/status ### Parameters #### Path Parameters - **task_id** (string) - Required - The ID of the task to check the status for. ### Request Example ```bash curl -u admin:changeme \ http://localhost:8001/api/jobs/a1b2c3d4-e5f6-7890-abcd-ef1234567890/status # Response: # { # "state": "PROGRESS", # PENDING | STARTED | PROGRESS | SUCCESS | FAILURE # "progress": 45.2, # "detail": null # } ``` ``` -------------------------------- ### Download Batch Output as ZIP Source: https://context7.com/jms1717/8mb.local/llms.txt Download all completed output files from a batch as a single ZIP archive. Returns a 404 error if no files have finished processing yet. Requires Basic authentication. ```bash curl -u admin:changeme \ "http://localhost:8001/api/batches/b1c2d3e4-f5a6-7890-bcde-f12345678901/download.zip" \ -o batch_output.zip ``` -------------------------------- ### Get Queue Status Source: https://github.com/jms1717/8mb.local/blob/main/docs/QUEUE_SYSTEM.md Retrieves the current state of the queue, including all active jobs and counts of jobs in different states. ```APIDOC ## GET /api/queue/status ### Description Returns current queue state with all active jobs. ### Method GET ### Endpoint /api/queue/status ### Response #### Success Response (200) - **active_jobs** (array) - List of active jobs with detailed information. - **queued_count** (integer) - Number of jobs currently in the queued state. - **running_count** (integer) - Number of jobs currently being processed. - **completed_count** (integer) - Number of jobs that have successfully completed. #### Response Example { "active_jobs": [ { "task_id": "abc123...", "job_id": "def456...", "filename": "video.mp4", "target_size_mb": 25.0, "video_codec": "h264_nvenc", "state": "running", "progress": 45.5, "created_at": 1730000000, "started_at": 1730000010, "completed_at": null, "error": null, "output_path": null, "final_size_mb": null } ], "queued_count": 2, "running_count": 3, "completed_count": 5 } ``` -------------------------------- ### Set Size Buttons Source: https://context7.com/jms1717/8mb.local/llms.txt Sets custom target size quick-pick buttons. Requires Basic Authentication. ```APIDOC ## PUT /api/settings/size-buttons ### Description Sets custom target size quick-pick buttons. ### Method PUT ### Endpoint /api/settings/size-buttons ### Parameters #### Request Body - **buttons** (array) - Required - An array of numbers representing target sizes in MB. ### Request Example ```json { "buttons": [8.0, 9.7, 25.0, 50.0, 100.0, 500.0] } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the operation was successful. ### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Docker Deployment (CPU Only) Source: https://context7.com/jms1717/8mb.local/llms.txt Command to run the 8mb.local Docker container using only the CPU. This version does not require GPU-specific configurations. ```bash # CPU only docker run -d \ --name 8mblocal \ -p 8001:8001 \ -v ./uploads:/app/uploads \ -v ./outputs:/app/outputs \ jms1717/8mblocal:latest ``` -------------------------------- ### Run GPU Diagnostics Source: https://context7.com/jms1717/8mb.local/llms.txt Executes live GPU diagnostic checks concurrently within the container. Requires Basic authentication. The response includes a summary of checks and detailed results. ```bash curl -u admin:changeme http://localhost:8001/api/diagnostics/gpu ``` -------------------------------- ### POST /api/settings/preset-profiles Source: https://context7.com/jms1717/8mb.local/llms.txt Creates a new named preset profile with specified encoding settings. This endpoint requires Basic authentication. ```APIDOC ## POST /api/settings/preset-profiles ### Description Create a new named preset profile. Requires Basic auth. ### Method POST ### Endpoint /api/settings/preset-profiles ### Parameters #### Request Body - **name** (string) - Required - The name for the new preset profile. - **target_mb** (number) - Required - Target file size in megabytes. - **video_codec** (string) - Required - The video codec to use. - **audio_codec** (string) - Required - The audio codec to use. - **preset** (string) - Required - The encoding preset to use. - **audio_kbps** (number) - Required - The audio bitrate in kilobits per second. - **container** (string) - Required - The container format. - **tune** (string) - Required - The encoding tune profile. - **max_output_fps** (number or null) - Optional - Maximum output frames per second. ### Request Example ```bash curl -X POST http://localhost:8001/api/settings/preset-profiles \ -u admin:changeme \ -H "Content-Type: application/json" \ -d '{ "name": "Telegram 50MB", "target_mb": 49.0, "video_codec": "h264_nvenc", "audio_codec": "aac", "preset": "p4", "audio_kbps": 128, "container": "mp4", "tune": "hq", "max_output_fps": 30.0 }' ``` ### Response #### Success Response (200) - **status** (string) - Indicates the status of the operation (e.g., "success"). #### Response Example ```json {"status": "success"} ``` ``` -------------------------------- ### Set Queue Polling Interval Source: https://github.com/jms1717/8mb.local/blob/main/docs/QUEUE_SYSTEM.md Configures the frequency at which the frontend fetches the queue status. This example sets the interval to 2 seconds. ```typescript pollInterval = setInterval(fetchQueueStatus, 2000); // 2 seconds ``` -------------------------------- ### Environment Variables for 8mb.local Configuration Source: https://github.com/jms1717/8mb.local/blob/main/README.md Configure 8mb.local settings by creating a .env file. This includes authentication, file retention, worker concurrency, codec visibility, and backend connection details. ```env # Authentication (also configurable via Settings UI) AUTH_ENABLED=false AUTH_USER=admin AUTH_PASS=changeme # File retention FILE_RETENTION_HOURS=1 # Worker concurrency (max parallel jobs) WORKER_CONCURRENCY=4 # Codec visibility (all default to true) CODEC_H264_NVENC=true CODEC_HEVC_NVENC=true CODEC_AV1_NVENC=true CODEC_LIBX264=true CODEC_LIBX265=true CODEC_LIBAOM_AV1=true # Redis / backend (usually no need to change) REDIS_URL=redis://127.0.0.1:6379/0 BACKEND_HOST=0.0.0.0 BACKEND_PORT=8001 ``` -------------------------------- ### Get Authentication Status Source: https://context7.com/jms1717/8mb.local/llms.txt Retrieves the current authentication status, indicating whether authentication is enabled and the active user. No authentication is required for this endpoint. ```bash curl http://localhost:8001/api/settings/auth ``` -------------------------------- ### Get Encoder Test Results Source: https://context7.com/jms1717/8mb.local/llms.txt Returns per-codec encode+decode test results stored in Redis from the most recent startup test or manual re-run. ```APIDOC ## GET /api/system/encoder-tests ### Description Returns per-codec encode+decode test results stored in Redis from the most recent startup test or manual re-run. ### Method GET ### Endpoint /api/system/encoder-tests ### Response #### Success Response (200) - **hardware_type** (string) - The detected hardware type (e.g., "nvidia"). - **any_hardware_passed** (boolean) - Indicates if any hardware encoder tests passed. ``` -------------------------------- ### Update Default Preset Values Source: https://context7.com/jms1717/8mb.local/llms.txt Persists new default preset values for video and audio codecs, bitrate, container, and tune settings. Requires Basic authentication. ```bash curl -X PUT http://localhost:8001/api/settings/presets \ -u admin:changeme \ -H "Content-Type: application/json" \ -d '{ "target_mb": 25.0, "video_codec": "hevc_nvenc", "audio_codec": "aac", "preset": "p5", "audio_kbps": 192, "container": "mp4", "tune": "hq" }' ```