Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions macos-gui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Swift build artifacts
.build/
*.o
*.d

# Generated app bundle
Untrunc.app/

# DMG installer
*.dmg

# Pre-built CLI binary (compiled locally, not committed)
Sources/UntruncGUI/untrunc

# macOS
.DS_Store
48 changes: 48 additions & 0 deletions macos-gui/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>UntruncGUI</string>
<key>CFBundleIdentifier</key>
<string>com.local.UntruncGUI</string>
<key>CFBundleName</key>
<string>Untrunc</string>
<key>CFBundleDisplayName</key>
<string>Untrunc</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>LSMinimumSystemVersion</key>
<string>13.0</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>CFBundleIconFile</key>
<string>AppIcon</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>Video File</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>mp4</string>
<string>m4v</string>
<string>mov</string>
<string>3gp</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
</array>
<key>NSAppleEventsUsageDescription</key>
<string>Untrunc needs access to repair video files.</string>
</dict>
</plist>
17 changes: 17 additions & 0 deletions macos-gui/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// swift-tools-version: 5.9
import PackageDescription

let package = Package(
name: "UntruncGUI",
platforms: [.macOS(.v13)],
targets: [
.executableTarget(
name: "UntruncGUI",
path: "Sources/UntruncGUI",
resources: [
.copy("untrunc"),
.copy("AppIcon.icns")
]
)
]
)
57 changes: 57 additions & 0 deletions macos-gui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Untrunc — macOS GUI

A native macOS SwiftUI application for **untrunc** — drag-and-drop video repair without touching the terminal.

![macOS 13+](https://img.shields.io/badge/macOS-13%2B-blue) ![Swift 5.9](https://img.shields.io/badge/Swift-5.9-orange) ![Architecture](https://img.shields.io/badge/arch-arm64-lightgrey)

## Features

- **Drag & drop** reference file and corrupt file
- All key CLI flags exposed as checkboxes (`-s`, `-sv`, `-k`, `-dw`, `-ms`)
- Live log output streamed in real time
- "Show in Finder" button when repair completes
- Fully self-contained DMG — no Homebrew or FFmpeg needed on the target machine

## Requirements (to build)

- macOS 13 Ventura or later (Apple Silicon)
- Xcode Command Line Tools: `xcode-select --install`
- FFmpeg via Homebrew: `brew install ffmpeg`

## Build & Run

```bash
cd macos-gui
bash build.sh
open Untrunc.app
```

## Create a distributable DMG

```bash
# Also requires: brew install create-dmg
bash package_dmg.sh
# → produces Untrunc-1.0.dmg
```

The DMG bundles all FFmpeg dylibs inside the `.app` and rewrites their
install names to `@loader_path`-relative paths, so the app runs on any
macOS 13+ Apple Silicon machine with no dependencies.

## Project structure

```
macos-gui/
├── Sources/UntruncGUI/
│ ├── UntruncApp.swift # @main SwiftUI entry point
│ ├── ContentView.swift # Full UI (drop zones, options, log panel)
│ ├── UntruncRunner.swift # Runs untrunc CLI as subprocess, streams output
│ └── AppIcon.icns # App icon (regenerate with make_icon.py)
├── Package.swift # Swift Package manifest
├── Info.plist # macOS app bundle metadata
├── build.sh # Compiles untrunc + Swift app → Untrunc.app
├── bundle_libs.sh # Bundles FFmpeg dylibs and rewrites @rpath
├── package_dmg.sh # Full pipeline → Untrunc-1.0.dmg
├── make_icon.py # Generates AppIcon.icns using AppKit
└── make_dmg_bg.py # Generates DMG background image using AppKit
```
Binary file added macos-gui/Sources/UntruncGUI/AppIcon.icns
Binary file not shown.
Loading