diff --git a/README.md b/README.md index 616fa6f..eb0760d 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,33 @@ -# VidEnc +# Video Encoding App -This is a command-line application that analyzes video files using `ffprobe` to extract stream information (video, audio, subtitles). It then uses the OMDb API to fetch additional movie details such as title and release date, given an IMDB ID. +## Overview +This app takes a video file and an IMDb ID as input, generates a shell script to encode the video streams to AV1 and audio streams to Opus format, converts anamorphic video to SAR 1:1, and adds metadata from OMDB while stripping all other metadata. -## Workflow +## Input Requirements +1. **Video File**: A valid video file in a supported format. +2. **IMDb ID**: A valid IMDb ID to fetch metadata from OMDB. -1. **Input:** The application takes a video file path as input, along with an optional IMDB ID and a flag to disable subtitle processing. +## Optional CLI Arguments +1. **`-ns`/`--nosubtitles`**: Disables subtitle processing. +2. **`-p`/`--preset`**: Sets the encoding preset for the video. Default is `2`. +3. **`-c`/`--crf`**: Sets the CRF value for the video. Default is `30`. +4. **`-o`/`--original-media-type`**: Sets the ORIGINAL_MEDIA_TYPE metadata. Default is `DVD`. -2. **FFprobe Analysis:** It runs `ffprobe` on the input video file to extract stream information in JSON format. +## Output Details +The app generates a shell script that performs the following tasks: +1. Encodes the video to AV1 format. +2. Encodes the audio to Opus format. +3. Converts anamorphic video to SAR 1:1. +4. Adds metadata from OMDB using the provided IMDb ID. +5. Strips all other metadata from the video. -3. **Stream Parsing:** The JSON output is parsed to identify video, audio, and subtitle streams. +## Metadata Handling +- **Added Metadata**: Metadata fetched from OMDB using the IMDb ID. +- **Stripped Metadata**: All other metadata is removed from the video. -4. **OMDb API Lookup (Optional):** If an IMDB ID is provided, the application queries the OMDb API to retrieve movie title and release date. - -5. **Output:** Finally, it prints a command string based on the extracted information. This command string is likely intended for further video processing or encoding. - - Every audio stream that is side loaded, must be converted to 5.1 channel layout with `channelmap=channel_layout=5.1` - -## Usage +## Anamorphic Video Conversion +Anamorphic videos are converted to SAR (Sample Aspect Ratio) 1:1 to ensure proper display on all devices. +## Example Usage ```bash -python src/app.py [-i ] [-ns] -``` - -* ``: Path to the video file. -* `-i `: (Optional) IMDB ID of the movie. -* `-ns`: (Optional) Flag to disable subtitle processing. - - -## Example - -```bash -python src/app.py my_movie.mp4 -i tt1234567 -``` - -This would analyze `my_movie.mp4`, fetch details from OMDb using IMDB ID `tt1234567`, and print a command string. - -## Unit Tests - -There are no unit tests included in this project. +./encode_video.sh input_video.mp4 -i tt1234567 \ No newline at end of file