Menu

#248 Using mpl file results in repeating info in videos

unknown
closed
nobody
None
5
2016-09-24
2016-09-18
No

Recently I've discovered that in videos longer than 7-8 minutes, the text info (included in mpl files) starts to repeat in the videos. There is no hard limit, this can happen at any second, and it's the same in both the 6.2.0 version and an old 0.9.2.

The command I use looks like this:

/opt/melt/bin/melt -silent /mnt/in/78733_.mlt -consumer avformat:/mnt/out/78733_2623095.mp4 progressive=1 vcodec=libx264 flags=+loop cmp=+chroma partitions=+parti8x8+parti4x4+partp8x8+partb8x8 me_method=umh subq=7 me_range=16 g=250 keyint_min=25 i_qfactor=0.71 qcomp=0.6 qmin=10 qmax=51 qdiff=4 directpred=1 trellis=1 coder=0 bf=0 refs=1 flags2=+wpred+dct8x8 level=30 wpredp=0 s=1920x1080 aspect=1.7778 r=26 b=6984k an=1 

This is the contents of 78733_.mlt:

<?xml version="1.0" encoding="utf-8"?>
<mlt>
  <producer id="producer0">
    <property name="resource">78733_2623095.mp4</property>
  </producer>
  <playlist id="playlist0">
    <entry producer="producer0" in="0" out="18846"/>
  </playlist>
  <tractor id="tractor0">
    <track producer="playlist0"/>
    <filter id="time" in="0" out="0">
      <property name="track">0</property>
      <property name="factory">loader</property>
      <property name="resource">pango:/mnt/in/78733_time.mpl</property>
      <property name="mlt_type">filter</property>
      <property name="mlt_service">watermark</property>
      <property name="producer.fgcolour">0x000000ff</property>
      <property name="producer.bgcolour">0xffffff20</property>
      <property name="composite.halign">c</property>
      <property name="composite.valign">t</property>
    </filter>
  </tractor>
</mlt>

The 78733_time.mpl file starts with:

0=<span font="sans bold 11"> </span><span font="sans bold 20">31.08.2016 16:36:49</span><span font="sans bold 11"> </span>
26=<span font="sans bold 11"> </span><span font="sans bold 20">31.08.2016 16:36:50</span><span font="sans bold 11"> </span>
52=<span font="sans bold 11"> </span><span font="sans bold 20">31.08.2016 16:36:51</span><span font="sans bold 11"> </span>
78=<span font="sans bold 11"> </span><span font="sans bold 20">31.08.2016 16:36:52</span><span font="sans bold 11"> </span>
104=<span font="sans bold 11"> </span><span font="sans bold 20">31.08.2016 16:36:53</span><span font="sans bold 11"> </span> 

And ends with:

19006=<span font="sans bold 11"> </span><span font="sans bold 20">31.08.2016 16:49:00</span><span font="sans bold 11"> </span>
19032=<span font="sans bold 11"> </span><span font="sans bold 20">31.08.2016 16:49:01</span><span font="sans bold 11"> </span>
19058=<span font="sans bold 11"> </span><span font="sans bold 20">31.08.2016 16:49:02</span><span font="sans bold 11"> </span>
19084=<span font="sans bold 11"> </span><span font="sans bold 20">31.08.2016 16:49:03</span><span font="sans bold 11"> </span> 

The last timestamp ("31.08.2016 16:49:03") is never written into the video, as sometime during the process, the timestamp sequence restarts (with "31.08.2016 16:36:49"). This happens at the exact same second if I retry with the same video.

Is this a known limitation in Melt? Any further info I can provide?

Thanks,
Robert

Discussion

  • Dan Dennedy

    Dan Dennedy - 2016-09-18

    It seems maybe the pango producer, which processes .mpl files, does not automatically adjust its duration based on the contents of the mpl. To workaound, the water filter can adjust the duration of the producer it embeds for the overlay if you preface the property name with "producer.":
    https://www.mltframework.org/bin/view/MLT/FilterWatermark#producer

    Therefore, supply properties producer.out and producer.length on the watermark filter greater than or equal to the duration of the mpl.

     
  • Dan Dennedy

    Dan Dennedy - 2016-09-19
    • summary: Using avformat results in repeating info in videos --> Using mpl file results in repeating info in videos
     
  • Dan Dennedy

    Dan Dennedy - 2016-09-19

    I do not have a long mpl file handy. Can you try this patch?

    diff --git a/src/modules/gtk2/producer_pango.c b/src/modules/gtk2/producer_pango.c
    index 10f85bd..d9883aa 100644
    --- a/src/modules/gtk2/producer_pango.c
    +++ b/src/modules/gtk2/producer_pango.c
    @@ -212,6 +212,7 @@ mlt_producer producer_pango_init( const char *filename )
                    else if ( strstr( filename, ".mpl" ) ) 
                    {
                            int i = 0;
    +                       mlt_position out_point = 0;
                            mlt_properties contents = mlt_properties_load( filename );
                            mlt_geometry key_frames = mlt_geometry_init( );
                            struct mlt_geometry_item_s item;
    @@ -231,8 +232,11 @@ mlt_producer producer_pango_init( const char *filename )
                                            ( *strchr( value, '~' ) ) = '\n';
                                    item.frame = atoi( name );
                                    mlt_geometry_insert( key_frames, &item );
    +                               out_point = MAX( out_point, item.frame );
                            }
                            mlt_geometry_interpolate( key_frames );
    +                       mlt_properties_set_position( properties, "length", out_point + 1 );
    +                       mlt_properties_set_position( properties, "out", out_point );
                    }
                    else
                    {
    
     
  • Robert Fejer

    Robert Fejer - 2016-09-22

    Thanks for the patch. I tried it, and the problem seems to be fixed. Used the previous video, and a new 15-minute video, and the whole mpl file contents were written into the video. Good job! :)

    Thanks,
    Robert

     
  • Dan Dennedy

    Dan Dennedy - 2016-09-24
    • status: open --> closed
     

Log in to post a comment.