Understanding/controlling MLT melt slideshow?












0















Consider the following bash script (on Ubuntu 18.04, melt 6.6.0), which uses melt to make a slideshow and play it locally in a window (SDL consumer), mostly copied from https://mltframework.org/blog/making_nice_slideshows/ ( edit: I'm aware that's its possible to specify files individually as in https://superuser.com/questions/833232/create-video-with-5-images-with-fadein-out-effect-in-ffmpeg/834035#834035 - but that approach seems to scale images during transition, and takes quite a while to "render" before playing in SDL window, while this one has nearly instant playback):



echo "
description=DV PAL
frame_rate_num=25
frame_rate_den=1
width=720
height=576
progressive=0
sample_aspect_num=59
sample_aspect_den=54
display_aspect_num=4
display_aspect_den=3
colorspace=601
" > my-melt.profile

mkdir tmppics
convert -background lightblue -fill blue -size 3840x2160 -pointsize 200 -gravity center label:"Test A" tmppics/pic_01.jpg
convert -background lightblue -fill blue -size 3840x2160 -pointsize 200 -gravity center label:"Test B" tmppics/pic_02.jpg

melt -verbose -profile ./my-melt.profile
./tmppics/.all.jpg ttl=6
-attach crop center=1
-filter luma cycle=6 duration=4
-consumer sdl



  • When I run the above command, the video shows the two images loop, but the frame counter keeps on going, increasing indefinitely. How do I make it stop after the exact amount of frames that the loop is long?

  • As far as I can see, the size of the output video is controlled by a profile; that is, even if I don't specify -profile, a default one is assumed; is that correct?

  • The original images look like this:


pic01_eog



... and the video looks like this:



pic01_melt



... which means the aspect ratio is wrong; additionally I can see jagged edges, meaning the scaled image in the video is not antialiased.



How do I make the image fit in video size with correct aspect ratio, with antialiasing/smoothing? (I guess it has to do with -attach crop center=1, but I couldn't find documentation on that).




  • When viewing stuff in SDL and stepping through frames, are frames numbered 0-based, - or are they 1-based, and at frame 0 simply the same frame as 1 is shown?


  • If I use ttl=6 and -filter luma cycle=6 duration=4, I get this:



melt01-opt.gif



... that is, visible transition starts at frame 7 (frame 6 is full image A), lasts for frames 7 and 8, and ends at frame 9 (which is full image B); then again at frames 13 and 14 (frame 15 is full image A)



However, if I use ttl=6 and -filter luma cycle=6 duration=2, then I get this:



melt02-opt.gif



... that is, there is no transition, image instantly changes at frame 7, then again at frame 13, etc.



So, I'd call the first case a transition duration of 2 frames, and the second case a duration of 0 frames - yet the options are duration=4 and duration=2, respectively. Can anyone explain why? Where are those 2 frames of difference gone?





  • Can I - and if so, how - do the same kind of slideshow, except with fade to black? I'd like to define a "time to live" (ttl) of 6 frames per image, and a transition of 4 frames, such that:




    • first, 4 frames are shown of image A;

    • then one frame image A faded, followed by one frame black (amounting to 6 frames TTL for image A, the last 2 transition);

    • then two frames image B faded (amounting to 4 frames transition with previous 2), followed by two more frames image B full (so 4 frames here of image B);

    • then one frame image B faded, followed by one frame black (amounting to 6 frames TTL for image B);




... etc.




  • Is it possible to persuade melt to use globbing to select images for slideshow, instead of using .all.jpg? As far as I can see on MLT (Media Lovin' Toolkit) Photo Slide Video no - but maybe there is another approach...










share|improve this question





























    0















    Consider the following bash script (on Ubuntu 18.04, melt 6.6.0), which uses melt to make a slideshow and play it locally in a window (SDL consumer), mostly copied from https://mltframework.org/blog/making_nice_slideshows/ ( edit: I'm aware that's its possible to specify files individually as in https://superuser.com/questions/833232/create-video-with-5-images-with-fadein-out-effect-in-ffmpeg/834035#834035 - but that approach seems to scale images during transition, and takes quite a while to "render" before playing in SDL window, while this one has nearly instant playback):



    echo "
    description=DV PAL
    frame_rate_num=25
    frame_rate_den=1
    width=720
    height=576
    progressive=0
    sample_aspect_num=59
    sample_aspect_den=54
    display_aspect_num=4
    display_aspect_den=3
    colorspace=601
    " > my-melt.profile

    mkdir tmppics
    convert -background lightblue -fill blue -size 3840x2160 -pointsize 200 -gravity center label:"Test A" tmppics/pic_01.jpg
    convert -background lightblue -fill blue -size 3840x2160 -pointsize 200 -gravity center label:"Test B" tmppics/pic_02.jpg

    melt -verbose -profile ./my-melt.profile
    ./tmppics/.all.jpg ttl=6
    -attach crop center=1
    -filter luma cycle=6 duration=4
    -consumer sdl



    • When I run the above command, the video shows the two images loop, but the frame counter keeps on going, increasing indefinitely. How do I make it stop after the exact amount of frames that the loop is long?

    • As far as I can see, the size of the output video is controlled by a profile; that is, even if I don't specify -profile, a default one is assumed; is that correct?

    • The original images look like this:


    pic01_eog



    ... and the video looks like this:



    pic01_melt



    ... which means the aspect ratio is wrong; additionally I can see jagged edges, meaning the scaled image in the video is not antialiased.



    How do I make the image fit in video size with correct aspect ratio, with antialiasing/smoothing? (I guess it has to do with -attach crop center=1, but I couldn't find documentation on that).




    • When viewing stuff in SDL and stepping through frames, are frames numbered 0-based, - or are they 1-based, and at frame 0 simply the same frame as 1 is shown?


    • If I use ttl=6 and -filter luma cycle=6 duration=4, I get this:



    melt01-opt.gif



    ... that is, visible transition starts at frame 7 (frame 6 is full image A), lasts for frames 7 and 8, and ends at frame 9 (which is full image B); then again at frames 13 and 14 (frame 15 is full image A)



    However, if I use ttl=6 and -filter luma cycle=6 duration=2, then I get this:



    melt02-opt.gif



    ... that is, there is no transition, image instantly changes at frame 7, then again at frame 13, etc.



    So, I'd call the first case a transition duration of 2 frames, and the second case a duration of 0 frames - yet the options are duration=4 and duration=2, respectively. Can anyone explain why? Where are those 2 frames of difference gone?





    • Can I - and if so, how - do the same kind of slideshow, except with fade to black? I'd like to define a "time to live" (ttl) of 6 frames per image, and a transition of 4 frames, such that:




      • first, 4 frames are shown of image A;

      • then one frame image A faded, followed by one frame black (amounting to 6 frames TTL for image A, the last 2 transition);

      • then two frames image B faded (amounting to 4 frames transition with previous 2), followed by two more frames image B full (so 4 frames here of image B);

      • then one frame image B faded, followed by one frame black (amounting to 6 frames TTL for image B);




    ... etc.




    • Is it possible to persuade melt to use globbing to select images for slideshow, instead of using .all.jpg? As far as I can see on MLT (Media Lovin' Toolkit) Photo Slide Video no - but maybe there is another approach...










    share|improve this question



























      0












      0








      0








      Consider the following bash script (on Ubuntu 18.04, melt 6.6.0), which uses melt to make a slideshow and play it locally in a window (SDL consumer), mostly copied from https://mltframework.org/blog/making_nice_slideshows/ ( edit: I'm aware that's its possible to specify files individually as in https://superuser.com/questions/833232/create-video-with-5-images-with-fadein-out-effect-in-ffmpeg/834035#834035 - but that approach seems to scale images during transition, and takes quite a while to "render" before playing in SDL window, while this one has nearly instant playback):



      echo "
      description=DV PAL
      frame_rate_num=25
      frame_rate_den=1
      width=720
      height=576
      progressive=0
      sample_aspect_num=59
      sample_aspect_den=54
      display_aspect_num=4
      display_aspect_den=3
      colorspace=601
      " > my-melt.profile

      mkdir tmppics
      convert -background lightblue -fill blue -size 3840x2160 -pointsize 200 -gravity center label:"Test A" tmppics/pic_01.jpg
      convert -background lightblue -fill blue -size 3840x2160 -pointsize 200 -gravity center label:"Test B" tmppics/pic_02.jpg

      melt -verbose -profile ./my-melt.profile
      ./tmppics/.all.jpg ttl=6
      -attach crop center=1
      -filter luma cycle=6 duration=4
      -consumer sdl



      • When I run the above command, the video shows the two images loop, but the frame counter keeps on going, increasing indefinitely. How do I make it stop after the exact amount of frames that the loop is long?

      • As far as I can see, the size of the output video is controlled by a profile; that is, even if I don't specify -profile, a default one is assumed; is that correct?

      • The original images look like this:


      pic01_eog



      ... and the video looks like this:



      pic01_melt



      ... which means the aspect ratio is wrong; additionally I can see jagged edges, meaning the scaled image in the video is not antialiased.



      How do I make the image fit in video size with correct aspect ratio, with antialiasing/smoothing? (I guess it has to do with -attach crop center=1, but I couldn't find documentation on that).




      • When viewing stuff in SDL and stepping through frames, are frames numbered 0-based, - or are they 1-based, and at frame 0 simply the same frame as 1 is shown?


      • If I use ttl=6 and -filter luma cycle=6 duration=4, I get this:



      melt01-opt.gif



      ... that is, visible transition starts at frame 7 (frame 6 is full image A), lasts for frames 7 and 8, and ends at frame 9 (which is full image B); then again at frames 13 and 14 (frame 15 is full image A)



      However, if I use ttl=6 and -filter luma cycle=6 duration=2, then I get this:



      melt02-opt.gif



      ... that is, there is no transition, image instantly changes at frame 7, then again at frame 13, etc.



      So, I'd call the first case a transition duration of 2 frames, and the second case a duration of 0 frames - yet the options are duration=4 and duration=2, respectively. Can anyone explain why? Where are those 2 frames of difference gone?





      • Can I - and if so, how - do the same kind of slideshow, except with fade to black? I'd like to define a "time to live" (ttl) of 6 frames per image, and a transition of 4 frames, such that:




        • first, 4 frames are shown of image A;

        • then one frame image A faded, followed by one frame black (amounting to 6 frames TTL for image A, the last 2 transition);

        • then two frames image B faded (amounting to 4 frames transition with previous 2), followed by two more frames image B full (so 4 frames here of image B);

        • then one frame image B faded, followed by one frame black (amounting to 6 frames TTL for image B);




      ... etc.




      • Is it possible to persuade melt to use globbing to select images for slideshow, instead of using .all.jpg? As far as I can see on MLT (Media Lovin' Toolkit) Photo Slide Video no - but maybe there is another approach...










      share|improve this question
















      Consider the following bash script (on Ubuntu 18.04, melt 6.6.0), which uses melt to make a slideshow and play it locally in a window (SDL consumer), mostly copied from https://mltframework.org/blog/making_nice_slideshows/ ( edit: I'm aware that's its possible to specify files individually as in https://superuser.com/questions/833232/create-video-with-5-images-with-fadein-out-effect-in-ffmpeg/834035#834035 - but that approach seems to scale images during transition, and takes quite a while to "render" before playing in SDL window, while this one has nearly instant playback):



      echo "
      description=DV PAL
      frame_rate_num=25
      frame_rate_den=1
      width=720
      height=576
      progressive=0
      sample_aspect_num=59
      sample_aspect_den=54
      display_aspect_num=4
      display_aspect_den=3
      colorspace=601
      " > my-melt.profile

      mkdir tmppics
      convert -background lightblue -fill blue -size 3840x2160 -pointsize 200 -gravity center label:"Test A" tmppics/pic_01.jpg
      convert -background lightblue -fill blue -size 3840x2160 -pointsize 200 -gravity center label:"Test B" tmppics/pic_02.jpg

      melt -verbose -profile ./my-melt.profile
      ./tmppics/.all.jpg ttl=6
      -attach crop center=1
      -filter luma cycle=6 duration=4
      -consumer sdl



      • When I run the above command, the video shows the two images loop, but the frame counter keeps on going, increasing indefinitely. How do I make it stop after the exact amount of frames that the loop is long?

      • As far as I can see, the size of the output video is controlled by a profile; that is, even if I don't specify -profile, a default one is assumed; is that correct?

      • The original images look like this:


      pic01_eog



      ... and the video looks like this:



      pic01_melt



      ... which means the aspect ratio is wrong; additionally I can see jagged edges, meaning the scaled image in the video is not antialiased.



      How do I make the image fit in video size with correct aspect ratio, with antialiasing/smoothing? (I guess it has to do with -attach crop center=1, but I couldn't find documentation on that).




      • When viewing stuff in SDL and stepping through frames, are frames numbered 0-based, - or are they 1-based, and at frame 0 simply the same frame as 1 is shown?


      • If I use ttl=6 and -filter luma cycle=6 duration=4, I get this:



      melt01-opt.gif



      ... that is, visible transition starts at frame 7 (frame 6 is full image A), lasts for frames 7 and 8, and ends at frame 9 (which is full image B); then again at frames 13 and 14 (frame 15 is full image A)



      However, if I use ttl=6 and -filter luma cycle=6 duration=2, then I get this:



      melt02-opt.gif



      ... that is, there is no transition, image instantly changes at frame 7, then again at frame 13, etc.



      So, I'd call the first case a transition duration of 2 frames, and the second case a duration of 0 frames - yet the options are duration=4 and duration=2, respectively. Can anyone explain why? Where are those 2 frames of difference gone?





      • Can I - and if so, how - do the same kind of slideshow, except with fade to black? I'd like to define a "time to live" (ttl) of 6 frames per image, and a transition of 4 frames, such that:




        • first, 4 frames are shown of image A;

        • then one frame image A faded, followed by one frame black (amounting to 6 frames TTL for image A, the last 2 transition);

        • then two frames image B faded (amounting to 4 frames transition with previous 2), followed by two more frames image B full (so 4 frames here of image B);

        • then one frame image B faded, followed by one frame black (amounting to 6 frames TTL for image B);




      ... etc.




      • Is it possible to persuade melt to use globbing to select images for slideshow, instead of using .all.jpg? As far as I can see on MLT (Media Lovin' Toolkit) Photo Slide Video no - but maybe there is another approach...







      video-editing mlt






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 18 at 14:34







      sdaau

















      asked Jan 18 at 14:25









      sdaausdaau

      19.8k28149204




      19.8k28149204
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54255944%2funderstanding-controlling-mlt-melt-slideshow%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54255944%2funderstanding-controlling-mlt-melt-slideshow%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Homophylophilia

          Updating UILabel text programmatically using a function

          Cloud Functions - OpenCV Videocapture Read method fails for larger files from cloud storage