Files
video-converter/DEVELOPMENT_PLAN.md

62 lines
5.7 KiB
Markdown

## Development Plan: Video Converter
This document outlines the development plan for the Video Converter project, aiming to create a standalone Python tool for converting video files into DaVinci Resolve compatible formats.
### Overall Goal
Develop a user-friendly, standalone Python tool to convert video files into formats compatible with Davinci Resolve (Free edition on Linux) to improve editing workflows for content creators.
### Completed Features
* **Core Conversion Logic:** Implemented video conversion using `ffmpeg` with `dnxhd` codec and `pcm_s16le` audio, outputting to `.mov` container.
* **Quality Profile Picker:** Added `--quality` argument (low, medium, high, archive) to control `dnxhd` profiles.
* **Filename Fail-safe:** Implemented logic to append `_1`, `_2`, etc., to output filenames if a file with the same name already exists.
* **`yt-dlp` Integration:** Added `--url` argument to download videos from YouTube (and other supported sites) using `yt-dlp` before conversion.
* **PyInstaller Bundling:** Successfully bundled the application into a standalone executable for Linux.
* **Robust Download Path Handling:** Ensured `yt-dlp` downloads directly to the user-specified output directory (or current working directory if not specified), resolving `os.path.exists()` issues within the PyInstaller environment.
* **Basic Error Handling & Logging:** Suppressed verbose `yt-dlp` output and redirected `ffmpeg` output to `ffmpeg_output.log` for detailed error inspection.
### Current Priorities (Next Steps)
1. **Implement GUI:** Develop a graphical user interface for easier interaction, including file selection, quality profile choice, and URL input. (High Priority)
2. **Implement Browser Cookies for YouTube Authorization:** Revisit and implement `--cookies-from-browser` functionality for `yt-dlp` to handle age-restricted or private YouTube videos. (Deferred, now higher priority)
3. **Refine Error Handling/Logging:** Implement more user-friendly error messages, potentially displaying the last few lines of the log file directly in the console upon failure, and providing clear instructions to check the full log.
### Future Considerations
* **Twitch Integration Strategy:**
* **URL Support:** Extend the URL handling to explicitly support Twitch video, single clip, and clip collection URLs.
* **Single Video/Clip Downloads:** Leverage `yt-dlp`'s existing capabilities to download single Twitch videos and clips. This should work with the current implementation.
* **Clip Collection Downloads (Batch Processing):** For Twitch clip collection URLs, `yt-dlp` will download all clips in the collection. This will require implementing batch processing capabilities (which is already a future consideration) to handle multiple downloaded files. The application will need to iterate through each downloaded clip and convert it individually.
* **Batch Processing:** Allow conversion of multiple files or URLs in a single run.
* **Configuration File:** Implement a configuration file (e.g., YAML, JSON) for persistent settings.
* **Progress Bar:** Integrate a progress bar for both download and conversion processes.
* **Cross-Platform Compatibility:** Explore bundling for Windows and macOS. (Lowest priority)
* **Advanced `ffmpeg` Options:** Expose more `ffmpeg` options (e.g., bitrate, resolution scaling) for advanced users.
* **Metadata Preservation:** Option to preserve or transfer metadata from the original file.
### Known Issues / Limitations
* DaVinci Resolve Free on Linux has limitations with certain audio codecs (e.g., AAC) and 4K output/encoding (requires Studio version).
* `ffmpeg-full` AUR package is required for `dnxhd` support on Arch-based systems.
### Large scale implementations
Since one of the limitations of this project is the requirement of ffmpeg-full for encoding videos for Davinci Resolve use we should investigate the proposition of implementing the necessary ffmpeg-full into the project release file.
I do not know, currently if this is viable or even possible. But I think that a fully precompiled program with built in encoders and tools would be more attractive to most users.
We should also see if there are other tools that would be considered natural for this project.
**Assessment Report: Bundling FFmpeg and Other Tools**
**1. Bundling `ffmpeg-full`:**
* **Viability:** Technically viable and possible. PyInstaller (and similar tools) can include external binaries like `ffmpeg` in the final executable. The Python script would then call this bundled binary.
* **User Attractiveness:** Highly attractive. A self-contained executable eliminates the need for users to manually install `ffmpeg`, especially specific versions like `ffmpeg-full` with custom codecs, significantly improving user experience and simplifying setup.
* **Challenges:**
* **Cross-Platform Complexity:** Requires separate `ffmpeg` binaries for each target OS (Linux, Windows, macOS), increasing build complexity.
* **Licensing:** Must comply with `ffmpeg`'s LGPLv2.1/GPLv2 licensing terms (e.g., providing source code).
* **Maintenance:** Keeping bundled `ffmpeg` updated for security and features requires re-bundling.
* **Executable Size:** Bundling `ffmpeg` will increase the overall size of the application executable.
**2. Other Natural Tools for Consideration:**
* **`ffprobe`:** (Already implicitly used) Part of the `ffmpeg` suite, essential for media analysis (e.g., video duration). Would be bundled alongside `ffmpeg`.
* **`mediainfo`:** A powerful command-line tool for detailed media file information. Could be integrated for advanced diagnostics or user-facing metadata display.
* **`exiftool`:** For comprehensive metadata handling. Relevant if "Metadata Preservation" becomes a core feature.