Menu

#566 Option to generate animation as video file (mpeg or mp4)

open
nobody
None
5
2023-11-18
2023-11-16
No

Is it possible to expand Gnuplot's relevance by adding a built-in function to generate a mpeg or mp4 format file as an alternate to displaying the animation in a window?

Such an option would permit the results of Gnuplot to be shared away from the environment/point of creation and present those results to a wider audience (in their more receptive mode/environment) when trying to communicate results from various research/analyses (i.e. Frame3DD animations of multiple structural analysis dynamic modal simulations).

The attached plot instruction file (Icosahedron__1v_iter5_Results.plt) gives you an idea of the "script" file that calls upon a large number of data files (other files in the tar file) to create dynamic simulations of structure vibrational modes.

Thank you,
Eric Marceau, 68, retired
member of Google Geodesic Help Group

1 Attachments

Related

Feature Requests: #566

Discussion

  • Ethan Merritt

    Ethan Merritt - 2023-11-17

    Current gnuplot supports creating animation as a webp file, although it uses the rather limited API provided in WebPAnimEncoder rather than the full API used by the standalone webpmux encoding utility.

    I attach the result of running your test script with 2 lines added at the top

    set term webp size 400,400 animate
    set output 'icosahedron.webp'
    
    # FRAME3DD ANALYSIS RESULTS  http://frame3dd.sf.net/ VERSION 20140514+ 
    # Proof-of-concept problem:  Icosahedron frame - static and dynamic analysis (in  kip) 
    # Thu Nov 16 14:35:13 2023
    

    Does that meet your needs? If not, what modifications to the existing driver capabilities would you like to see?

     
    • Eric Marceau

      Eric Marceau - 2023-11-17

      Thank you very much, Ethan!

      [1] My version doesn't accept that option

      The WEBP file you provided look very good but, for some reason, my
      version is not offering that option.

      ericthered@OasisMega1:/DB001_F4/GEODESIC/geodesic/GEO__ForceBalance$
      gnuplot -c Icosahedron__1v_iter5_Results.plt
      
               set term webp size 400,400 animate
                ^
               "Icosahedron__1v_iter5_Results.plt" line 1: unknown or
      ambiguous terminal type; type just 'set terminal' for a list
      
      ericthered@OasisMega1:/DB001_F4/GEODESIC/geodesic/GEO__ForceBalance$
      gnuplot
      
           G N U P L O T
           Version 5.2 patchlevel 8    last modified 2019-12-01
      
           Copyright (C) 1986-1993, 1998, 2004, 2007-2019
           Thomas Williams, Colin Kelley and many others
      
           gnuplot home: http://www.gnuplot.info
           faq, bugs, etc:   type "help FAQ"
           immediate help:   type "help"  (plot window: hit 'h')
      
               (...snip...)
      
            unknown  Unknown terminal type - not a plotting device
                  vttek  VT-like tek40xx terminal emulator
                     wxt  wxWidgets cross-platform interactive terminal
                     x11  X11 Window System interactive terminal
                     xlib  X11 Window System (dump of gnuplot_x11 command
      stream)
                 xterm  Xterm Tektronix 4014 Mode
      gnuplot>
      

      I just re-ran "apt install gnuplot", and it is only providing me with
      the above version and options.
      I am running UbuntuMATE 20.04 LTS.

      Is there a way to force the install of a more recent gnuplot which would
      give me access to that option?

      [2] Solution Fulfills Needs

      The WEBP option would indeed satisfy the need completely, since I could
      convert the webp to an mpeg, if and when that is needed.

      [3] GIF option

      I tried the GIF option, but that took a very long time (10 minutes
      ???)!  Any hints?  Also, that looks like an all or nothing option. I
      need to run the program twice, once without the header lines (for visual
      inspection) and once with the header lines (to create the animation
      file).  Correct?  or is there another trick that would let me have both
      (screen display while background conversion and storage for GIF)?

      [4] Selective scope redirect ?

      Is there a way to limit which portions of the file are "redirected" to a
      webp file?  Namely, can I set up such a WEBP creation only for each
      segment of the file (one each for the 6 resonance frequency simulation
      modes)?  The file you provided lumped all 7 groupings into one video
      file.  I will look at the documentation to see what I need to do, but if
      you have any examples that specifically show how to close a first
      redirect file and open a second/third/etc. target file would be very
      much appreciated.

      Thank you in advance for your consideration of my request and for all
      your assistance.

      Eric

      On 2023-11-16 20:58, Ethan Merritt wrote:

      Current gnuplot supports creating animation as a webp file, although
      it uses the rather limited API provided in WebPAnimEncoder rather than
      the full API used by the standalone webpmux encoding utility.

      I attach the result of running your test script with 2 lines added at
      the top

      |set term webp size 400,400 animate set output 'icosahedron.webp' #
      FRAME3DD ANALYSIS RESULTS http://frame3dd.sf.net/ VERSION 20140514+ #
      Proof-of-concept problem: Icosahedron frame - static and dynamic
      analysis (in kip) # Thu Nov 16 14:35:13 2023 |

      Does that meet your needs? If not, what modifications to the existing
      driver capabilities would you like to see?

      Attachments:


      [feature-requests:#566]
      https://sourceforge.net/p/gnuplot/feature-requests/566/ Option to
      generate animation as video file (mpeg or mp4)

      Status: open
      Group:
      Created: Thu Nov 16, 2023 11:58 PM UTC by Eric Marceau
      Last Updated: Thu Nov 16, 2023 11:58 PM UTC
      Owner: nobody
      Attachments:

      Is it possible to expand Gnuplot's relevance by adding a built-in
      function to generate a mpeg or mp4 format file as an alternate to
      displaying the animation in a window?

      Such an option would permit the results of Gnuplot to be shared away
      from the environment/point of creation and present those results to a
      wider audience (in their more receptive mode/environment) when trying
      to communicate results from various research/analyses (i.e. Frame3DD
      animations of multiple structural analysis dynamic modal simulations).

      The attached plot instruction file (Icosahedron__1v_iter5_Results.plt)
      gives you an idea of the "script" file that calls upon a large number
      of data files (other files in the tar file) to create dynamic
      simulations of structure vibrational modes.

      Thank you,
      Eric Marceau, 68, retired
      member of Google Geodesic Help Group


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/gnuplot/feature-requests/566/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Feature Requests: #566

  • Ethan Merritt

    Ethan Merritt - 2023-11-17

    [1] My version doesn't accept that option

    You'll have to take that up with Ubuntu, or ask for help on an Ubuntu forum. Or you could build from source. Current version is 5.4, released July 2020. Release of version 6 is imminent, release candidate 6.0.rc3 is available for testing. There are some contributed guidelines for building under Ubuntu in the INSTALL file of the version 6 source distribution package.

    [2] Solution Fulfills Needs

    Good to hear.

    [3] GIF option

    Yeah. Animated gifs were OK when it was mostly cartoon kitty icons waving a paw but they are not really suited for larger use. Also the library used to create them does lower-quality graphics than the newer terminals can produce.

    [4] Selective scope redirect ?

    Is there a way to limit which portions of the file are "redirected" to a
    webp file? Namely, can I set up such a WEBP creation only for each
    segment of the file (one each for the 6 resonance frequency simulation
    modes)? The file you provided lumped all 7 groupings into one video
    file. I will look at the documentation to see what I need to do, but if
    you have any examples that specifically show how to close a first
    redirect file and open a second/third/etc. target file would be very
    much appreciated.

    I didn't really look at your script in detail. I just ran it as-is after editing to read files from the current directory rather than /tmp. Here's a quick go at a script that creates a separate file for each mode. I may not understand the file naming system correctly but it does produce reasonable looking output. FWIW the run time was about 2 seconds total for the two 50-frame animations.

    set term web size 400,400 animate
    
    #
    # Mode 1
    #
    set output 'mode1.webp'
    meshfile = "Icosahedron__1v_iter5_Results-msh"
    do for [i=0:50] {
       j = (i > 25) ? 50-i : i
       polyfile = sprintf("Icosahedron__1v_iter5-m-01.%03d", j)
       splot meshfile u 2:3:4 w l lw 1 lt 5, polyfile u 1:2:3 w l lw 1 lt 3
    }
    unset output
    
    #
    # Mode 2
    #
    set output 'mode2.webp'
    meshfile = "Icosahedron__1v_iter5_Results-msh"
    do for [i=0:50] {
       j = (i > 25) ? 50-i : i
       polyfile = sprintf("Icosahedron__1v_iter5-m-02.%03d", j)
       splot meshfile u 2:3:4 w l lw 1 lt 5, polyfile u 1:2:3 w l lw 1 lt 3
    }
    unset output
    
     

    Last edit: Ethan Merritt 2023-11-17
    • Eric Marceau

      Eric Marceau - 2023-11-18

      Hello again Ethan,

      I am going thru the configure process and finding that required packages
      are missing.  I installed all the ones the config.log stated were
      missing, but it is still not accepting to offer the webp as an option.

      libgd

      glib

      libwebp        0.6.1-2ubuntu0.20.04.3

      pango1-tools    1.44.7-2ubuntu4

      cairo

      But from the log files that I created from the "configure" run, it seems
      it is looking for other packages or versions which Ubuntu does not have
      ... at the UbuntuMATE 20.04 distro level.

      I plan to migrate to 24.04 when that comes out, but ugrading distro
      versions is always a pain, and prefer to skip both the non-LTS and
      everyother LTS distro.

      I may have to wait until the coming April/May to test with 24.04, but I
      have 23.04 installed on a second disk for verifying packages, so I will
      give it a try there some time soon (1-2 weeks).  I hope you can keep
      this request open/on-hold until then.

      Thank you for your guidance and assistance.

      Eric

      On 2023-11-17 00:55, Ethan Merritt wrote:

      [1] My version doesn't accept that option

      You'll have to take that up with Ubuntu, or ask for help on an Ubuntu
      forum. Or you could build from source. Current version is 5.4,
      released July 2020. Release of version 6 is imminent, release
      candidate 6.0.rc3 is available for testing. There are some contributed
      guidelines for building under Ubuntu in the INSTALL file of the
      version 6 source distribution package.

      [2] Solution Fulfills Needs

      Good to hear.

      [3] GIF option

      Yeah. Animated gifs were OK when it was mostly cartoon kitty icons
      waving a paw but they are not really suited for larger use. Also the
      library used to create them does lower-quality graphics than the newer
      terminals can produce.

      [4] Selective scope redirect ?

      Is there a way to limit which portions of the file are
      "redirected" to a
      webp file? Namely, can I set up such a WEBP creation only for each
      segment of the file (one each for the 6 resonance frequency simulation
      modes)? The file you provided lumped all 7 groupings into one video
      file. I will look at the documentation to see what I need to do,
      but if
      you have any examples that specifically show how to close a first
      redirect file and open a second/third/etc. target file would be very
      much appreciated.
      

      I didn't really look at your script in detail. I just ran it as-is
      after editing to read files from the current directory rather than
      /tmp. Here's a quick go at a script that creates a separate file for
      each mode. I may not understand the file naming system correctly but
      it does produce reasonable looking output. FWIW the run time was about
      2 seconds total for the two 50-frame animations.

      |set term web size 400,400 animate # # Mode 1 # set output
      'mode1.webp' meshfile = "Icosahedron__1v_iter5_Results-msh" do for
      [i=1:50] { j = (i > 25) ? 50-i : i polyfile =
      sprintf("Icosahedron__1v_iter5-m-01.%03d", j) splot meshfile u 2:3:4 w
      l lw 1 lt 5, polyfile u 1:2:3 w l lw 1 lt 3 } unset output # # Mode 2

      set output 'mode2.webp' meshfile =

      "Icosahedron__1v_iter5_Results-msh" do for [i=1:50] { j = (i > 25) ?
      50-i : i polyfile = sprintf("Icosahedron__1v_iter5-m-02.%03d", j)
      splot meshfile u 2:3:4 w l lw 1 lt 5, polyfile u 1:2:3 w l lw 1 lt 3 }
      unset output |

      Attachments:


      [feature-requests:#566]
      https://sourceforge.net/p/gnuplot/feature-requests/566/ Option to
      generate animation as video file (mpeg or mp4)

      Status: open
      Group:
      Created: Thu Nov 16, 2023 11:58 PM UTC by Eric Marceau
      Last Updated: Fri Nov 17, 2023 01:58 AM UTC
      Owner: nobody
      Attachments:

      Is it possible to expand Gnuplot's relevance by adding a built-in
      function to generate a mpeg or mp4 format file as an alternate to
      displaying the animation in a window?

      Such an option would permit the results of Gnuplot to be shared away
      from the environment/point of creation and present those results to a
      wider audience (in their more receptive mode/environment) when trying
      to communicate results from various research/analyses (i.e. Frame3DD
      animations of multiple structural analysis dynamic modal simulations).

      The attached plot instruction file (Icosahedron__1v_iter5_Results.plt)
      gives you an idea of the "script" file that calls upon a large number
      of data files (other files in the tar file) to create dynamic
      simulations of structure vibrational modes.

      Thank you,
      Eric Marceau, 68, retired
      member of Google Geodesic Help Group


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/gnuplot/feature-requests/566/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Feature Requests: #566

  • Ethan Merritt

    Ethan Merritt - 2023-11-18

    My apologies for providing misleading information. I had thought that the webp terminal was introduced sometime during the development of gnuplot version 5.4. But I was mistaken; it exists only in gnuplot 6, which has been the development version for some years. The first official release of version 6.0 is expected by the end of 2023.

    If you decide to try again at building from source, please use the release candidate for gnuplot 6
    https://sourceforge.net/projects/gnuplot/files/gnuplot/testing/gnuplot-6.0.rc3.tar.gz
    The INSTALL file has a section with hints for building on Ubuntu. I append the relevant section below.

    Ubuntu  
    ------   
      These instructions were tested on Ubuntu 22.04
    
      Install build tools, libraries, and documentation tools (TeX) for
      building gnuplot binary (5.4.2).
            sudo apt build-dep gnuplot
    
      Install additonal tools and libraries for development version
    
            sudo apt install gfortran libcerf-dev libwebp-dev adwaita-icon-theme-full \
                    unzip texlive-science
    
            # openspecfun provides the Amos routines (except for cexint)
            git clone https://github.com/JuliaMath/openspecfun.git
            cd openspecfun
            make
            sudo make install
    
      Debian packages required to configure with Qt5:
            qtbase5-dev
            qtbase5-dev-tools
            qttools5-dev-tools
            libqt5svg5-dev
    
      Add the below to ~/.profile
            export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
    
     
    • Eric Marceau

      Eric Marceau - 2023-11-19

      Thank you for replying, Ethan.

      Just an FYI, I did try to compile 6.0 RC3 but it did not allow the webp
      because it can't find, and I can't download, the necessary packages that
      it needs to build the cairo as precursor for webp.

      So ... I will live with what I have for now, as I said, until the spring
      when I can look at the new release of UbuntuMATE 24.04 .

      Thank you again for all your help and for contributing and making such a
      high-quality tool available to the general public.

      Eric

      On 2023-11-18 16:07, Ethan Merritt wrote:

      My apologies for providing misleading information. I had thought that
      the webp terminal was introduced sometime during the development of
      gnuplot version 5.4. But I was mistaken; it exists only in gnuplot 6,
      which has been the development version for some years. The first
      official release of version 6.0 is expected by the end of 2023.

      If you decide to try again at building from source, please use the
      release candidate for gnuplot 6
      https://sourceforge.net/projects/gnuplot/files/gnuplot/testing/gnuplot-6.0.rc3.tar.gz
      The INSTALL file has a section with hints for building on Ubuntu. I
      append the relevant section below.

      |Ubuntu------TheseinstructionsweretestedonUbuntu22.04
      Installbuildtools,libraries,anddocumentationtools(TeX)for
      buildinggnuplotbinary(5.4.2). sudoaptbuild-depgnuplot
      Installadditonaltoolsandlibrariesfordevelopmentversion
      sudoaptinstallgfortranlibcerf-devlibwebp-devadwaita-icon-theme-full\
      unziptexlive-science # openspecfun provides the Amos routines (except
      for cexint) gitclonehttps://github.com/JuliaMath/openspecfun.git
      cdopenspecfun make sudomakeinstall
      DebianpackagesrequiredtoconfigurewithQt5: qtbase5-dev
      qtbase5-dev-tools qttools5-dev-tools libqt5svg5-dev
      Addthebelowto~/.profile
      exportLD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib |


      [feature-requests:#566]
      https://sourceforge.net/p/gnuplot/feature-requests/566/ Option to
      generate animation as video file (mpeg or mp4)

      Status: open
      Group:
      Created: Thu Nov 16, 2023 11:58 PM UTC by Eric Marceau
      Last Updated: Fri Nov 17, 2023 05:55 AM UTC
      Owner: nobody
      Attachments:

      Is it possible to expand Gnuplot's relevance by adding a built-in
      function to generate a mpeg or mp4 format file as an alternate to
      displaying the animation in a window?

      Such an option would permit the results of Gnuplot to be shared away
      from the environment/point of creation and present those results to a
      wider audience (in their more receptive mode/environment) when trying
      to communicate results from various research/analyses (i.e. Frame3DD
      animations of multiple structural analysis dynamic modal simulations).

      The attached plot instruction file (Icosahedron__1v_iter5_Results.plt)
      gives you an idea of the "script" file that calls upon a large number
      of data files (other files in the tar file) to create dynamic
      simulations of structure vibrational modes.

      Thank you,
      Eric Marceau, 68, retired
      member of Google Geodesic Help Group


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/gnuplot/feature-requests/566/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Feature Requests: #566


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.