Convert Figma logo to code with AI

OpenShot logolibopenshot

OpenShot Video Library (libopenshot) is a free, open-source project dedicated to delivering high quality video editing, animation, and playback solutions to the world. API currently supports C++, Python, and Ruby.

1,314
278
1,314
42

Top Related Projects

1,554

MLT Multimedia Framework

47,343

Mirror of https://git.ffmpeg.org/ffmpeg.git

Free and open source video editor, based on MLT Framework and KDE Frameworks

Video Editor for Linux

8,452

Free open-source non-linear video editor

Quick Overview

LibOpenShot is an open-source C++ library for video editing, used as the core engine for OpenShot Video Editor. It provides a high-level interface for video editing tasks, including cutting, trimming, and applying effects to video and audio content.

Pros

  • Cross-platform compatibility (Linux, Mac, and Windows)
  • Supports a wide range of video and audio formats
  • Offers a Python binding for easy integration with Python projects
  • Provides a flexible and extensible architecture for video editing applications

Cons

  • Documentation can be sparse in some areas
  • Learning curve can be steep for newcomers to video editing libraries
  • Performance may be slower compared to some commercial alternatives
  • Limited community support compared to larger open-source projects

Code Examples

  1. Creating a video clip:
#include <OpenShot.h>

// Create a clip
Clip clip("path/to/video.mp4");
clip.Position(0.0);
clip.Layer(1);
  1. Adding a clip to a timeline:
#include <OpenShot.h>

// Create a timeline
Timeline timeline(1280, 720, Fraction(30, 1), 44100, 2);

// Add a clip to the timeline
Clip clip("path/to/video.mp4");
timeline.AddClip(&clip);
  1. Applying an effect to a clip:
#include <OpenShot.h>

// Create a clip and add an effect
Clip clip("path/to/video.mp4");
Negate effect;
clip.AddEffect(&effect);

Getting Started

To use LibOpenShot in your project:

  1. Install dependencies (varies by platform)
  2. Clone the repository: git clone https://github.com/OpenShot/libopenshot.git
  3. Build the library:
    cd libopenshot
    mkdir build
    cd build
    cmake ..
    make
    
  4. Link the library to your project and include the necessary headers.

Example usage in a C++ project:

#include <OpenShot.h>

int main() {
    // Initialize OpenShot
    OpenShot::Init();

    // Create a timeline
    Timeline timeline(1280, 720, Fraction(30, 1), 44100, 2);

    // Add clips and effects as needed
    // ...

    // Clean up
    OpenShot::Quit();
    return 0;
}

Competitor Comparisons

1,554

MLT Multimedia Framework

Pros of MLT

  • More mature and established project with a longer history
  • Wider adoption and integration in various video editing applications
  • Extensive plugin system for adding new features and effects

Cons of MLT

  • Steeper learning curve for developers new to the framework
  • Less focus on high-level video editing features compared to libopenshot

Code Comparison

MLT:

mlt_producer producer = mlt_factory_producer(profile, "avformat", filename);
mlt_playlist playlist = mlt_playlist_new();
mlt_playlist_append_io(playlist, producer, in, out);
mlt_consumer consumer = mlt_factory_consumer(profile, "sdl", NULL);
mlt_consumer_connect(consumer, MLT_PRODUCER(playlist));

libopenshot:

Timeline t(1280, 720, Fraction(24, 1), 44100, 2, LAYOUT_STEREO);
Clip c1(new FFmpegReader("video1.mp4"));
t.AddClip(&c1);
FFmpegWriter w("output.mp4");
w.WriteFrame(&t, 1, 100);

Both libraries provide powerful video editing capabilities, but MLT offers a more low-level approach with its C API, while libopenshot provides a higher-level C++ interface. MLT's plugin system allows for greater extensibility, while libopenshot focuses on ease of use for video editing tasks.

47,343

Mirror of https://git.ffmpeg.org/ffmpeg.git

Pros of FFmpeg

  • Extensive codec support and multimedia processing capabilities
  • Highly optimized and efficient for various platforms
  • Large community and extensive documentation

Cons of FFmpeg

  • Steep learning curve for beginners
  • Command-line interface can be complex for simple tasks
  • Requires additional wrappers or libraries for GUI applications

Code Comparison

FFmpeg (command-line usage):

ffmpeg -i input.mp4 -vf scale=1280:720 -c:a copy output.mp4

libopenshot (C++ usage):

Clip clip("input.mp4");
clip.Scale(1280, 720);
Timeline timeline(1280, 720, 30);
timeline.AddClip(&clip);
FFmpegWriter writer("output.mp4");
writer.WriteToFile(&timeline);

Summary

FFmpeg is a powerful, versatile multimedia framework with broad codec support and excellent performance. It excels in command-line operations and is widely used in various applications. However, its complexity can be challenging for beginners.

libopenshot, part of the OpenShot project, provides a more user-friendly API for video editing tasks. It's designed for integration into GUI applications and offers a simpler approach to common video operations. While it may not match FFmpeg's extensive feature set, it's more accessible for developers building video editing software.

The choice between the two depends on the specific requirements of your project, such as the need for a GUI, the complexity of video processing tasks, and the desired level of control over multimedia operations.

Free and open source video editor, based on MLT Framework and KDE Frameworks

Pros of Kdenlive

  • More mature and feature-rich video editing suite
  • Larger community and more frequent updates
  • Better integration with KDE desktop environment

Cons of Kdenlive

  • Steeper learning curve for beginners
  • Heavier resource usage compared to OpenShot
  • Less cross-platform compatibility (primarily focused on Linux)

Code Comparison

Kdenlive (C++):

void MainWindow::slotAddClipToProject(const QUrl &url)
{
    QList<QUrl> urls;
    urls << url;
    pCore->bin()->droppedUrls(urls);
}

OpenShot (Python):

def add_file(self, filepath):
    file_path = Path(filepath)
    if not file_path.exists():
        log.warning("Failed to load file: %s", filepath)
        return
    self.files.append(File(filepath))

Both repositories handle adding files to the project, but Kdenlive uses C++ with Qt framework, while OpenShot uses Python. Kdenlive's approach is more tightly integrated with its GUI, while OpenShot's implementation is more straightforward and Pythonic.

Video Editor for Linux

Pros of Flowblade

  • Written in Python, making it more accessible for contributors familiar with the language
  • Focuses specifically on video editing, potentially offering a more streamlined experience
  • Lighter weight and potentially faster for basic editing tasks

Cons of Flowblade

  • Less comprehensive feature set compared to libopenshot
  • Smaller community and fewer contributors, which may lead to slower development
  • Limited cross-platform support, primarily focused on Linux

Code Comparison

Flowblade (Python):

def _get_track_counts():
    audio_tracks = 0
    video_tracks = 0
    for i in range(current_sequence().first_video_index):
        if current_sequence().tracks[i].type == appconsts.AUDIO:
            audio_tracks += 1
    for i in range(current_sequence().first_video_index, len(current_sequence().tracks)):
        if current_sequence().tracks[i].type == appconsts.VIDEO:
            video_tracks += 1
    return (audio_tracks, video_tracks)

libopenshot (C++):

void Timeline::ApplyMapperToClips(std::function<void(Clip*)> mapper) {
    for (auto clip : clips) {
        mapper(clip);
    }
    for (auto layer : layers) {
        for (auto clip : layer->Clips()) {
            mapper(clip);
        }
    }
}
8,452

Free open-source non-linear video editor

Pros of Olive

  • More modern C++ codebase with Qt-based GUI
  • Actively developed with frequent updates and new features
  • Designed as a complete non-linear video editor, not just a library

Cons of Olive

  • Less mature project with potential stability issues
  • Smaller community and fewer resources compared to OpenShot
  • Limited cross-platform support (primarily focused on desktop)

Code Comparison

Olive (C++):

void Clip::set_timeline_in(const rational &r)
{
  timeline_in_ = r;
  InvalidateCache(TimelineCoordinate(timeline_in_.ToDouble(), track()->Index()), kInvalidateAll);
}

libopenshot (C++):

void Clip::SetPosition(double position)
{
    position_=position;
    if (reader) reader->SetFrame(round(position * reader->info.fps.ToDouble()));
}

Both projects use C++, but Olive's codebase is more modern and uses Qt for its GUI. libopenshot is designed as a library, while Olive is a complete video editor application. Olive's development is more active, with frequent updates and new features. However, libopenshot, as part of the OpenShot project, has a larger community and more established ecosystem. Olive may have more cutting-edge features, but libopenshot offers better stability and cross-platform support.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

OpenShot Video Library (libopenshot) is a free, open-source C++ library dedicated to delivering high quality video editing, animation, and playback solutions to the world.

Build Status

libopenshot CI Build libopenshot-audio CI Build

Features

  • Cross-Platform (Linux, Mac, and Windows)
  • Multi-Layer Compositing
  • Video and Audio Effects (Chroma Key, Color Adjustment, Grayscale, etc…)
  • Animation Curves (Bézier, Linear, Constant)
  • Time Mapping (Curve-based Slow Down, Speed Up, Reverse)
  • Audio Mixing & Resampling (Curve-based)
  • Audio Plug-ins (VST & AU)
  • Audio Drivers (ASIO, WASAPI, DirectSound, CoreAudio, iPhone Audio, ALSA, JACK, and Android)
  • Telecine and Inverse Telecine (Film to TV, TV to Film)
  • Frame Rate Conversions
  • Multi-Processor Support (Performance)
  • Python and Ruby Bindings (All Features Supported)
  • Qt Video Player Included (Ability to display video on any QWidget)
  • Unit Tests (Stability)
  • All FFmpeg Formats and Codecs Supported (Images, Videos, and Audio files)
  • Full Documentation with Examples (Doxygen Generated)

Install

Detailed instructions for building libopenshot and libopenshot-audio for each OS. These instructions are also available in the /docs/ source folder.

Hardware Acceleration

OpenShot now supports experimental hardware acceleration, both for encoding and decoding videos. When enabled, this can either speed up those operations or slow them down, depending on the power and features supported by your graphics card.

Please see doc/HW-ACCEL.md for more information.

Documentation

Beautiful HTML documentation can be generated using Doxygen.

make doc

(Also available online: http://openshot.org/files/libopenshot/)

Developers

Are you interested in becoming more involved in the development of OpenShot? Build exciting new features, fix bugs, make friends, and become a hero! Please read the step-by-step instructions for getting source code, configuring dependencies, and building OpenShot.

Report a bug

You can report a new libopenshot issue directly on GitHub:

https://github.com/OpenShot/libopenshot/issues

Websites

Copyright & License

Copyright (c) 2008-2022 OpenShot Studios, LLC. This file is part of OpenShot Video Editor (https://www.openshot.org), an open-source project dedicated to delivering high quality video editing and animation solutions to the world.

OpenShot Library (libopenshot) is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

OpenShot Library (libopenshot) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with OpenShot Library. If not, see http://www.gnu.org/licenses/.

To release a commercial product which uses libopenshot (i.e. video editing and playback), commercial licenses are also available: contact sales@openshot.org for more information.