Melt in command line mode - some questions

Hi all,

First of all, sorry if this is not the appropriate forum - I am interested in melt in command line mode; I could see some related posts on the Internet coming up here, so I thought I'd ask here... Please let me know if another forum is more appropriate.

To begin with, I had a problem finding some basic examples of working in command line mode - so I ended up posting this (sort of) "tutorial":

Command-line video editing in Linux (cut, join and preview) - Super User

I wanted to post that at the same wiki as (maybe as a MltMeltUsage page), but it looks like "registration has been temporarily disabled" there. Anyways, I (or whoever else may want to) can copy that content to the wiki if that is desired.


I have these questions about melt in command line mode:

  1. I have noticed that on melt 0.6.2, I can specify .flv files on the command line, or through xml:file.mlt XML serialization file - but using the same .flv files in a simple serialization file (via -serialise file.melt) cause a segfault.
    I prefer to use the simple file to do editing quickly in a text editor - is there a chance that I could do so? (maybe by adding a "fake" XML "preamble" file of sorts?)
  2. Can melt be used for transcoding? I have noticed that something like:
    melt inputvid.flv in=10 out=40 -consumer libdv > test.dv

    creates a file, which plays with corrupt video and corrupt audio in melt - and with corrupt video and no audio in vlc; the inputvid.flv is otherwise handled nicely by melt (unless it is in a simple serialization file).

  3. Say I've done an edit in a serialization file that I'm pleased with. Can melt export uncompressed video and audio - also separately? I'd hope for something like either uncompressed 'combined' .AVI (containing uncompressed audio and video); or separate uncompressed video .AVI with uncompressed audio .WAV - or .png image sequence as uncompressed video with uncompressed audio .WAV.

Many thanks in advance for any answers,

From what I understand from the documentation, Melt is only useful as a player for files in the MLT framework format. It doesn't transcode.

You can use it, for example, to play Kdenlive project files:

melt xml:myproject.kdenlive -consumer sdl

But in the few short experiments that I did, it doesn't seem to work very well the other way around at producing usable XML files. For example

melt in=150 out=250 in=300 out=350 -consumer xml:myproject.kdenlive

can't be opened by Kdenlive, and it doesn't even seem to do a good job at "guessing" the properties of the video clips. I don't think this particular tool was meant to work like that, although it would be interesting if it did.

For simple cutting, joining, exporting separate audio and video, PNGs etc., I find that FFMpeg and MEncoder from the command line are more than sufficient. The only slightly annoying thing about them is that you can only seek in seconds, not in frames. says:
- inigo was renamed "melt"
- westley was renamed "xml"

So something like the following bash script might serve as a basic EDL and encoder. The encoding options are through FFmpeg, and you can change them to suit your needs.

(Note: the audio stuttered at cuts in my test output, perhaps because of my encoding options. Sorry, don't know how to fix that.)



melt \
YourVideo1.avi in=150 out=250 \
YourVideo2.avi in=450 out=550 \
YourVideo3.avi in=50 out=200 \
YourVideo4.avi in=0 out=500 \
-consumer xml:project.xml

melt project.xml -consumer avformat:output.avi f=avi acodec=pcm_s16le vcodec=libxvid s=640x360 b=6000k