# FFmpeg Configuration Notes for Video Converter Project

This document details the `ffmpeg` settings and considerations used within the Video Converter project, especially concerning DaVinci Resolve compatibility.

## Current Default Conversion Settings (as of 2025-10-31)

The project currently uses the following `ffmpeg` settings for converting video files to DaVinci Resolve compatible formats (Free Linux version, targeting 1080p60 and 1440p60):

*   **Video Codec:** `dnxhd` (DNxHD/HR)
*   **Profile for 1080p (<=1080 height):** `dnxhr_sq` (DNxHR Standard Quality) - *Chosen as a good balance between file size and no discernable quality loss for typical 1080p sources.*
*   **Profile for 1440p (>1080 height):** `dnxhr_hq` (DNxHR High Quality) - *Chosen for higher resolution sources to maintain visual fidelity.*
    *   *Note: `dnxhr_lb` (Low Bandwidth) was tested for 1080p and provided further file size reduction but introduced some video quality loss, making `dnxhr_sq` a better default for general use. Users can explore `dnxhr_lb` if extreme file size reduction is paramount and minor quality loss is acceptable.*
*   **Audio Codec:** `pcm_s16le` (Linear PCM, 16-bit signed little-endian)
*   **Container:** `.mov` (QuickTime)

### Example `ffmpeg` Command Structure (simplified):

```bash
ffmpeg -i input.mp4 -c:v dnxhd -profile:v dnxhr_hqx -pix_fmt yuv422p -c:a pcm_s16le output.mov
```

## Rationale for Choices:

*   **`dnxhd` codec:** Chosen for its excellent compatibility and performance as an intermediate editing codec in DaVinci Resolve, especially on Linux. It provides high quality and is an intraframe codec.
*   **`dnxhr_hq` / `dnxhr_hqx` profiles:** Selected to ensure high-quality output suitable for professional editing, balancing file size and visual fidelity. `dnxhr_hqx` offers even higher quality for higher resolutions.
*   **`pcm_s16le` audio:** Used to avoid known compatibility issues with AAC audio in DaVinci Resolve on Linux, ensuring reliable audio playback. PCM is uncompressed and lossless.
*   **`.mov` container:** Recommended for its robustness and better metadata handling with DaVinci Resolve for intermediate files.

## Alternative Approaches / Future Considerations:

*   **ProRes:** While `ffmpeg` can encode ProRes, its use on Linux with DaVinci Resolve Free might be limited or require specific `ffmpeg` builds/licenses. It could be an alternative if `dnxhd` proves problematic or if a user specifically requests it.
*   **High-Quality H.264/H.265:** For scenarios where file size is a primary concern and editing performance is secondary (e.g., proxy generation or final delivery), high-bitrate H.264/H.265 could be considered. However, these are interframe codecs and generally less ideal for direct editing.
*   **Opus Audio:** While Davinci Resolve on Linux can *decode* Opus audio within video containers, it **does not support direct encoding of Opus audio**. Therefore, Opus is not a suitable primary output audio codec for this project. Linear PCM (`pcm_s16le`) remains the recommended choice for maximum compatibility and quality for editing workflows.

---
*Document generated by Gemini CLI Agent.*