Jump to content

Making Time Lapse Videos with the Ultimaker 3


unlimitedbacon

Recommended Posts

  • 1 month later...
Posted (edited) · Making Time Lapse Videos with the Ultimaker 3

It an older topic, but in case someone don't want to use Python 3, it is really easy to "port" it to Python 2. There are only 4 lines to change and it runs well with Python 2.x.

 

Here is a diff of the changes:

7,8c7
< from six.moves import urllib
---
> from urllib.request import urlopen
76c75
<     response = urllib.request.urlopen(imgurl)
---
>     response = urlopen(imgurl)
78c77
<     f = open(filename,'wb')
---
>     f = open(filename,'bw')
81c80
<     print("Print progress: %s Image: %05i\r" % (progress(), count))
---
>     print("Print progress: %s Image: %05i" % (progress(), count), end='\r')

Edited by Smithy
Typo
  • Link to post
    Share on other sites

    • 10 months later...
    Posted · Making Time Lapse Videos with the Ultimaker 3

    From Windows command line:

    set PYTHONPATH=%PYTHONPATH%;C:\My_python_lib

    To set the PYTHONPATH permanently, add the line to your autoexec.bat. Alternatively, if you edit the system variable through the System Properties, it will also be changed permanently.

  • Link to post
    Share on other sites

    • 3 months later...
    Posted · Making Time Lapse Videos with the Ultimaker 3

    Hi all, and thanks @unlimitedbacon for this really nice script ! I managed to make it work without any issue but I'm new to python and I'm wondering how I could add a little pause at the end of the print, which means making a few additional snapshots once the print has ended. Any hint on how I could do that ?

    Many thanks.

    Tom

  • Link to post
    Share on other sites

    Posted · Making Time Lapse Videos with the Ultimaker 3

    Hello everyone,

     

    I tried this and did all the FFmpeg + python 3.8 and timelapse.py on the desktop, but after pressing enter on command prompt, nothing appears. Is there anything that I missed out?

     

    image.thumb.png.b3550b035b42cfaab792c56576c36c60.png

  • Link to post
    Share on other sites

    Posted · Making Time Lapse Videos with the Ultimaker 3
    22 hours ago, Xiaocong said:

    Hello everyone,

     

    I tried this and did all the FFmpeg + python 3.8 and timelapse.py on the desktop, but after pressing enter on command prompt, nothing appears. Is there anything that I missed out?

     

    image.thumb.png.b3550b035b42cfaab792c56576c36c60.png

     

    Seems to work for me using Python 3.5.2, are you able to try that?

  • Link to post
    Share on other sites

    Posted · Making Time Lapse Videos with the Ultimaker 3

    I managed to get it running on Python 3.8 and am printing now. Thanks for the help!

     

    I have 2 more questions:

    1) Must the PC be on during the whole duration of the printing?

    2) Where will the mp4 file be saved at? I presume desktop if I placed everything on desktop?

     

    Thanks in advance! 🙂

  • Link to post
    Share on other sites

    Posted · Making Time Lapse Videos with the Ultimaker 3
    2 hours ago, Xiaocong said:

    I managed to get it running on Python 3.8 and am printing now. Thanks for the help!

     

    I have 2 more questions:

    1) Must the PC be on during the whole duration of the printing?

    2) Where will the mp4 file be saved at? I presume desktop if I placed everything on desktop?

     

    Thanks in advance! 🙂

     

    Out of curiosity, how did you get it to work in the end?

     

    1) The script is running on your PC and listening for the host (your UM3), so yes your PC will need to be on. You could set it up on an external device (e.g. a pi) if you wanted. You would have to install ffmpeg first.

    2) Your argument when you run the script will determine where the outfile is saved to. So if you're in a command prompt window, it will save the to the current working directory, unless you specified an absolute path. Looking at your example above it would be: 

    C:\Users\HP_Demo\Desktop\xc.mp4

    Hope this helps.

  • Link to post
    Share on other sites

    Posted · Making Time Lapse Videos with the Ultimaker 3
    13 hours ago, maht said:

     

    Out of curiosity, how did you get it to work in the end?

     

    1) The script is running on your PC and listening for the host (your UM3), so yes your PC will need to be on. You could set it up on an external device (e.g. a pi) if you wanted. You would have to install ffmpeg first.

    2) Your argument when you run the script will determine where the outfile is saved to. So if you're in a command prompt window, it will save the to the current working directory, unless you specified an absolute path. Looking at your example above it would be: 

    
    C:\Users\HP_Demo\Desktop\xc.mp4

    Hope this helps.

     

    Thanks maht!

     

    Somehow I believe my python's "PATH" was not mapped so it could not understand my commands. So I tried to map it and it could work after that.

     

    Below is a short video of the timelapse test I did!

     

     

    Again, thanks for all the help! 😁

  • Link to post
    Share on other sites

    Guest maht
    Posted · Making Time Lapse Videos with the Ultimaker 3
    5 hours ago, Xiaocong said:

     

    Thanks maht!

     

    Somehow I believe my python's "PATH" was not mapped so it could not understand my commands. So I tried to map it and it could work after that.

     

    Below is a short video of the timelapse test I did!

     

     

    Again, thanks for all the help! 😁

     

    Looks like you're running it on an S5? Good to know it works on that too.

    If you're interested I made a fork of this code with a few small improvements. Still a WIP but feedback is welcome.

  • Link to post
    Share on other sites

    Posted · Making Time Lapse Videos with the Ultimaker 3
    On 5/1/2020 at 5:52 PM, maht said:

     

    Looks like you're running it on an S5? Good to know it works on that too.

    If you're interested I made a fork of this code with a few small improvements. Still a WIP but feedback is welcome.

    I am running it on an S3! and yes it works as well.

     

    Oh sure, could you send me the code? I will try it 😃

  • Link to post
    Share on other sites

    Guest maht
    Posted · Making Time Lapse Videos with the Ultimaker 3
    6 hours ago, Xiaocong said:

    I am running it on an S3! and yes it works as well.

     

    Oh sure, could you send me the code? I will try it 😃

     

    Ah, got it. Yes the link to the github repo is posted above, and also in your quote. Click "fork of this code" and it will take you there.

  • Link to post
    Share on other sites

    Posted · Making Time Lapse Videos with the Ultimaker 3
    8 minutes ago, maht said:

     

    Ah, got it. Yes the link to the github repo is posted above, and also in your quote. Click "fork of this code" and it will take you there.

     

    Thanks! I will try it and let you know 😃

  • Link to post
    Share on other sites

    Posted · Making Time Lapse Videos with the Ultimaker 3

    Can I use this with S3?

  • Link to post
    Share on other sites

    Posted · Making Time Lapse Videos with the Ultimaker 3
    On 7/3/2020 at 12:09 PM, Erkan3D said:

    Can I use this with S3?

    The camera location and the API hasn't changed so I would imagine yes...

  • Link to post
    Share on other sites

    Posted · Making Time Lapse Videos with the Ultimaker 3

    Is there any reason this can't be run on a Raspberry Pi 3 with a decent sized SD card installed?

     

    Also, it is something that can be left running all the time, so it creates a new video file every time the printer runs a job (perhaps incrementing the name by one digit)?  Or does it need to be run manually before you start every print job?

  • Link to post
    Share on other sites

    Posted · Making Time Lapse Videos with the Ultimaker 3

    Hi everyone,

    Does this still work with Cura 5.0?

    What's the best solution at the moment with Cura 5.0 to get a timelapse video of our prints?

    I do also have a Raspberry Pi 3B+ to hand.

    Thanks!

  • Link to post
    Share on other sites

    Posted · Making Time Lapse Videos with the Ultimaker 3

    Hey! I know this thread is FOUR years since last comment, but I wanted to comment for anybody still looking at this.

     

    The code still works on Python 3 on an Ultimaker S5 and Windows 11 in late 2022. I downloaded and installed everything today, and it's running beautifully right now.

     

    To answer Zaqi's question immediately previous (and four years ago...) yes, I had to do the "pip install" for the requests module, as described several times in earlier posts in this thread. I hope Zaqi found the answer. 🙂

     

    I will also echo comments from other places on the Internet -- it would sure be great if this were integrated natively into Cura. We have cameras built into the printers -- why not use them? All people would do is market for you, with this capability!

    • Like 1
    Link to post
    Share on other sites

    Posted (edited) · Making Time Lapse Videos with the Ultimaker 3

    Trying to run this on a Raspberry Pi 3B+

     

    Installed Python 3.11.0

    Installed x264

    Installed FFMPEG

     

    Can't get it to run using "sudo python timelapse.py 192.168.0.39 60 timelapse.mp4"

     

    get invalid syntax error on line 80 

    Quote

    print("Print progress: %s Image: %05i" % (progress(),count), end='\r' )

     

    I have already started the print though so could be reason why

    Edited by cdrose
  • Link to post
    Share on other sites

    Posted · Making Time Lapse Videos with the Ultimaker 3

    Hello! trying to run this, very new to python in general, but I think I've got it working. I'm trying to follow the instructions, but keep getting issues with the IP address. any ideas? running on windows 11, python 3.12, ultimaker s5

    Screenshot 2023-12-04 143502.png

  • Link to post
    Share on other sites

    Posted (edited) · Making Time Lapse Videos with the Ultimaker 3

    UPDATE: I got it!! just had to type "pip install requests" in cmd prompts, and then the full string command worked!

     

    quick rundown for anyone still struggling on windows:

     

    -download python

    -download ffmpeg

    -download timelapse.py

    -download ultimaker api (unsure if this is required, but just to be safe)

    -move python exe, ffmpeg exe, and timelapse.py to the same folder.

    (worked for me with just these files, I didn't have to move any extraneous folders or files)

    -open command prompt from the start menu

    -Navigate to the correct folder in command prompt by copying file path from the top bar in the file explorer, then type: cd <filepath> into CMD Prompt

    -type pip install requests to make sure python is up to date and ready

     

    Running the script post-install/setup:

    -Open cmd prompt

    -Navigate to folder by copying the file path and typing: cd <filepath>

    -Type command as follows:

    python timelapse.py HOST DELAY OUTFILE

    Replace HOST text with IP address of printer. 

    Replace DELAY text with desired rate of capture, in seconds. 30 will take a photo every 30 seconds, etc.

    Replace OUTFILE text with the desired resulting video file name. e.g. timelapse.mp4.

     

    -It will wait for the printer to start, and tell you where it’s saving images to the local app folder. -It does take images while setting up print and heating up, and during any pauses in print.

    -The computer must stay on and running during entire duration of print, cura does not have to be running at all. 

    -Once completed, the video will be saved in the same file location as the code. 

    -If it’s not opening in QuickTime, media player, or any other basic players, open in VLC or Premiere and save out again.

    Edited by catalanostaff
    more info for future readers
    • Like 1
    Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    • Our picks

      • UltiMaker Cura 5.7 stable released
        Cura 5.7 is here and it brings a handy new workflow improvement when using Thingiverse and Cura together, as well as additional capabilities for Method series printers, and a powerful way of sharing print settings using new printer-agnostic project files! Read on to find out about all of these improvements and more. 
         
          • Like
        • 7 replies
      • S-Line Firmware 8.3.0 was released Nov. 20th on the "Latest" firmware branch.
        (Sorry, was out of office when this released)

        This update is for...
        All UltiMaker S series  
        New features
         
        Temperature status. During print preparation, the temperatures of the print cores and build plate will be shown on the display. This gives a better indication of the progress and remaining wait time. Save log files in paused state. It is now possible to save the printer's log files to USB if the currently active print job is paused. Previously, the Dump logs to USB option was only enabled if the printer was in idle state. Confirm print removal via Digital Factory. If the printer is connected to the Digital Factory, it is now possible to confirm the removal of a previous print job via the Digital Factory interface. This is useful in situations where the build plate is clear, but the operator forgot to select Confirm removal on the printer’s display. Visit this page for more information about this feature.
          • Like
        • 0 replies
    ×
    ×
    • Create New...