Git Product home page Git Product logo

compressvideo's Introduction

Compress Video to h265 recursively

This script compresses videos to h265 (HEVC) from one location to another recursively without overwriting the destination.

Features

  • Open Source bash script
  • Can run on Linux and Windows WSL
  • Can be run in a screen session in the background
  • Compress all videos in subfolders and copy folder structure to destination
  • No complicated switches
  • If terminated, can be restarted and will not overwrite already created files
  • Will not delete or overwrite any existing files
  • Will not recompress a source video that's already in h265 (HEVC) format.

Requirement

The script uses ffmpeg and can be install on Debian/Ubuntu based systems or Windows Subsystem for Linux (WSL) with:

~$ apt install ffmpeg

Windows users, to find out more regarding WSL, use this link.

Download/Install script

To download and use the script, do the following in a folder of your choosing:

~$ wget https://raw.githubusercontent.com/RiaanAspeling/CompressVideo/main/compress_video.sh
~$ chmod +x compress_video.sh

Now the script is ready to use. You could move the script to somewhere in your PATH if you'd like to access it from anywhere.

Usage

~$ ./compress_video.sh [-e EXTENSION] [-s SOURCE] [-d DESTINATION]
        -e EXTENSION        Mandatory: Specify the file extension to filter on source. Eg: -e mkv
        -s SOURCE           Mandatory: Specify the source folder to compress from. Eg: -s /mnt/myvideos
        -d DESTINATION      Mandatory: Specify the destination folder to compress to. Note that files 
                                       will not be overwritten. Eg: -d /home/user/myvideos

Example

Compress MKV videos from location /mnt/videos to ~/videos

~$ ./compress_video.sh -e mkv -s /mnt/videos -d ~/videos

The output might look like this:

Destination file exists: ~/videos/Season 1/video1.mkv
Destination file exists: ~/videos/Season 1/video2.mkv
Destination file exists: ~/videos/Season 1/video3.mkv
---------------------------------------------------------------------------------------------------------------------------------
Compressing  /mnt/videos/Season 1/video4.mkv  with size ( 1280 x 720 ) to file  ~/videos/Season 1/video4.mkv
---------------------------------------------------------------------------------------------------------------------------------
x265 [info]: HEVC encoder version 3.4
x265 [info]: build info [Linux][GCC 7.5.0][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main profile, Level-3.1 (Main tier)
x265 [warning]: No thread pool allocated, --wpp disabled
x265 [warning]: No thread pool allocated, --lookahead-slices disabled
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 3 / none
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 3
x265 [info]: Keyframe min / max / scenecut / bias  : 25 / 250 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 3 / off / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 2 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-28.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 early-skip rskip mode=1 signhide tmvp
x265 [info]: tools: b-intra strong-intra-smoothing deblock sao
frame=33025 fps= 13 q=32.0 size=  219136kB time=00:18:23.03 bitrate=1627.5kbits/s speed=0.418x

Bugs or enhancements

Use the Issue Tracker on this repo to log issues or suggest enhancements.

compressvideo's People

Contributors

riaanaspeling avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

kuesttman

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.