FAQ

Miscellaneous

  • I'm trying to do the following: Display a blue transparent rectangle over the first few hundred of frames and over the last. On the rectangle some text is written, but this can be ignored. The second transition isn't working with this toast.westley.
    • Answer is to check the in and out properties carefully.

  • How to center a text in a video?
    • melt colour:red -filter watermark:"+LinuxTag~Flop Bobber.txt" composite.progressive=1 producer.align=centre composite.valign=c composite.halign=c

  • When changing the font for pango it is rather small.
    • Use the producer.size property
    • melt colour:red -filter watermark:"+Flop.txt" composite.progressive=1 producer.font="DIN-Light" producer.size=48

  • How to repeat the very first frame of a video for 200 frames?
    • The split can be used here together with swap, that reverses frame order
    • melt file -split 0 -swap -repeat 200 -swap
    • -split 0 is the first frame, -swap reverses frame order so it becomes last frame, repeat operates on the last frame, swap restores original frame order
    • Another approach: melt file.avi out=0 -repeat 200 file.avi in=1
    • The newer approach is to use the 'freeze' filter. Set the frame property to the number of the frame. Then, set either freeze_before or freeze_after =1.

  • How to reverse a movie, e.g. have it playing backward?
    • Somewhat awkward: Create jpgs for each frame and make movie in reverse order
    • melt INPUT.VIDEO -consumer avformat:images%05d.jpg real_time=0
    • melt -group in=0 out=0 `ls -r` -consumer avformat:reverse.mpeg qscale=0.01 real_time=0
    • Warning: If the argument list gets to long this might not work?
    • The newer approach is to use the framebuffer producer and append '?-1' to the file name.

  • Is it possible to do multiple composites?
    • On 2005-06-26 the following example was working:
    • melt colour:blue -attach watermark:"+hello.txt" producer.size=266 composite.alpha_a=0 -attach watermark:colour:red composite.alpha_b=0 composite.or=1

  • How can I speed up decoding AVCHD?
    • unfortunately, AVCHD is coded using techniques that prevents FFmpeg from using multiple threads.
    • Passing skip_loop_filter=all to the producer tells FFmpeg to skip the in-loop deblocking filter.
    • Passing skip_frame=bidir to the producer tells FFmpeg to skip bidirectionally codec (B) pictures.
    • For example, melt -profile atsc_1080i_60 00001.mts skip_loop_filter=all skip_frame=bidir
    • It can make a lot of sense to use these options when playing but not when encoding/rendering.

  • Not really a question, some doc on the 'transition as filter' thing
simple usage is something like: melt file.ogg -track file2.ogg -attach transition:mix start=0.5
more advanced stuff can be done if you hand author XML like:
 <?xml version="1.0" encoding="utf-8"?>
 <mlt title="Audio Mix">
   <producer in="0" out="499">
     <property name="markup">Audio Mix</property>
     <property name="mlt_service">pango</property>
     <property name="meta.fx_cut">1</property>
  <filter mlt_service="transition" transition="mix">
       <property name="start">0.5</property>
     </filter>
   </producer>
 </mlt>
 then the mix can go on it's own track (but needs in/out/length specification of course) like:
 melt file.ogg -track file2.ogg -track mix.mlt out=4999

Streaming

After making the experiments below, I have had the most success in reliability, stream integrity, and using higher resolution/framerate/bitrate with Ogg Theora.

  • How can I stream as Ogg Theora/Vorbis?
    • Install icecast2 and oggfwd, add a mount point in icecast.xml and run icecast followed by
    • melt -profile square_ntsc somevideo.foo ... -consumer avformat real_time=1 terminate_on_pause=0 f=ogg vcodec=libtheora b=1000k acodec=libvorbis aq=25 | oggfwd host 8000 password /live.ogg
    • You can play this with FireFox 3.5+ or VLC using http://host:8000/live.ogg

  • How can I stream as multicast transport stream?
    • melt -profile square_pal somevideo.foo ... -consumer avformat:udp://224.224.224.224:1234?pkt_size=1316\&reuse=1 real_time=1 terminate_on_pause=0 f=mpegts vcodec=mpeg4 b=1000k s=320x240 acodec=mp2 ab=128k
    • You might change the video codec to h264 or audio codec to libmp3lame or libfaac - if ya got it.
    • You can play this in VLC using udp://@224.224.224.224:1234

  • How can I stream as transport stream over HTTP?
    • You can convert the multicast above to serve it over HTTP upon request using VLC:
      vlc -I dummy 'udp://@224.224.224.224:1234' --sout '#std{access=http,mux=ts,dst=0.0.0.0:8080}'
    • Finally, you can play it with another VLC using http://host:8080
    • You do not have to use multicast; you can use localhost or a unicast IP address.

  • How can I stream as something compatible with Windows Media Player over HTTP?
    • You can transcode the multicast above to serve it over HTTP upon request using VLC:
      vlc -I dummy 'udp://@224.224.224.224:1234' --sout \
      '#transcode{vcodec=WMV2,vb=800,acodec=wma2,ab=128,channels=2,samplerate=44100}:std{access=http,mux=asf,dst=0.0.0.0:8080}'

Filters

  • Can Frei0r and Ladspa effects be added as filters in the XML? Does MLT know anything about these effects, such as which parameters are needed, valid values, etc.?
    • Yes, but the ladspa filter currently requires an external xml file defining one or more ladspa filters. Eventually, it would be nice to be able to embed this in the MLT XML - for example, you can embed SVG in the pixbuf producer. This external xml file is the format generated by the JACK Rack program. You might take a look at the JACK Rack (requires jack sound daemon) UI and design something similar. Below is a sample jackrack XML file:
<?xml version="1.0"?>
<!DOCTYPE jackrack SYSTEM "http://purge.bash.sh/~rah/jack_rack_1.2.dtd">
<jackrack>
 <channels>2</channels>
 <samplerate>48000</samplerate>
 <plugin>
   <id>1217</id>
   <enabled>true</enabled>
   <wet_dry_enabled>false</wet_dry_enabled>
   <wet_dry_locked>true</wet_dry_locked>
   <wet_dry_values>
     <value>1.000000</value>
     <value>1.000000</value>
   </wet_dry_values>
   <lockall>true</lockall>
   <controlrow>
     <lock>true</lock>
     <value>25</value>
     <value>25</value>
   </controlrow>
   <controlrow>
     <lock>true</lock>
     <value>0.75</value>
     <value>0.75</value>
   </controlrow>
   <controlrow>
     <lock>true</lock>
     <value>0.69</value>
     <value>0.69</value>
   </controlrow>
   <controlrow>
     <lock>true</lock>
     <value>1</value>
     <value>1</value>
   </controlrow>
 </plugin>
</jackrack>

Pass the filename to a generated jackrack xml file to the filter's resource property. There is something called LADSPA RDF that contains metadata about the filters and their parameters. Command line tool `listplugins` lists the ladspa plugins. Command line tool 'analyseplugin' shows the parameters for a plugin. You might be able to find a python binding to liblrdf or a pure python RDF parser to parse the RDF yourself. Or, maybe just run these and parse their output.

MLT features a metadata system similar to LADSPA that uses YAML Tiny instead of RDF format, but the query tool is built into melt. Not all MLT services support this yet, but frei0r does. 'melt -query filters' shows all of the filters. 'melt -query filter=frei0r.pixeliz0r' shows the metadata including parameters. There is an API for this metadata - see mlt++/MltRepository.h. There are frei0r producers and transitions as well.

Finally, along the same lines, there is a sox filter for additional audio effects. Run 'sox --help' to see a list of effects. Then, run 'sox --help-effect=echo' for the information on the effect parameters.

Topic revision: r18 - 2010-01-20 - 00:34:42 - DanDennedy
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding MLT Wiki? Send feedback