Esa Kataja 97e40731b2 Refactor app.py: extract SOLID helper functions and simplify main command
Moved ffprobe call into run_ffprobe
Introduced prepare_video_file, apply_stream_settings, and confirm_and_write_script helpers
Streamlined main() to delegate to new helpers
2025-04-17 13:49:14 +03:00
2024-11-14 23:46:13 +02:00
2024-11-14 20:13:59 +02:00

Video Encoding App

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.

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.

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.

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.

Metadata Handling

  • Added Metadata: Metadata fetched from OMDB using the IMDb ID.
  • Stripped Metadata: All other metadata is removed from the video.

Anamorphic Video Conversion

Anamorphic videos are converted to SAR (Sample Aspect Ratio) 1:1 to ensure proper display on all devices.

Example Usage

./encode_video.sh input_video.mp4 -i tt1234567
S
Description
No description provided
Readme
83 KiB
Languages
Python 80.2%
Jinja 19.8%