Giter Club home page Giter Club logo

video-encoder's Introduction

Python Video Encoder

A simple early stage media encoder build in Python by a colleague of mine using ffmpeg to batch convert videofiles to the same LUFS, codec, framerate, bitrate, etc.

How to install

Make sure that Python is installed on the machine. This build is tested on Python 3.8.

Important Notes

  1. Don't run the script on a critical broadcast computer while live as it will take up most of its CPU power when converting.
  2. At this point the video needs to have an audiotrack. If there is no audiotrack the converter will not work.

Usage

  1. Execute the Server.py script.
  2. Add Files to the Media folder.
  3. Wait for the file to be encoded.
  4. grab the new file from the Media Destination Folder.
  5. Press 'q' to stop the script

Click the image for a Usage Video of the script.

Video Encoder Usage Video

Config settings

An overview of the current Config file.

{
    "Folder":
    {
        "Media Folder": "Media/",
        "Media Destination Folder": "MediaDestinationFolder/",
        "Garbage Folder": "GarbageFolder/"
    },
    "Aproved Extension":
        {
           "Extension":"[mp4]" 
        },
    "VideoEncoder":
        {
            "Vcodec": "libx264",
            "Fps": "59.94",
            "encoding": "veryslow",
            "Resolution":"1920:1080",
            "Bitrate":"12M",
            "Buffer":"24M"

        },
    "AudioEncoder": {
        "Acodec": "aac",
        "Bitrate": "256k",
		"LUFS Encoding":true,
		"Integrated Loudness":"-23",
		"Integrated Loudness+-":"-1",
		"Maximum loudness range":"20"
    }
}

Media Folder is the folder all new videos needs to go in to. Media Destination Folder is the folder all the encoded videos are being saved at. Garbage Folder is the folder the original files go to after the encoding is done.

{
    "Folder":
    {
        "Media Folder": "Media/",
        "Media Destination Folder": "MediaDestinationFolder/",
        "Garbage Folder": "GarbageFolder/"
    }
}

All Aproved Extensions goes in here. [mp4, mov, ....]

{
    "Aproved Extension":
        {
           "Extension":"[mp4]" 
        }
}

In the videoEncoder setting, the Buffer has to be twice the size of the bitrate. The encoder is set to do CBR (Constant Bit Rate).

{
    "VideoEncoder":
        {
            "Vcodec": "libx264",
            "Fps": "59.94",
            "encoding": "veryslow",
            "Constant Rate Factor":"18",
            "Resolution":"1920:1080",
            "Bitrate":"12M",
            "Buffer":"24M"
        }
}

##LUFS

The script use the build in linear normalization. see 7.70 loudnorm in https://ffmpeg.org/ffmpeg-filters.html#loudnorm this function use: I, Set integrated loudness target. Range is -70.0 - -5.0. Default value is -23.0.

LRA, Set loudness range target. Range is 1.0 - 20.0. Default value is 20.0.

TP, Set maximum true peak. Range is -9.0 - +0.0. Default value is -3.0.

Log

The encoder tries to log as much as possible.

Early stage script

While this script is used to prepare for productions it is still in its early stages and a lot will be done in the future to update.

Things in the pipeline for the future:

  • UI
  • Bugfixes

video-encoder's People

Contributors

gjverhoeff avatar tricyphona avatar

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.