On Wed, Apr 30, 2014 at 10:19 AM, Dan Dennedy <d...@dennedy.org> wrote:

> On Wed, Apr 30, 2014 at 9:47 AM, James N. Hart <
> james.h...@schneider-electric.com> wrote:
>
>> Hello everyone, I would like to limit the number of frames that are output
>> by the avformat consumer no matter how many frames are produced.
>>
>> At the moment, I can only use the command line (q)melt.  This problem
>> would
>> be easier using the libraries directly, but that isn't an option at this
>> time.  I've dumb down the issue as much as possible, and I came up with
>> essentially what I want is this:
>>   qmelt.exe 1.mov -consumer avformat:demo.mp4 out=200
>>
>> 1.mov has 540 frames.  The end result is 540 frames. I do not want to put
>> out= as a property on the producer, this is a dumb down example, a more
>> realistic one I have is:
>>   qmelt.exe 1.mov -blank 120 1.mov -consumer avformat:demo.mp4 out=200
>>
>> In this example, assume there is at least 200 frames.  It doesn't matter
>> if
>> 1.mov has 40 or 500 frames, I still want demo.mp4 to have 200 frames.
>> Obviously, out isn't a consume property.  I've looked at the avformat docs
>> and was unable to see any like property.  I know I could just encode
>> demo.mp4 a second time using out on the producer but that seems resource
>> intensive for such a simple use case.
>>
>> Basically, I need to be able to stitch together video and blank frames and
>> then limit the output no matter how long the clip/track.  Any ideas to
>> accomplish what I need?
>>
>> I would be willing to use a filter such as:
>>   qmelt.exe 1.mov -blank 120 1.mov -attach-track out_limit:200 -consumer
>> avformat:demo.mp4
>>
>> There didn't seem to be a filter, that I'm aware of, which will do this?
>>
>
> Why not simple math?
> 200 - 120 = 80
> qmelt 1.mov out=80 -blank 120 -consumer ...
> yields, actually, 202 frames because out points are frame numbers (or time
> value), which are are 0-based and not durations. Therefore, out=80 is a
> duration of 81 frames. Thus, to really get 200 frames you need to do:
> qmelt 1.mov out=79 -blank 119 -consumer ...
>
> The framework and modules, by design, do not provide much in the way of
> authoring as much as they simply facilitate it. You need to make your own
> layer that generates the composition as melt command lines, MLT XML, or by
> custom program using the API.
>
>
Now, with that said, and with your claim that you just need a simple way to
limit the number of frames in the output, if the consumer honored an out
property or melt let you target the track or tractor properties, then you
could accomplish that. I am just not sure how you want to determine the
length of the video clip vs. the number of blank frames.

melt 1.mov -blank 119 -consumer xml:test.mlt no_meta=1
edit test.mlt so that playlist out=199
melt test.mlt -consumer avformat:demo.mp4

So, the solution may be to generate MLT XML, perhaps with a template
engine, instead of complex melt command lines. You can even put a consumer
element into the XML:
<consumer mlt_service="avformat" target="demo.mp4"/>
Add any other encoding properties as XML attributes.
-- 
+-DRD-+
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to