0

I have two video clips and two audio clips. I want to combine them such that each audio overlays on top of its video, and the results run sequentially:

[video0       ][video1  ]
[audio0  ]     [audio1 ]

edit here's a working MLT file. I retain my original, broken XML below for completeness.

<playlist>
  <tractor>
    <multitrack>
      <producer>
        <property name="resource">video0.mp4</property>
      </producer>
      <producer>
        <property name="resource">audio0.wav</property>
      </producer>
    </multitrack>
  </tractor>
  <!-- melt can deduce the multitrack, so this works as well: -->
  <tractor>
    <producer>
      <property name="resource">audio1.wav</property>
    </producer>
    <producer>
      <property name="resource">video1.mp4</property>
    </producer>
  </tractor>
</playlist>

end edit

I tried to do something like this, but I get errors that seem to indicate my structure is wrong, e.g. [producer_xml] End multitrack in the wrong state... and [producer_xml] Invalid state of playlist end 2

<playlist>
  <multitrack>
    <producer>
      <property name="resource">video0.mp4</property>
    </producer>
    <producer>
      <property name="resource">audio0.wav</property>
    </producer>
  </multitrack>
  <multitrack>
    <producer>
      <property name="resource">audio1.wav</property>
    </producer>
    <producer>
      <property name="resource">video1.mp4</property>
    </producer>
  </multitrack>
</playlist>
iter
  • 4,171
  • 8
  • 35
  • 59
  • It appears that I misunderstood the relationship between `` and ``. MLT XML has a lot of flexibility and can deduce a lot of missing structure, but it cannot figure out which parents the ``s belong to. – iter Jan 16 '18 at 14:47

1 Answers1

1

You are missing tracks. In general:

  1. Declare all the producers first
  2. Then put all the video clips in one playlist and the audio clips in another playlist.
  3. Create two tracks: one for the video playlist and one for the audio playlist
  4. Then, add a "mix" transition between them

There are really great examples in this documentation: https://github.com/mltframework/mlt/blob/master/docs/mlt-xml.txt

See the "Tractors" section.

Brian
  • 1,200
  • 6
  • 8
  • Thank you, Brian. The file you mention appears to be the source of this page: https://www.mltframework.org/docs/mltxml/. I've been reading the HTML documentation at https://www.mltframework.org/docs/ and this is how I got this far. – iter Jan 16 '18 at 14:35
  • Glad you found the documentation page. The documentation page webserver was down when I originally posted my answer. So I linked to the source instead. – Brian Jan 16 '18 at 17:59