Skip to content

About

๐ŸŽฌ Video codec analyzer, quality scorer & H.264โ†’H.265 transcoder. FFprobe-based metadata extraction, 0-100 quality scoring, smart recommendations, batch processing, and HTML/PDF/CSV/JSON reports โ€” built with Python & Streamlit.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฌ CodecInspector

Video Codec Analysis, Quality Scoring & HEVC Transcoding Tool โ€” built with FFmpeg/FFprobe, Python and Streamlit.

CodecInspector inspects any video file, extracts detailed codec/container metadata, computes an Overall Quality Score, gives an actionable recommendation, and can transcode the file to H.265 (HEVC) while reporting exactly how much bitrate and file size were saved. It also ships a Batch Analyzer for scanning an entire folder of videos at once.

โญ If you find this useful, consider starring the repo.


โœจ Features

Category Feature
Metadata Codec, profile, level, resolution, FPS, duration, frame count, container, file size, bitrate
Advanced Metadata Pixel format, chroma subsampling, bit depth, aspect ratio, color space, encoder tag, B-frames, audio stream info
Quality Scoring 0โ€“100 Overall Score based on codec modernity, bits-per-pixel efficiency and file size, with good/warning/bad badges
Recommendation Engine Actionable, codec- and score-aware suggestions (e.g. "Convert to HEVC to cut bitrate further")
Transcoding One-click H.264 โ†’ H.265 (HEVC) conversion via FFmpeg, with adjustable CRF
Comparison Before/after codec, bitrate and size comparison with automatic savings %
Batch Analyzer Scan an entire folder, analyze every video, and bulk-convert the whole batch to H.265 with aggregate savings
Reports Styled HTML report, professional PDF report, and CSV export
Raw Data One-click download of the raw FFprobe JSON metadata
Dashboard Clean Streamlit UI with drag & drop upload, thumbnails, metrics and downloads

๐Ÿ–ผ๏ธ Screenshots

Upload & drag-and-drop Upload

Video analysis & Overall Score Analysis

Advanced metadata, audio stream & export Advanced Metadata

H.265 conversion & comparison report Conversion

Batch analyzer Batch Analyzer


๐Ÿงฑ Architecture

CodecInspector/
โ”‚
โ”œโ”€โ”€ dashboard.py              # Main Streamlit UI (single-video analysis + conversion)
โ”œโ”€โ”€ batch_dashboard.py        # Streamlit UI for batch folder analysis + bulk conversion
โ”œโ”€โ”€ app.py                    # Terminal / CLI demo of the full pipeline
โ”œโ”€โ”€ config.py                 # Cross-platform FFmpeg/FFprobe path resolution & directories
โ”œโ”€โ”€ requirements.txt
โ”‚
โ”œโ”€โ”€ models/
โ”‚   โ””โ”€โ”€ media_info.py         # MediaInfo dataclass โ€” normalized video metadata
โ”‚
โ”œโ”€โ”€ utils/
โ”‚   โ”œโ”€โ”€ ffprobe_utils.py       # FFprobe subprocess wrapper
โ”‚   โ”œโ”€โ”€ metadata.py            # Raw ffprobe JSON -> MediaInfo (advanced field extraction)
โ”‚   โ””โ”€โ”€ formatter.py           # Human-readable size / bitrate / duration formatting
โ”‚
โ”œโ”€โ”€ services/
โ”‚   โ”œโ”€โ”€ analyzer.py            # Facade: ffprobe + metadata + score + recommendation in one call
โ”‚   โ”œโ”€โ”€ score.py                # Overall Score engine (codec / bitrate / size weighting)
โ”‚   โ”œโ”€โ”€ recommendation.py       # Recommendation engine
โ”‚   โ”œโ”€โ”€ thumbnail.py            # Thumbnail extraction (FFmpeg)
โ”‚   โ”œโ”€โ”€ transcoder.py           # H.264 -> H.265 transcoding (FFmpeg)
โ”‚   โ”œโ”€โ”€ compare.py              # Before/after comparison + savings calculation
โ”‚   โ”œโ”€โ”€ batch_analyzer.py       # Folder scanning + batch analysis + batch transcoding
โ”‚   โ”œโ”€โ”€ report.py               # Styled HTML report generator
โ”‚   โ”œโ”€โ”€ pdf_report.py           # PDF report generator (ReportLab)
โ”‚   โ”œโ”€โ”€ csv_export.py           # CSV export
โ”‚   โ””โ”€โ”€ json_export.py          # Raw FFprobe JSON export
โ”‚
โ”œโ”€โ”€ sample_videos/             # Small sample clip for demos/tests
โ”œโ”€โ”€ thumbnails/                # Generated thumbnails
โ”œโ”€โ”€ reports/                   # Generated HTML/PDF/CSV reports & converted videos (gitignored)
โ”œโ”€โ”€ temp/                      # Uploaded-file scratch space (gitignored)
โ””โ”€โ”€ screenshots/               # README screenshots

Design principle: ffprobe/ffmpeg calls, metadata parsing, scoring, and reporting are each isolated in their own service, so dashboard.py and batch_dashboard.py stay thin and only handle UI/state.


๐Ÿš€ Installation

Prerequisites

  • Python 3.9+
  • FFmpeg & FFprobe installed and available on your system:
    • Windows: download from ffmpeg.org, add ffmpeg\bin to PATH (or set CODECINSPECTOR_FFMPEG / CODECINSPECTOR_FFPROBE env vars to the full .exe paths).
    • macOS: brew install ffmpeg
    • Linux: sudo apt install ffmpeg

Setup

git clone https://github.com/fatmanurylmaaaz/CodecInspector.git
cd CodecInspector

python -m venv .venv
source .venv/bin/activate      # Windows: .venv\Scripts\activate

pip install -r requirements.txt

โ–ถ๏ธ Usage

Interactive dashboard (single video)

streamlit run dashboard.py

Upload a video (drag & drop supported) to see:

  • Full metadata + advanced metadata
  • Overall Score + recommendation
  • One-click H.265 conversion with before/after comparison
  • JSON / CSV / HTML / PDF export buttons

Batch analyzer (whole folder)

streamlit run batch_dashboard.py

Point it at any folder to analyze every video inside, export the results to CSV, and optionally bulk-convert the entire batch to H.265 with aggregate size/bitrate savings.

CLI demo

python app.py

Runs the full pipeline (metadata โ†’ score โ†’ recommendation โ†’ thumbnail โ†’ H.265 conversion โ†’ comparison) against the bundled sample video and prints the results to the terminal.


๐Ÿงฎ How the Overall Score works

The score is a weighted combination of three factors:

Factor Weight What it measures
Codec modernity 45% AV1/HEVC score highest, H.264 mid-high, legacy codecs (MPEG-2, MJPEG) score low
Bitrate efficiency 35% Bits-per-pixel (bitrate / (width ร— height ร— fps)) โ€” rewards efficient encoding
File size efficiency 20% MB per minute of runtime โ€” rewards compact files

Each factor also produces a โœ” good / โš  warning / โœ˜ bad badge, plus a Streaming Ready check (codec + container combination suitable for web/streaming delivery).


๐Ÿ› ๏ธ Tech Stack

  • Python 3
  • Streamlit โ€” dashboard UI
  • FFmpeg / FFprobe โ€” video analysis & transcoding
  • Pandas โ€” tabular data (batch analyzer, comparisons)
  • ReportLab โ€” PDF report generation

๐Ÿ—บ๏ธ Roadmap

Planned for future versions:

  • AV1 transcoding support
  • Configurable target bitrate/resolution presets
  • Drag & drop batch folder upload (zip) for environments without local file access
  • Dockerfile for one-command deployment

๐Ÿ“„ License

Released under the MIT License.


About

๐ŸŽฌ Video codec analyzer, quality scorer & H.264โ†’H.265 transcoder. FFprobe-based metadata extraction, 0-100 quality scoring, smart recommendations, batch processing, and HTML/PDF/CSV/JSON reports โ€” built with Python & Streamlit.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages