LinuxCommandLibrary

melt

Concatenate and transcode media files

SYNOPSIS

melt [OPTIONS] [clip... | XML_FILE]

PARAMETERS

-h, --help
    Displays a help message with available options and commands.

-v, --version
    Shows the melt and MLT framework version information.

-profile name
    Sets the processing profile, defining resolution, frame rate, and aspect ratio (e.g., hdv_1080_25p, dv_pal). Required for rendering to a specific output format.

-consumer name[:destination]
    Specifies the output consumer (e.g., avformat for file export, sdl for real-time playback). destination is often a file path for file consumers.

-consumer-arg name=value
    Passes additional arguments to the specified consumer. Useful for setting encoder parameters (e.g., vcodec=libx264).

-filter name[:properties]
    Applies a video or audio filter to the current clip or track (e.g., brightness, colorize, volume).

-transition name[:properties]
    Applies a transition between two clips (e.g., dissolve, push).

-track clip...
    Groups subsequent clips onto a new track, allowing for multi-track composition.

-producer name[:properties]
    Creates a producer (source) from a specific factory type (e.g., color for a solid color, qtext for text).

-attach id
    Attaches to an existing MLT server process, typically used for remote control or debugging.

-position time
    Seeks to a specific time position in the timeline (e.g., 00:01:30.000, 150 frames, 30s).

-length time
    Sets the duration of the current clip or project segment.

-verbose
    Increases the verbosity of log output, providing more detailed information during processing.

-real-time
    Attempts to play back the timeline in real-time, dropping frames if necessary.

-data XML_file
    Loads an MLT XML project file, allowing melt to render pre-defined compositions.

-loop count
    Loops playback of the current clip or timeline a specified number of times. Use 0 for infinite loop.

DESCRIPTION

The melt command is the primary command-line interface to the MLT (Media Lovin' Toolkit) multimedia framework. It acts as a powerful non-linear video editor and player that allows users to process, play, and render audio/video clips directly from the terminal. melt is highly flexible and scriptable, capable of applying a wide range of filters, transitions, and effects, as well as composing complex timelines by chaining multiple clips and operations. It supports various media formats for both input and output, leveraging the underlying MLT framework's extensive plugin architecture.

While it lacks a graphical user interface, melt is an invaluable tool for automation, batch processing, and server-side video manipulation. It's often used by developers and advanced users to test MLT features, create custom rendering pipelines, or integrate video processing into scripts without the overhead of a full-fledged GUI editor. Its ability to directly consume MLT XML project files makes it a robust choice for rendering projects created in MLT-based GUI editors like Shotcut or Kdenlive.

CAVEATS

melt has a steep learning curve due to its command-line nature and the extensive options available within the MLT framework. It requires a precise understanding of MLT's internal concepts like producers, consumers, filters, and transitions. There is no built-in undo/redo functionality, and complex projects require careful scripting or the use of MLT XML files. Debugging issues can be challenging without verbose logging, and real-time playback performance heavily depends on system resources and the complexity of the project.

MLT FRAMEWORK

melt is built upon the Media Lovin' Toolkit (MLT), a LGPL-licensed open source multimedia framework. MLT is designed for television broadcasting, encompassing playback, processing, and rendering. Its modular architecture allows developers to extend its functionality through plugins, which melt can leverage for various tasks like reading/writing different media formats, applying complex effects, and integrating with external hardware.

CHAINING OPERATIONS

One of melt's most powerful features is its ability to chain operations on the command line. You can specify a source clip, then apply multiple filters sequentially, follow it with a transition to another clip, and then apply more filters. This chaining allows for highly granular control over the video processing pipeline, making it ideal for creating custom effects or complex non-linear edits without leaving the terminal. For example: melt input1.mp4 -filter brightness=50% -transition dissolve input2.mp4 -filter sepia.

MLT XML PROJECT FILES

For more complex or reusable projects, melt can directly process MLT XML files. These files represent an entire MLT project, including timelines, tracks, clips, filters, and transitions. This allows users to design projects in GUI editors like Shotcut or Kdenlive and then render them using melt on a headless server or as part of an automated batch process, ensuring consistency and scalability.

HISTORY

The MLT framework, and consequently the melt command, was initiated by Dan Dennedy in 2004. It was designed from the ground up as a modular, extensible, and flexible toolkit for broadcast and multimedia applications. The command-line melt utility served as an initial testing ground and demonstration of the framework's capabilities, allowing developers to interact directly with MLT's core components. Over the years, MLT has become the backend for popular open-source video editors such as Shotcut (also developed by Dennedy) and Kdenlive, cementing melt's role as a fundamental tool for scripting and automating video production workflows.

SEE ALSO

ffmpeg(1), ffprobe(1), mplayer(1), vlc(1), shotcut(1)

Copied to clipboard