Advice on editing MLT script

Ok, my next and final project. :slightly_smiling_face:

I want to take 2 hours of video from 3 separate gopro cameras, clips of audio from 1 of the gopros and some music mp3 and combine them into a 12 min video. I have +30 such sets to process so this calls for some programming.

My 1st step was to put all the source material into a shotcut project.
So I have 7 tracks on the time line.

The video shrinking sofware I am creating now has to reformat the source MLT into a new MLT that Shotcut can use to render my short video.

The software reads in the MLT and splits it into 7 sub project MLT files, one for each track.
These 7 MLT files are then loaded into the final MLT as the playlist resources.
This works 100% and I can play / work with each sub MLT using the usual Shotcut features. All good so far.

My next challenge is to create the audio tracks.
A1 will contain the music
A2 will contain the voice clips
I want to fade in / out as I switch from music to voice clips.
My music sub MLT is “playlist6”
My voice sub MLT is “playlist0”

My xml for the 1st voice clip with fadeout
TWK_demo 001 sliced.mlt (3.1 KB)

Problem: the video plays but no audio. Help pls

Displays fine in shotcut
SS01

This is the xml that I suspect is wrong:

  <producer id="ProducerVFO1" in="00:00:00.000" out="00:05:41.375">
    <property name="resource">playlist0</property>
    <filter id="FilterVFO1" out="00:05:41.375">
       <property name="window">75</property>
       <property name="max_gain">20dB</property>
       <property name="level">00:05:40.375=0;00:05:41.373=-60</property>
       <property name="mlt_service">volume</property>
       <property name="shotcut:filter">fadeOutVolume</property>
       <property name="shotcut:animOut">00:00:01.000</property>
     </filter>
  </producer>

The “resource” element should have a filename to the MP3 file. There are a lot of other missing elements too.

The fastest fix is to create a new empty project in Shotcut, drag one MP3 file into the audio track, save the MLT, and copy that format to your code.

Thanks Austin,

Not the news I was hoping to hear.
It is much simpler to work with the MLT file as the source clip. Pity that is not possible.

Wait, I may have misunderstood. Is the goal to embed MLT in MLT rather than a MP3 file directly?

Basically, your producer ProducerVFO1 does not refer to any file. You cannot make a producer of another producer. Make a dummy project, Open MLT XML as Clip, add it to the Timeline, Save, and view the saved XML to see how to use a MLT XML clip on the timeline.

Thanks guys.

I will try using the sub MLT as the “file” seeing as

I was trying to avoid this as shotcut does not use the sub MLT as an producer once on the time line.
Shotcut expands the MLT into the time line as all the component clips.

Correct

  <producer id="ProducerVFO1" in="00:00:00.000" out="00:05:41.375">
    <property name="resource">playlist0</property>
    <filter id="FilterVFO1" out="00:05:41.375">
       <property name="window">75</property>
       <property name="max_gain">20dB</property>
       <property name="level">00:05:40.375=0;00:05:41.373=-60</property>
       <property name="mlt_service">volume</property>
       <property name="shotcut:filter">fadeOutVolume</property>
       <property name="shotcut:animOut">00:00:01.000</property>
     </filter>
  </producer>

Changed as below and now works as expected. :grin:

  <producer id="ProducerVFO1" in="00:00:00.000" out="00:05:41.375">
    <property name="resource">F:\GoPro\TWK_demo 001 sliced V1.MLT</property>
    <filter id="FilterVFO1" out="00:05:41.375">
       <property name="window">75</property>
       <property name="max_gain">20dB</property>
       <property name="level">00:05:40.375=0;00:05:41.373=-60</property>
       <property name="mlt_service">volume</property>
       <property name="shotcut:filter">fadeOutVolume</property>
       <property name="shotcut:animOut">00:00:01.000</property>
     </filter>
  </producer>
1 Like

I will add info to this thread that may help others who are attempting MLT scripting.

So the next obstacle is to get both audio channels to play.
Adding the voice and the music playlists (tracks) to a tractor results in only one track being output at a time.
You need to add a transition to get the tracks to mix.

<tractor id="tractor0">
  <property name="shotcut">1</property>
  <property name="shotcut:scaleFactor">0.187979</property>
  <track producer="background"/>
  <track producer="playlist7" hide="video"/>
  <track producer="playlist8" hide="video"/>
  <track producer="playlist9" hide="audio"/>
  <transition id="transition7">
    <property name="a_track">1</property>
    <property name="b_track">2</property>
    <property name="mlt_service">mix</property>
    <property name="always_active">1</property>
    <property name="sum">1</property>
  </transition>
</tractor>

The property a_track

<property name="a_track">1</property>

seems to refer to the index of the track producer, so 0 = “background” and 1 = “playlist7” etc

This topic was automatically closed after 90 days. New replies are no longer allowed.