Code Monkey home page Code Monkey logo

avel's Introduction

avel: Audio & Video Editing Library

Overview

avel is a library of functions for video editing and generation. It supports trimming, combining video clips with different dimensions, adding text overlays, merging audio, and more.

Installation

You must have Python 3 and ffmpeg installed on your machine. Ensure that both ffmpeg and ffprobe are available from the command line. To install avel run:

pip install git+https://github.com/evliang/avel.git

Video library functions

Create clips of a video (original video is preserved)

trim_video(f'input.mp4', 'output0.mp4', 4, 8.2)
trim_video(f'input.mp4', 'output1.mp4', '00:00:42.000', '00:01:33.700')

Combine multiple clips into one file

combine_videos(["file1.mp4", "file2.mkv", "file3.avi"], "combined.mkv")

Create a video with 16:9 ratio, adding a blur effect to the sides (if applicable)

blur_video("combined.mkv", "blurred.mkv")

Add text on top of video (e.g. subtitles, watermark) using a dictionary of options

overlays = [
    create_drawtext_dict("avel", "right", "bottom", 40),
    create_drawtext_dict("Hello World!", "mid_x", "bottom", 50, enable="between(t,0,8)") ]

drawtext("input.mkv", "output.mkv", overlays)

Audio library functions

Extract audio from a video

extract_audio("video.mp4", "audio1.m4a", 15, 30)

Combine list of audio files into one longer audio file, with an 8-second transition

combine_audio(["audio1.m4a", "audio2.mp3"], "output.mp3", transition_time=8)

Merge two audio files into one (e.g. foreground and background)

merge_audio("main.mp3", "background.mp3", "output.mp3", vol1=1.0, vol2=0.4)

Combine audio and video file into one video file

combine_audio_video(audioPath, videoPath, output_filename)

Examples

See example folder for some scripts that I created for my own use case

avel's People

Contributors

evliang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

avel's Issues

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.