Hmm.

Do I need to add some kind of transition for the transparent color to have any 
effect?

I expected both of these to generate 100 (or 101?) red frames:

$ mlt-melt -track color:red in=0 out=100 -track color:transparent in=0 out=100
$ mlt-melt -track color:transparent in=0 out=100 -track color:red in=0 out=100

But the first one only shows black frames for me.

/Rickard

On Mon, Jul 24, 2023, at 06:48, Rickard Lindberg wrote:
> Thanks for your support! This workaround works fine for me.
> 
> /Rickard
> 
> On Sun, Jul 23, 2023, at 00:22, Brian Matherly wrote:
>> 
>> > mlt-melt color:red in=0 out=25 -blank 25 color:blue in=0 out=25 -consumer 
>> > avformat target=/tmp/export.mp4
>> 
>> Thanks for the example command. I reproduce this and I confirm it is a bug. 
>> I have filed it here:
>> https://github.com/mltframework/mlt/issues/931
>> 
>> As a workaround, you can use transparent clips instead of blank:
>> mlt-melt color:red in=0 out=25 color:transparent in=0 out=25 color:blue in=0 
>> out=25 -consumer avformat target=/tmp/export.mp4
>> 
>> ~Brian
>> 
>> 
>> On Friday, July 21, 2023 at 04:30:59 AM CDT, Rickard Lindberg 
>> <rick...@rickardlindberg.me> wrote:
>> 
>> 
>> I managed to reproduce the problem with melt:
>> 
>> $ mlt-melt color:red in=0 out=25 -blank 25 color:blue in=0 out=25 -consumer 
>> avformat target=/tmp/export.mp4
>> +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+
>> |1=-10| |2= -5| |3= -2| |4= -1| |5=  0| |6=  1| |7=  2| |8=  5| |9= 10|
>> +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+
>> +---------------------------------------------------------------------+
>> |               H = back 1 minute,  L = forward 1 minute              |
>> |                 h = previous frame,  l = next frame                 |
>> |           g = start of clip, j = next clip, k = previous clip       |
>> |                0 = restart, q = quit, space = play                  |
>> +---------------------------------------------------------------------+
>> [libx264 @ 0x7fe9d80023c0] interlace + weightp is not implemented
>> [mp4 @ 0x7fe9d8000f40] Using AVStream.codec to pass codec parameters to 
>> muxers is deprecated, use AVStream.codecpar instead.
>> [mp4 @ 0x7fe9d8000f40] Using AVStream.codec to pass codec parameters to 
>> muxers is deprecated, use AVStream.codecpar instead.
>> [aac @ 0x7fe9d8004e40] Input contains (near) NaN/+-Inf
>> [consumer avformat] error with audio encode: -22 (frame 28)
>> [aac @ 0x7fe9d8004e40] Input contains (near) NaN/+-Inf
>> [consumer avformat] error with audio encode: -22 (frame 28)
>> [aac @ 0x7fe9d8004e40] Input contains (near) NaN/+-Inf
>> [consumer avformat] error with audio encode: -22 (frame 29)
>> [aac @ 0x7fe9d8004e40] 5 frames left in the queue on closing
>> Current Position:         28
>> 
>> /Rickard
>> 
>> On Fri, Jul 21, 2023, at 10:44, Rickard Lindberg wrote:
>>> If I attach the audioconvert filter like this, the export works:
>>> 
>>>     playlist.attach(mlt.Filter(profile, "audioconvert"))
>>> 
>>> When loading the xml, this filter seems to be attached automatically, along 
>>> with avcolor_space. But it is not set for the playlist that I create.
>>> 
>>> Should I wrap my playlist in something so that the loader can do its thing? 
>>> Or should I add these filters manually?
>>> 
>>> /Rickard
>>> 
>>> 
>>> On Thu, Jul 20, 2023, at 22:19, Rickard Lindberg wrote:
>>>> I tried to generate an XML file using the "xml" consumer and got this:
>>>> 
>>>> <?xml version="1.0"?>
>>>> <mlt LC_NUMERIC="C" version="6.26.1" producer="playlist0">
>>>>   <profile description="DV/DVD PAL" width="720" height="576" 
>>>> progressive="0" sample_aspect_num="16" sample_aspect_den="15" 
>>>> display_aspect_num="4" display_aspect_den="3" frame_rate_num="25" 
>>>> frame_rate_den="1" colorspace="601"/>
>>>>   <producer id="producer0" in="0" out="14999">
>>>>     <property name="length">15000</property>
>>>>     <property name="eof">pause</property>
>>>>     <property name="resource">red</property>
>>>>     <property name="aspect_ratio">1.06667</property>
>>>>     <property name="mlt_service">color</property>
>>>>   </producer>
>>>>   <producer id="producer1" in="0" out="14999">
>>>>     <property name="length">15000</property>
>>>>     <property name="eof">pause</property>
>>>>     <property name="resource">green</property>
>>>>     <property name="aspect_ratio">1.06667</property>
>>>>     <property name="mlt_service">color</property>
>>>>   </producer>
>>>>   <playlist id="playlist0">
>>>>     <entry producer="producer0" in="0" out="25"/>
>>>>     <blank length="26"/>
>>>>     <entry producer="producer1" in="0" out="25"/>
>>>>   </playlist>
>>>> </mlt>
>>>> 
>>>> Melt seems to be able to render this just fine using
>>>> 
>>>> mlt-melt test.xml -consumer avformat target=export.mp4 acodec=aac
>>>> 
>>>> So my guess is that I need to do something different in my code. Question 
>>>> is what...
>>>> 
>>>> /Rickard
>>>> 
>>>> On Thu, Jul 20, 2023, at 22:16, Brian Matherly wrote:
>>>>> 
>>>>> Your MLT is over 2 years old. Can you try with a newer version?
>>>>> 
>>>>> Also, it would be helpful to reproduce with a melt command so that others 
>>>>> can easily recreate the problem.
>>>>> 
>>>>> ~Brian
>>>>> 
>>>>> 
>>>>> On Thursday, July 20, 2023 at 03:00:45 PM CDT, Rickard Lindberg 
>>>>> <rick...@rickardlindberg.me> wrote:
>>>>> 
>>>>> 
>>>>> Hi,
>>>>> 
>>>>> I'm having trouble exporting a playlist that contains blanks. Here is a 
>>>>> small
>>>>> program to reproduce the problem:
>>>>> 
>>>>>     mlt.Factory().init()
>>>>>     profile = mlt.Profile()
>>>>>     playlist = mlt.Playlist()
>>>>>     playlist.append(mlt.Producer(profile, "color:red"), 0, 25)
>>>>>     playlist.blank(25)
>>>>>     playlist.append(mlt.Producer(profile, "color:green"), 0, 25)
>>>>>     consumer = mlt.Consumer(profile, "avformat")
>>>>>     consumer.set("target", "export.mp4")
>>>>>     consumer.connect(playlist)
>>>>>     consumer.start()
>>>>>     while consumer.is_stopped() == 0:
>>>>>         time.sleep(1)
>>>>> 
>>>>> The output:
>>>>> 
>>>>>     [libx264 @ 0x7f61740023c0] interlace + weightp is not implemented
>>>>>     [mp4 @ 0x7f6174000f40] Using AVStream.codec to pass codec parameters 
>>>>> to muxers is deprecated, use AVStream.codecpar instead.
>>>>>     [mp4 @ 0x7f6174000f40] Using AVStream.codec to pass codec parameters 
>>>>> to muxers is deprecated, use AVStream.codecpar instead.
>>>>>     [aac @ 0x7f6174004e40] Input contains (near) NaN/+-Inf
>>>>>     [consumer avformat] error with audio encode: -22 (frame 28)
>>>>>     [aac @ 0x7f6174004e40] Input contains (near) NaN/+-Inf
>>>>>     [consumer avformat] error with audio encode: -22 (frame 28)
>>>>>     [aac @ 0x7f6174004e40] Input contains (near) NaN/+-Inf
>>>>>     [consumer avformat] error with audio encode: -22 (frame 29)
>>>>>     [aac @ 0x7f6174004e40] 5 frames left in the queue on closing
>>>>> 
>>>>> Without
>>>>> 
>>>>>     playlist.blank(25)
>>>>> 
>>>>> the export works fine.
>>>>> 
>>>>> I assumed that if no producer exist to produce sound, silence will be 
>>>>> used. Is
>>>>> that assumption wrong? Do I need to insert a producer for silence? Or is 
>>>>> this
>>>>> an issue with the aac encoder?
>>>>> 
>>>>> Versions:
>>>>> 
>>>>>     mlt: 6.26.1
>>>>>     ffmpeg: 4.4.1
>>>>> 
>>>>> /Rickard
>>>>> 
>>>>> _______________________________________________
>>>>> Mlt-devel mailing list
>>>>> Mlt-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/mlt-devel
>>>> 
>>>> 
>>>> _______________________________________________
>>>> Mlt-devel mailing list
>>>> Mlt-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/mlt-devel
>>>> 
>>> 
>>> 
>>> _______________________________________________
>>> Mlt-devel mailing list
>>> Mlt-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/mlt-devel
>>> 
>> 
> 
> 
> _______________________________________________
> Mlt-devel mailing list
> Mlt-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mlt-devel
> 
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to