2

I'm using MLT from the command line on a series of images. When I run:

melt 0.jpg 1.jpg 2.jpg 3.jpg

It generates a video where each photo occupies one frame (4 frame long video). I want each photo to occupy 100 frames. I've tried every combination of properties I can think of, such as:

melt 0.jpg out=100 1.jpg in=100 out=200 2.jpg in=200 out=300 etc.

But the results are not as intended. I've also tried organizing into tracks, and melting from an XML file. At best, I've been able to get the photo to show up on the first intended frame, then 99 blank frames.

What is the best practice for extending the visible length of the photos? For a simple example, I would like to have a single track with 10 photos where each photo is organized into subsequent frames of 100. Eventually, I will be combining videos and photos.

When working with videos, I've had no issues, and my understanding is that the in and out properties are intended for video, but I haven't been able to locate any examples of how to extend the visible length of image producers.

Thanks for any ideas or tips! I'm really excited to be learning this awesome tool.

idealboy
  • 213
  • 3
  • 9

2 Answers2

5

The magic you are looking for is "ttl". Set the ttl parameter to the number of frames you want the image to last.

melt .all.jpg ttl=100

Some great examples here:

https://github.com/mltframework/mlt/blob/master/demo/mlt_slideshow

https://github.com/mltframework/mlt/blob/master/demo/mlt_slideshow2

https://github.com/mltframework/mlt/blob/master/demo/mlt_slideshow_black

Also an interesting blog post here:

http://mltframework.blogspot.com/2010/08/making-nice-slideshows.html

UPDATE:

The "*.jpg" syntax doesn't work for me. I'm pretty sure you have to use ".all.jpg". It seems you may be having some problems with your installation. Here are some things to try...

MLT has a couple of modules that can process images. If you don't specify a module, MLT picks one for you. Try explicitly specifying both modules and see if one works better than the other:

melt pixbuf:.all.jpg ttl=100

and:

melt qimage:.all.jpg ttl=100

Also, maybe try adding quotes?

melt pixbuf:".all.jpg" ttl=100

All of the above work for me.

if all of the above fail, try listing all the producers and check for pixbuf and qimage:

melt -query producers

I'm using Ubuntu, so I'm not going to be much help if this is an OSX specific issue. But I can tell you that MLT absolutely needs to be compiled against qt or gtk in order to get the image behavior you are looking for.

Brian
  • 1,200
  • 6
  • 8
  • Thank you! This is exactly what I'm looking for. In fact, the blog post is exactly what I'm trying to do! I'm still running into an issue, though. Although the syntax you linked to is obviously correct, it still generates a video for me with 1 photo on each frame. For example, I ran this in my images folder: `melt *.jpg ttl=100` And it generated a video 24 frames long with 24 images. I also tried to run the melt command shown in the blog post and it did the same thing. Do these commands work on your end? I re-installed from a new build file on 0.9.8 and same issue persists. Thanks! – idealboy Dec 01 '15 at 02:45
  • Works for me. Don't use "*.jpg", use ".all.jpg": `melt .all.jpg ttl=100` – Brian Dec 01 '15 at 19:48
  • When I run melt .all.jpg ttl=100 I get the response Failed to load ".all.jpg". I'm on Mac OS X, maybe that's the issue? I also have some dependencies installed via homebrew, so I wonder if a lower level library is causing the issue. Are you running OS X by chance? – idealboy Dec 01 '15 at 21:18
  • I updated my answer above with some more things you can try to debug the problem. – Brian Dec 02 '15 at 03:58
  • Thanks for the debugging tips - that helped a lot. It turns out MLT isn't recognizing pixbuf because gtk+ wasn't installed. I installed gtk+ via homebrew, but it doesn't include the x11 backend, which is causing issues. I'll address those as separate issues, but your help set me on the path to troubleshooting. Thanks! – idealboy Dec 03 '15 at 03:50
4

Does this work for you?

melt \
0.jpg length=100 \
1.jpg length=100 \
2.jpg length=100

This method may be better if you seek a bit more control (if you want one image to last 200 frames, and another 50 frames).

However, if that doesn't matter, Brian's method is much more convenient assuming all your images end with .jpg.

When you use in=200 out=300, that is saying to start your image at frame 200, and end at frame 300.

Since it's an image, there's no need to start it at frame 200. If it was a video, then you would be skipping the first 199 frames, and it will end at frame 300. Hope that was clear!

TuxForLife
  • 219
  • 1
  • 2
  • 15
  • Thanks for the comment! I tried the length property as you outlined, but same issue, each photo only takes up 1 frame. At this point it seems like it must be some sort of configuration issue. I'm thinking of installing a Linux VM to test this on. Would you mind letting me know what system you are successfully running Melt on? Thanks! – idealboy Dec 02 '15 at 15:07