问题
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.
回答1:
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.
回答2:
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!
来源:https://stackoverflow.com/questions/33988312/mlt-media-lovin-toolkit-photo-slide-video