Search

Octolapse 수동설치

3D 프린터 2020. 10. 24. 14:08 Posted by 파란크리스마스

출처

Octolapse 삭제

pi@raspberrypi:~$ cd OctoPrint/
pi@raspberrypi:~/OctoPrint$ virtualenv venv
Running virtualenv with interpreter /usr/bin/python2
New python executable in /home/pi/OctoPrint/venv/bin/python2
Not overwriting existing python script /home/pi/OctoPrint/venv/bin/python (you must use /home/pi/OctoPrint/venv/bin/python2)
Installing setuptools, pkg_resources, pip, wheel...done.   
pi@raspberrypi:~/OctoPrint$ source venv/bin/activate
(venv) pi@raspberrypi:~/OctoPrint$ python -m pip --disable-pip-version-check uninstall --yes Octolapse

Octolapse 수동설치

(venv) pi@raspberrypi:~/OctoPrint$ python -m pip --disable-pip-version-check install Octolapse-0.4.0_bluexmas.zip --no-cache-dir
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Processing ./Octolapse-0.4.0_bluexmas.zip
 
.. 생략 ...
 
Building wheels for collected packages: Octolapse
  Building wheel for Octolapse (setup.py) ... done
  Created wheel for Octolapse: filename=Octolapse-0.4.0-cp27-cp27mu-linux_armv7l.whl size=3286578 sha256=92dba105ebe1509fc92147d973c662e914c5aef344c766796d299cc63021f969
  Stored in directory: /tmp/pip-ephem-wheel-cache-jiQcsm/wheels/a7/32/ae/c12a39393ef08ef1772f53f0f469c4b6140d8be700083e7d5e
Successfully built Octolapse
Installing collected packages: Octolapse
Successfully installed Octolapse-0.4.0

__init__.py

@functools.total_ordering
class NumberedVersion(version.LooseVersion):
    # This is the current plugin version, not including any versioneer info,
    # which could be earlier or later
    CurrentVersion = "0.4.0(bluexmas)"
    # This is the CurrentVersion last time the settings were migrated.
    CurrentSettingsVersion = "0.4.0(bluexmas)"

render.py

    def _delete_snapshots_for_job(
        self, temporary_directory, job_guid, camera_guid,
        progress_callback=None, progress_key='delete_snapshots', progress_current_step=None, progress_total_steps=None
    ):
        with self.temp_files_lock:
            # get the two snapshot paths, one for the job, one for the camera
            job_path = utility.get_temporary_snapshot_job_path(temporary_directory, job_guid)
            camera_path = utility.get_temporary_snapshot_job_camera_path(temporary_directory, job_guid, camera_guid)
            logger.debug("Deleting all snapshot images at: %s", camera_path)

    def _render(self):
        """Process the timelapse render job and report progress"""

        try:

        finally:
            # Start cleanup of rendering/snapshot files

            # delete the temp rendering file if it exists.
            if os.path.isfile(temp_filepath):
                try:
                    utility.remove(temp_filepath)
                except (OSError, IOError):
                    logger.exception("Could not delete a temporary rendering file!")
                    pass

            # bluexmas - snapshot 삭제하는 곳
            if delete_snapshots:


    def _clear_temporary_files(
        self, progress_key='deleting_temp_files', progress_current_step=None, progress_total_steps=None,
        delete_folder=True
    ):
        """Delete all temporary rendering files, and report progress."""
        logger.debug("Cleaning all temporary rendering files.")

확인

OctoLapse 로그

2020-10-24 06:46:10,102 - octolapse.timelapse - DEBUG - Sent: G0 X96.557 Y97.579 2020-10-24 06:46:10,221 - octolapse.timelapse - DEBUG - Setting job-on-hold lock. 2020-10-24 06:46:10,223 - octolapse.timelapse - DEBUG - Sent: G0 X97.209 Y97.28 2020-10-24 06:46:10,224 - octolapse.timelapse - INFO - About to take a snapshot. Triggering Command: G1 X99.01 Y99.335 E1795.27793 2020-10-24 06:46:10,228 - octolapse.stabilization_gcode - INFO - Triggered at line: 183289 by gcode: G1 X99.01 Y99.335 E1795.27793 2020-10-24 06:46:10,229 - octolapse.stabilization_gcode - INFO - Snapshot Gcode (Tool: 1):^M Init - G1 X99.01 Y99.335 E1795.27793^M Start - M83^M Start - G1 E-5.00000 F2700.000^M Snapshot - G0 X217.800 Y217.800 F12000.000^M Take Snapshot - @OCTOLAPSE TAKE-SNAPSHOT^M Return - G0 X99.010 Y99.335^M End - G1 E5.00000 F2700.000^M End - M82^M End - G1 F922.500 2020-10-24 06:46:10,231 - octolapse.timelapse - INFO - Queuing 1 initialization commands. 2020-10-24 06:46:10,233 - octolapse.timelapse - DEBUG - Snapshot gcode INIT - queuing: G1 X99.01 Y99.335 E1795.27793 2020-10-24 06:46:10,234 - octolapse.timelapse - INFO - Queuing 2 start commands. 2020-10-24 06:46:10,236 - octolapse.timelapse - DEBUG - Snapshot gcode START - queuing: M83 2020-10-24 06:46:10,239 - octolapse.timelapse - DEBUG - Snapshot gcode START - queuing: G1 E-5.00000 F2700.000 2020-10-24 06:46:10,240 - octolapse.timelapse - DEBUG - Queuing 1 snapshot commands, an M400 and an M114 command. Note that the actual snapshot command is never sent. 2020-10-24 06:46:10,241 - octolapse.timelapse - INFO - Octolapse is requesting a position. 2020-10-24 06:46:10,246 - octolapse.timelapse - DEBUG - Snapshot gcode SNAPSHOT - queuing: G0 X217.800 Y217.800 F12000.000 2020-10-24 06:46:10,251 - octolapse.timelapse - DEBUG - Waiting for moves to complete before continuing - queuing: M400 2020-10-24 06:46:10,252 - octolapse.timelapse - DEBUG - Sent: G0 X97.208 Y97.559 2020-10-24 06:46:10,254 - octolapse.timelapse - DEBUG - Waiting for moves to complete before continuing - queuing: M114 2020-10-24 06:46:10,283 - octolapse.timelapse - DEBUG - Sent: G1 F922.5 X99.01 Y97.561 E1795.21892 2020-10-24 06:46:10,289 - octolapse.timelapse - DEBUG - Snapshot gcode INIT - sent: G1 X99.01 Y99.335 E1795.27793 2020-10-24 06:46:10,301 - octolapse.timelapse - DEBUG - Snapshot gcode START - sent: M83 2020-10-24 06:46:10,304 - octolapse.timelapse - DEBUG - Snapshot gcode START - sent: G1 E-5.00000 F2700.000 2020-10-24 06:46:10,317 - octolapse.timelapse - DEBUG - Snapshot gcode SNAPSHOT - sent: G0 X217.800 Y217.800 F12000.000 2020-10-24 06:46:10,339 - octolapse.timelapse - DEBUG - Waiting for moves to complete before continuing - sent: M400 2020-10-24 06:46:13,162 - octolapse.timelapse - DEBUG - The position request is being sent 2020-10-24 06:46:13,163 - octolapse.timelapse - DEBUG - Waiting for moves to complete before continuing - sent: M114 2020-10-24 06:46:13,165 - octolapse.timelapse - INFO - Octolapse has received a position request response. 2020-10-24 06:46:13,182 - octolapse.timelapse - INFO - Taking a snapshot. 2020-10-24 06:46:13,183 - octolapse.snapshot - INFO - Starting snapshot acquisition 2020-10-24 06:46:13,185 - octolapse.snapshot - INFO - Starting 1 snapshot threads. 2020-10-24 06:46:13,186 - octolapse.snapshot - INFO - Snapshot Delay - Waiting 0.125 second(s) after executing the snapshot script for the Webcam - Default OctoPi 0.16.0 camera. 2020-10-24 06:46:13,312 - octolapse.snapshot - DEBUG - Snapshot - downloading for the Webcam - Default OctoPi 0.16.0 camera from http://bluesanta.iptime.org:4996/?action=snapshot. 2020-10-24 06:46:13,737 - octolapse.snapshot - DEBUG - Snapshot - snapshot downloaded for the Webcam - Default OctoPi 0.16.0 camera in 0.425 seconds. 2020-10-24 06:46:13,738 - octolapse.snapshot - DEBUG - Post-processing snapshot for the Webcam - Default OctoPi 0.16.0 camera. 2020-10-24 06:46:13,741 - octolapse.snapshot - INFO - Snapshot threads complete, but may be post-processing. 2020-10-24 06:46:13,741 - octolapse.snapshot - INFO - Snapshot acquisition completed in 0.557 seconds. 2020-10-24 06:46:13,742 - octolapse.timelapse - INFO - Queuing 1 return commands. 2020-10-24 06:46:13,743 - octolapse.timelapse - DEBUG - Snapshot gcode RETURN - queuing: G0 X99.010 Y99.335 2020-10-24 06:46:13,744 - octolapse.timelapse - INFO - Queuing 3 end commands. 2020-10-24 06:46:13,747 - octolapse.timelapse - DEBUG - Snapshot gcode RETURN - sent: G0 X99.010 Y99.335 2020-10-24 06:46:13,748 - octolapse.timelapse - DEBUG - Snapshot gcode END - queuing: G1 E5.00000 F2700.000 2020-10-24 06:46:13,750 - octolapse.timelapse - DEBUG - Snapshot gcode END - queuing: M82 2020-10-24 06:46:13,754 - octolapse.timelapse - DEBUG - Snapshot gcode END - queuing: G1 F922.500 2020-10-24 06:46:13,755 - octolapse.timelapse - INFO - The snapshot has completed 2020-10-24 06:46:13,757 - octolapse.timelapse - INFO - Sending on_snapshot_complete payload. 2020-10-24 06:46:13,757 - octolapse.timelapse - DEBUG - Snapshot gcode END - sent: G1 E5.00000 F2700.000 2020-10-24 06:46:13,764 - octolapse.timelapse - DEBUG - Snapshot gcode END - sent: M82 2020-10-24 06:46:13,766 - octolapse.timelapse - DEBUG - Releasing job-on-hold lock. 2020-10-24 06:46:13,772 - octolapse.timelapse - DEBUG - Snapshot gcode END - sent: G1 F922.500 2020-10-24 06:46:13,776 - octolapse.timelapse - DEBUG - Sent: G1 X95.845 Y99.335 E1795.3832 2020-10-24 06:46:13,784 - octolapse.timelapse - DEBUG - Sent: G1 X95.985 Y99.3 E1795.388 2020-10-24 06:46:13,809 - octolapse.timelapse - DEBUG - Sent: G1 X96.265 Y99.176 E1795.39818 2020-10-24 06:46:13,816 - octolapse.snapshot - DEBUG - Snapshot - Snapshot saved to disk for the Webcam - Default OctoPi 0.16.0 camera at /home/pi/.octoprint/data/octolapse/tmp/octolapse_snapshots_tmp/083d4ba3-e1e1-46d9-a778-a6b89cf5a3e2/354def78-9eea-409a-ad23-ee966dfff4ba/CE5_3D_Printer_test_fixed_stl_3rd_gen000299.jpg 2020-10-24 06:46:13,834 - octolapse.timelapse - DEBUG - Sent: G1 X96.515 Y99.013 E1795.40811 2020-10-24 06:46:13,838 - octolapse.timelapse - DEBUG - Sent: G1 X96.743 Y98.8 E1795.41848 2020-10-24 06:46:13,841 - octolapse.timelapse - DEBUG - Sent: G1 X96.916 Y98.578 E1795.42785 ... 생략 ... 2020-10-24 06:46:13,953 - octolapse.timelapse - DEBUG - Sent: G0 X95.774 Y98.682 2020-10-24 06:46:13,956 - octolapse.timelapse - DEBUG - Sent: G0 X95.252 Y98.736 2020-10-24 06:46:14,220 - octolapse.snapshot - DEBUG - Post-processing snapshot for the Webcam - Default OctoPi 0.16.0 camera complete. 2020-10-24 06:46:14,225 - octolapse.snapshot - INFO - Snapshot Download Job completed for the Webcam - Default OctoPi 0.16.0 camera in 0.913 seconds. 2020-10-24 06:46:15,025 - octolapse.timelapse - DEBUG - Sent: G0 X92.881 Y98.735 2020-10-24 06:46:15,157 - octolapse.timelapse - DEBUG - Sent: G0 X91.024 Y98.586 ... 생략 ... 2020-10-24 06:46:28,055 - octolapse.timelapse - DEBUG - Sent: G1 X96.515 Y98.978 E1798.61655 2020-10-24 06:46:28,076 - octolapse.timelapse - DEBUG - Sent: G1 X96.745 Y98.764 E1798.627 2020-10-24 06:46:28,093 - octolapse.timelapse - DEBUG - Setting job-on-hold lock. 2020-10-24 06:46:28,095 - octolapse.timelapse - INFO - About to take a snapshot. Triggering Command: G1 X99.01 Y99.263 E1798.72229 2020-10-24 06:46:28,096 - octolapse.timelapse - DEBUG - Sent: G1 X96.796 Y98.696 E1798.62983 2020-10-24 06:46:28,099 - octolapse.stabilization_gcode - INFO - Triggered at line: 183619 by gcode: G1 X99.01 Y99.263 E1798.72229 2020-10-24 06:46:28,100 - octolapse.stabilization_gcode - INFO - Snapshot Gcode (Tool: 1):^M Init - G1 X99.01 Y99.263 E1798.72229^M Start - M83^M Start - G1 E-5.00000 F2700.000^M Snapshot - G0 X217.800 Y217.800 F12000.000^M Take Snapshot - @OCTOLAPSE TAKE-SNAPSHOT^M Return - G0 X99.010 Y99.263^M End - G1 E5.00000 F2700.000^M End - M82^M End - G1 F600.000 2020-10-24 06:46:28,101 - octolapse.timelapse - INFO - Queuing 1 initialization commands. 2020-10-24 06:46:28,102 - octolapse.timelapse - DEBUG - Snapshot gcode INIT - queuing: G1 X99.01 Y99.263 E1798.72229 2020-10-24 06:46:28,103 - octolapse.timelapse - INFO - Queuing 2 start commands. 2020-10-24 06:46:28,104 - octolapse.timelapse - DEBUG - Snapshot gcode START - queuing: M83 2020-10-24 06:46:28,106 - octolapse.timelapse - DEBUG - Snapshot gcode START - queuing: G1 E-5.00000 F2700.000 2020-10-24 06:46:28,108 - octolapse.timelapse - DEBUG - Queuing 1 snapshot commands, an M400 and an M114 command. Note that the actual snapshot command is never sent. 2020-10-24 06:46:28,109 - octolapse.timelapse - INFO - Octolapse is requesting a position. 2020-10-24 06:46:28,110 - octolapse.timelapse - DEBUG - Snapshot gcode SNAPSHOT - queuing: G0 X217.800 Y217.800 F12000.000 2020-10-24 06:46:28,112 - octolapse.timelapse - DEBUG - Waiting for moves to complete before continuing - queuing: M400 2020-10-24 06:46:28,115 - octolapse.timelapse - DEBUG - Sent: G1 X99.01 Y98.697 E1798.70346 2020-10-24 06:46:28,116 - octolapse.timelapse - DEBUG - Waiting for moves to complete before continuing - queuing: M114 2020-10-24 06:46:28,119 - octolapse.timelapse - DEBUG - Snapshot gcode INIT - sent: G1 X99.01 Y99.263 E1798.72229 2020-10-24 06:46:28,142 - octolapse.timelapse - DEBUG - Snapshot gcode START - sent: M83 2020-10-24 06:46:28,146 - octolapse.timelapse - DEBUG - Snapshot gcode START - sent: G1 E-5.00000 F2700.000 2020-10-24 06:46:28,154 - octolapse.timelapse - DEBUG - Snapshot gcode SNAPSHOT - sent: G0 X217.800 Y217.800 F12000.000 2020-10-24 06:46:28,175 - octolapse.timelapse - DEBUG - Waiting for moves to complete before continuing - sent: M400 2020-10-24 06:46:31,154 - octolapse.timelapse - DEBUG - The position request is being sent 2020-10-24 06:46:31,156 - octolapse.timelapse - DEBUG - Waiting for moves to complete before continuing - sent: M114 2020-10-24 06:46:31,157 - octolapse.timelapse - INFO - Octolapse has received a position request response. 2020-10-24 06:46:31,190 - octolapse.timelapse - INFO - Taking a snapshot. 2020-10-24 06:46:31,192 - octolapse.snapshot - INFO - Starting snapshot acquisition 2020-10-24 06:46:31,194 - octolapse.snapshot - INFO - Starting 1 snapshot threads. 2020-10-24 06:46:31,194 - octolapse.snapshot - INFO - Snapshot Delay - Waiting 0.125 second(s) after executing the snapshot script for the Webcam - Default OctoPi 0.16.0 camera. 2020-10-24 06:46:31,320 - octolapse.snapshot - DEBUG - Snapshot - downloading for the Webcam - Default OctoPi 0.16.0 camera from http://bluesanta.iptime.org:4996/?action=snapshot. 2020-10-24 06:46:31,718 - octolapse.snapshot - DEBUG - Snapshot - snapshot downloaded for the Webcam - Default OctoPi 0.16.0 camera in 0.398 seconds. 2020-10-24 06:46:31,719 - octolapse.snapshot - DEBUG - Post-processing snapshot for the Webcam - Default OctoPi 0.16.0 camera. 2020-10-24 06:46:31,720 - octolapse.snapshot - INFO - Snapshot threads complete, but may be post-processing. 2020-10-24 06:46:31,721 - octolapse.snapshot - INFO - Snapshot acquisition completed in 0.528 seconds. 2020-10-24 06:46:31,721 - octolapse.timelapse - INFO - Queuing 1 return commands. 2020-10-24 06:46:31,722 - octolapse.timelapse - DEBUG - Snapshot gcode RETURN - queuing: G0 X99.010 Y99.263 2020-10-24 06:46:31,725 - octolapse.timelapse - INFO - Queuing 3 end commands. 2020-10-24 06:46:31,726 - octolapse.timelapse - DEBUG - Snapshot gcode END - queuing: G1 E5.00000 F2700.000 2020-10-24 06:46:31,728 - octolapse.timelapse - DEBUG - Snapshot gcode END - queuing: M82 2020-10-24 06:46:31,732 - octolapse.timelapse - DEBUG - Snapshot gcode END - queuing: G1 F600.000 2020-10-24 06:46:31,734 - octolapse.timelapse - DEBUG - Snapshot gcode RETURN - sent: G0 X99.010 Y99.263 2020-10-24 06:46:31,735 - octolapse.timelapse - INFO - The snapshot has completed 2020-10-24 06:46:31,742 - octolapse.timelapse - DEBUG - Snapshot gcode END - sent: G1 E5.00000 F2700.000 2020-10-24 06:46:31,743 - octolapse.timelapse - INFO - Sending on_snapshot_complete payload. 2020-10-24 06:46:31,750 - octolapse.timelapse - DEBUG - Snapshot gcode END - sent: M82 2020-10-24 06:46:31,755 - octolapse.timelapse - DEBUG - Releasing job-on-hold lock. 2020-10-24 06:46:31,756 - octolapse.snapshot - DEBUG - Snapshot - Snapshot saved to disk for the Webcam - Default OctoPi 0.16.0 camera at /home/pi/.octoprint/data/octolapse/tmp/octolapse_snapshots_tmp/083d4ba3-e1e1-46d9-a778-a6b89cf5a3e2/354def78-9eea-409a-ad23-ee966dfff4ba/CE5_3D_Printer_test_fixed_stl_3rd_gen000300.jpg 2020-10-24 06:46:31,756 - octolapse.timelapse - DEBUG - Snapshot gcode END - sent: G1 F600.000 2020-10-24 06:46:31,761 - octolapse.timelapse - DEBUG - Sent: G0 F12000 X99.29 Y99.263 2020-10-24 06:46:31,764 - octolapse.timelapse - DEBUG - Sent: G0 X99.218 Y98.489 2020-10-24 06:46:31,772 - octolapse.timelapse - DEBUG - Sent: G0 X96.689 Y98.481 ... 생략 ... 2020-10-24 06:46:31,982 - octolapse.timelapse - DEBUG - Sent: G0 X89.757 Y99.263 2020-10-24 06:46:32,190 - octolapse.snapshot - DEBUG - Post-processing snapshot for the Webcam - Default OctoPi 0.16.0 camera complete. 2020-10-24 06:46:32,191 - octolapse.snapshot - INFO - Snapshot Download Job completed for the Webcam - Default OctoPi 0.16.0 camera in 0.870 seconds. 2020-10-24 06:46:33,003 - octolapse.timelapse - DEBUG - Sent: G1 F600 X85.99 Y99.263 E1799.03251 2020-10-24 06:46:33,143 - octolapse.timelapse - DEBUG - Sent: G1 X85.99 Y98.697 E1799.05134 2020-10-24 06:46:33,157 - octolapse.timelapse - DEBUG - Sent: G1 X88.85 Y98.693 E1799.14646 ... 생략 ... 2020-10-24 06:46:43,265 - octolapse.timelapse - DEBUG - Sent: M140 S0 2020-10-24 06:46:43,335 - octolapse.timelapse - DEBUG - Sent: M84 X Y E 2020-10-24 06:46:43,366 - octolapse.timelapse - INFO - Snapshot jobs queue has completed, starting to render. 2020-10-24 06:46:43,378 - octolapse.__init__ - INFO - Adding new rendering job. JobGuid: 083d4ba3-e1e1-46d9-a778-a6b89cf5a3e2, CameraGuid: 354def78-9eea-409a-ad23-ee966dfff4ba 2020-10-24 06:46:43,383 - octolapse.__init__ - INFO - Print completed successfullly. 2020-10-24 06:46:43,385 - octolapse.__init__ - INFO - The print has ended. 2020-10-24 06:46:43,471 - octolapse.render - INFO - Sending render start message 2020-10-24 06:46:43,475 - octolapse.render - INFO - Setting output paths. 2020-10-24 06:46:43,477 - octolapse.render - INFO - Rendering is enabled for camera 354def78-9eea-409a-ad23-ee966dfff4ba. 2020-10-24 06:46:43,478 - octolapse.render - DEBUG - Converting and copying images to the temporary rendering folder 2020-10-24 06:46:43,636 - octolapse.snapshot - DEBUG - Post-processing snapshot for the Webcam - Default OctoPi 0.16.0 camera complete. 2020-10-24 06:46:43,637 - octolapse.snapshot - INFO - Snapshot Download Job completed for the Webcam - Default OctoPi 0.16.0 camera in 0.937 seconds. 2020-10-24 06:47:33,918 - octolapse.render - DEBUG - Reading snapshot metadata from /home/pi/.octoprint/data/octolapse/tmp/octolapse_snapshots_tmp/083d4ba3-e1e1-46d9-a778-a6b89cf5a3e2/354def78-9eea-409a-ad23-ee966dfff4ba/metadata.csv 2020-10-24 06:47:33,926 - octolapse.render - INFO - FPS Calculation Type:static, Fps:60 2020-10-24 06:47:33,930 - octolapse.render - INFO - Creating the directory at /home/pi/.octoprint/timelapse 2020-10-24 06:47:33,934 - octolapse.render - DEBUG - Renaming images. 2020-10-24 06:47:34,758 - octolapse.render - INFO - Adding 120 pre-roll frames. 2020-10-24 06:47:53,872 - octolapse.render - INFO - Adding 120 post-roll frames. 2020-10-24 06:48:18,097 - octolapse.render - INFO - Renaming images because pre-roll images were added. 2020-10-24 06:48:18,815 - octolapse.render - INFO - Pre/post roll generated successfully. 2020-10-24 06:48:18,816 - octolapse.render - DEBUG - Applying video filter chain: [f0] format=yuv420p [out] 2020-10-24 06:48:18,816 - octolapse.render - DEBUG - Rendering movie to /home/pi/.octoprint/data/octolapse/tmp/octolapse_rendering_tmp/2f7f2af7-2373-49b0-8369-fa2f2af6fa21.tmp 2020-10-24 06:48:18,817 - octolapse.render - INFO - Running ffmpeg. 2020-10-24 06:48:18,818 - octolapse.script - DEBUG - Executing Unknown with No Timeout timeout: /usr/local/bin/ffmpeg -framerate 60 -loglevel info -i /home/pi/.octoprint/data/octolapse/tmp/octolapse_rendering_tmp/CE5_3D_Printer_test_fixed_stl_3rd_gen%06d.jpg -threads 1 -r 60 -y -vcodec mpeg4 -f mp4 -b:v 10000k -vf "[f0] format=yuv420p [out]" /home/pi/.octoprint/data/octolapse/tmp/octolapse_rendering_tmp/2f7f2af7-2373-49b0-8369-fa2f2af6fa21.tmp 2020-10-24 06:48:20,786 - octolapse.script - INFO - stderr: ffmpeg version N-99482-g214998c55f Copyright (c) 2000-2020 the FFmpeg developers 2020-10-24 06:48:20,789 - octolapse.script - INFO - stderr: built with gcc 8 (Raspbian 8.3.0-6+rpi1) 2020-10-24 06:48:20,793 - octolapse.script - INFO - stderr: configuration: --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-version3 --extra-ldflags=-latomic 2020-10-24 06:48:20,802 - octolapse.script - INFO - stderr: libavutil 56. 60.100 / 56. 60.100 2020-10-24 06:48:20,803 - octolapse.script - INFO - stderr: libavcodec 58.109.100 / 58.109.100 2020-10-24 06:48:20,805 - octolapse.script - INFO - stderr: libavformat 58. 61.100 / 58. 61.100 2020-10-24 06:48:20,807 - octolapse.script - INFO - stderr: libavdevice 58. 11.102 / 58. 11.102 2020-10-24 06:48:20,808 - octolapse.script - INFO - stderr: libavfilter 7. 87.100 / 7. 87.100 2020-10-24 06:48:20,810 - octolapse.script - INFO - stderr: libswscale 5. 8.100 / 5. 8.100 2020-10-24 06:48:20,811 - octolapse.script - INFO - stderr: libswresample 3. 8.100 / 3. 8.100 2020-10-24 06:48:20,813 - octolapse.script - INFO - stderr: libpostproc 55. 8.100 / 55. 8.100 2020-10-24 06:48:21,028 - octolapse.script - INFO - stderr: Input #0, image2, from '/home/pi/.octoprint/data/octolapse/tmp/octolapse_rendering_tmp/CE5_3D_Printer_test_fixed_stl_3rd_gen%06d.jpg': 2020-10-24 06:48:21,029 - octolapse.script - INFO - stderr: Duration: 00:00:09.03, start: 0.000000, bitrate: N/A 2020-10-24 06:48:21,030 - octolapse.script - INFO - stderr: Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 3280x2464, 60 tbr, 60 tbn, 60 tbc 2020-10-24 06:48:21,033 - octolapse.script - INFO - stderr: Stream mapping: 2020-10-24 06:48:21,034 - octolapse.script - INFO - stderr: Stream #0:0 -> #0:0 (mjpeg (native) -> mpeg4 (native)) 2020-10-24 06:48:21,035 - octolapse.script - INFO - stderr: Press [q] to stop, [?] for help 2020-10-24 06:48:21,327 - octolapse.script - INFO - stderr: [swscaler @ 0x2045f80] deprecated pixel format used, make sure you did set range correctly 2020-10-24 06:48:21,648 - octolapse.script - INFO - stderr: Output #0, mp4, to '/home/pi/.octoprint/data/octolapse/tmp/octolapse_rendering_tmp/2f7f2af7-2373-49b0-8369-fa2f2af6fa21.tmp': 2020-10-24 06:48:21,649 - octolapse.script - INFO - stderr: Metadata: 2020-10-24 06:48:21,650 - octolapse.script - INFO - stderr: encoder : Lavf58.61.100 2020-10-24 06:48:21,651 - octolapse.script - INFO - stderr: Stream #0:0: Video: mpeg4 (mp4v / 0x7634706D), yuv420p, 3280x2464, q=2-31, 10000 kb/s, 60 fps, 15360 tbn, 60 tbc 2020-10-24 06:48:21,652 - octolapse.script - INFO - stderr: Metadata: 2020-10-24 06:48:21,653 - octolapse.script - INFO - stderr: encoder : Lavc58.109.100 mpeg4 2020-10-24 06:48:21,654 - octolapse.script - INFO - stderr: Side data: 2020-10-24 06:48:21,655 - octolapse.script - INFO - stderr: cpb: bitrate max/min/avg: 0/0/10000000 buffer size: 0 vbv_delay: N/A 2020-10-24 06:48:23,035 - octolapse.script - INFO - stderr: frame= 2 fps=0.0 q=2.0 size= 768kB time=00:00:00.01 bitrate=376034.4kbits/s speed=0.0169x ... 생략 ... 2020-10-24 06:55:28,637 - octolapse.script - INFO - stderr: frame= 542 fps=1.3 q=31.0 size= 13568kB time=00:00:09.01 bitrate=12327.0kbits/s speed=0.0211x 2020-10-24 06:55:28,640 - octolapse.script - INFO - stderr: frame= 542 fps=1.3 q=31.0 Lsize= 13592kB time=00:00:09.01 bitrate=12348.7kbits/s speed=0.0211x 2020-10-24 06:55:28,641 - octolapse.script - INFO - stderr: video:13589kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.024478% 2020-10-24 06:55:28,719 - octolapse.render - DEBUG - Deleting all snapshot images at: /home/pi/.octoprint/data/octolapse/tmp/octolapse_snapshots_tmp/083d4ba3-e1e1-46d9-a778-a6b89cf5a3e2/354def78-9eea-409a-ad23-ee966dfff4ba 2020-10-24 06:55:29,767 - octolapse.render - DEBUG - Cleaning all temporary rendering files. 2020-10-24 06:55:30,683 - octolapse.render - INFO - Sending render complete message 2020-10-24 06:55:33,552 - octolapse.render - INFO - Cleaning temporary snapshot folders at /home/pi/.octoprint/data/octolapse/tmp. 2020-10-24 06:55:33,560 - octolapse.render - INFO - Cleaning temporary snapshot folders at /home/pi/.octoprint/data/octolapse/tmp. 2020-10-24 06:55:33,561 - octolapse.render - INFO - Sending render end message

댓글을 달아 주세요

Ender 5 : OctoLapse 설정

3D 프린터 2020. 10. 4. 21:41 Posted by 파란크리스마스

출처

OctoLapse 플러그인 추가

OctoLapse Ender 5 설정

카메라가 앞쪽에 있으므로 해더가 뒤쪽 오른쪽(Back Right)으로 이동 후 캡쳐하도록 설정

Cura 설정

G코드 추가

; Script based on an original created by tjjfvi (https://github.com/tjjfvi)
; An up-to-date version of the tjjfvi's original script can be found
; here:  https://csi.t6.fyi/
; Note - This script will only work in Cura V4.2 and above!
; --- Global Settings
; layer_height = {layer_height}
; smooth_spiralized_contours = {smooth_spiralized_contours}
; magic_mesh_surface_mode = {magic_mesh_surface_mode}
; machine_extruder_count = {machine_extruder_count}
; --- Single Extruder Settings
; speed_z_hop = {speed_z_hop}
; retraction_amount = {retraction_amount}
; retraction_hop = {retraction_hop}
; retraction_hop_enabled = {retraction_hop_enabled}
; retraction_enable = {retraction_enable}
; retraction_speed = {retraction_speed}
; retraction_retract_speed = {retraction_retract_speed}
; retraction_prime_speed = {retraction_prime_speed}
; speed_travel = {speed_travel}

댓글을 달아 주세요

OctoPrint : 설정

3D 프린터 2020. 10. 3. 12:51 Posted by 파란크리스마스

출처

환영메시지

[Next] 버튼 선택

이전 설정값 복원

이전 설정값 파일이 없으므로, [Next] 버튼 선택

Linux 터미널 가능한 사용자 설정

Username, Password 입력하고 [Keep Access Control Enable] 버튼을 선택하고, [Next] 버튼 선택

[Enable Anonymous Usage Tracking] 버튼을 선택하고, [Next] 버튼 선택

[Enable Connectivity Check] 버튼을 선택하고, [Next] 버튼 선택

[Enable Plugin Blacklist Processing] 버튼을 선택하고, [Next] 버튼 선택

3D 프린터 설정

Name, Model을 입력하고 [Print bed bduild volume] 선택

Width, Depth, Height 값을 입력하고, [Axes] 선택

  • Width : 220
  • Depth : 220
  • Height : 300

특별하게 설정 없이, [Hotend & extruder] 선택

[Next] 버튼 선택

서버 명령 설정

Restart OctoPrint, Restart system, Shutdown system 값을 입력하고, [Next] 버튼 선택

  • Restart OctoPrint : sudo service octoprint restart
  • Restart system : sudo shutdown -r now
  • Shutdown system : sudo shutdown -h now

웹캠, 타임랩스 저장 설정

Stream URL 입력하고, [Test] 버튼 선택

Stream test 창에서 카메라의 영상을 확인하고, [Close] 버튼 선택

Snapshot URL 입력하고, [Test] 버튼 선택

Snapshot test 창에서 카메라의 이미지를 확인하고, [Close] 버튼 선택

Path to FFMPEG 입력하고, [Test] 버튼 선택

The path is valid 메시지 확인 하고, [Next] 버튼 선택

모든 설정을 마무리하고, [Finish] 버튼 선택

설정된 값을 적용하고 초기화 하기 위해서 [Reload now] 버튼 선택

댓글을 달아 주세요

OctoPrint : 수동설치

3D 프린터 2020. 10. 3. 12:46 Posted by 파란크리스마스

출처

OS 업데이트

$ sudo apt-get update $ sudo apt-get upgrade

파이썬 설치

OctoPrint 는 파이썬 환경에서 실행되므로 파이썬을 설치합니다.

$ sudo apt-get install python-pip python-dev python-setuptools python-virtualenv git libyaml-dev build-essential

OctoPrint 설치

OctoPrint 작업 디렉토리 생성

$ mkdir OctoPrint

OctoPrint 가상환경 생성, pip 최신버전으로 업그레이드

pi@raspberrypi:~$ cd OctoPrint
pi@raspberrypi:~/OctoPrint$ virtualenv venv
Running virtualenv with interpreter /usr/bin/python2
New python executable in /home/pi/OctoPrint/venv/bin/python2
Also creating executable in /home/pi/OctoPrint/venv/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
pi@raspberrypi:~/OctoPrint$ source venv/bin/activate
(venv) pi@raspberrypi:~/OctoPrint$ pip install pip --upgrade

OctoPrint 설치

(venv) pi@raspberrypi:~/OctoPrint$ pip install https://get.octoprint.org/latest
  
<생략>
 
Successfully built OctoPrint markupsafe tornado regex Flask-Babel Flask-Assets cachelib PyYAML watchdog sarge netifaces pylru psutil feedparser future wrapt emoji frozendict blinker scandir chainmap webassets pathtools
Installing collected packages: OctoPrint-FirmwareCheck, OctoPrint-FileCheck, markupsafe, futures, six, singledispatch, backports-abc, tornado, markdown, pyasn1, rsa, regex, Click, werkzeug, itsdangerous, Jinja2, flask, Flask-Login, pytz, Babel, Flask-Babel, webassets, Flask-Assets, cachelib, PyYAML, pyserial, contextlib2, scandir, pathlib2, typing, zipp, importlib-resources, netaddr, pathtools, watchdog, sarge, netifaces, pylru, pkginfo, urllib3, certifi, chardet, idna, requests, semantic-version, psutil, feedparser, future, websocket-client, wrapt, emoji, frozendict, sentry-sdk, filetype, unidecode, blinker, monotonic, chainmap, OctoPrint
Successfully installed Babel-2.8.0 Click-7.1.2 Flask-Assets-2.0 Flask-Babel-1.0.0 Flask-Login-0.5.0 Jinja2-2.11.2 OctoPrint-1.4.2 OctoPrint-FileCheck-2020.8.7 OctoPrint-FirmwareCheck-2020.9.23 PyYAML-5.3.1 backports-abc-0.5 blinker-1.4 cachelib-0.1.1 certifi-2020.6.20 chainmap-1.0.3 chardet-3.0.4 contextlib2-0.6.0.post1 emoji-0.6.0 feedparser-5.2.1 filetype-1.0.7 flask-1.1.2 frozendict-1.2 future-0.18.2 futures-3.3.0 idna-2.10 importlib-resources-3.0.0 itsdangerous-1.1.0 markdown-3.1.1 markupsafe-1.1.1 monotonic-1.5 netaddr-0.8.0 netifaces-0.10.9 pathlib2-2.3.5 pathtools-0.1.2 pkginfo-1.5.0.1 psutil-5.7.2 pyasn1-0.4.8 pylru-1.2.0 pyserial-3.4 pytz-2020.1 regex-2020.9.27 requests-2.24.0 rsa-4.0 sarge-0.1.5.post0 scandir-1.10.0 semantic-version-2.8.5 sentry-sdk-0.18.0 singledispatch-3.4.0.3 six-1.15.0 tornado-5.1.1 typing-3.7.4.3 unidecode-0.4.21 urllib3-1.25.10 watchdog-0.10.3 webassets-2.0 websocket-client-0.57.0 werkzeug-1.0.1 wrapt-1.12.1 zipp-1.2.0

pi 계정 권한 변경

pi 계정에 터미널과 시리얼 접근권한을 추가해서 옥토프린트가 3D 프린터를 컨트롤할 수 있도록 합니다.

pi@raspberrypi:~$ sudo usermod -a -G tty pi
pi@raspberrypi:~$ sudo usermod -a -G dialout pi

OctoPrint 서버 수동실행

pi@raspberrypi:~$ ~/OctoPrint/venv/bin/octoprint serve
2020-10-07 01:47:15,436 - octoprint.startup - INFO - ******************************************************************************
2020-10-07 01:47:15,438 - octoprint.startup - INFO - Starting OctoPrint 1.4.2
2020-10-07 01:47:15,438 - octoprint.startup - INFO - ******************************************************************************
2020-10-07 01:47:15,444 - octoprint.util.connectivity.connectivity_checker - INFO - Connectivity state is currently: online
2020-10-07 01:47:15,445 - octoprint.util.connectivity.connectivity_checker - INFO - Connecting to 8.8.8.8:53 is working
2020-10-07 01:47:15,446 - octoprint.util.connectivity.connectivity_checker - INFO - Resolving octoprint.org is working
 
<생략>
 
2020-10-07 01:47:17,481 - octoprint.environment - INFO - Detected environment is Python 2.7.16 under Linux (linux2). Details:
|  hardware:
|      cores: 4
|      freq: 1500.0
|      ram: 3960000512
|  os:
|      id: linux
|      platform: linux2
|  plugins:
|      pi_support:
|          model: Raspberry Pi 4 Model B Rev 1.1
|  python:
|      pip: 20.2.3
|      version: 2.7.16
|      virtualenv: /home/pi/OctoPrint/venv
 
<생략>
 

OctoPrint 접속

OctoPrint 서버 자동실행

pi@raspberrypi:~$ wget https://github.com/foosel/OctoPrint/raw/master/scripts/octoprint.init
pi@raspberrypi:~$ sudo mv octoprint.init /etc/init.d/octoprint
pi@raspberrypi:~$ wget https://github.com/foosel/OctoPrint/raw/master/scripts/octoprint.default
pi@raspberrypi:~$ sudo mv octoprint.default /etc/default/octoprint
pi@raspberrypi:~$ sudo chmod +x /etc/init.d/octoprint

OctoPrint 서비스 등록

$ sudo update-rc.d octoprint defaults

OctoPrint 서버 환경설정 (/etc/default/octoprint)

pi@raspberrypi:~$ vi /etc/default/octoprint

16번줄의 DAEMON 앞에 주석(#)를 제거, DAEMON 파일 경로도 정확한지 확인하고 저장합니다.

# Configuration for /etc/init.d/octoprint

# The init.d script will only run if this variable non-empty.
OCTOPRINT_USER=pi

# base directory to use
#BASEDIR=/home/pi/.octoprint

# configuration file to use
#CONFIGFILE=/home/pi/.octoprint/config.yaml

# On what port to run daemon, default is 5000
PORT=5000

# Path to the OctoPrint executable, you need to set this to match your installation!
DAEMON=/home/pi/OctoPrint/venv/bin/octoprint

# What arguments to pass to octoprint, usually no need to touch this
DAEMON_ARGS="--port=$PORT"

# Umask of files octoprint generates, Change this to 000 if running octoprint as its own, separate user
UMASK=022

# Process priority, 0 here will result in a priority 20 process.
# -2 ensures Octoprint has a slight priority over user processes.
NICELEVEL=-2

# Should we run at startup?
START=yes

댓글을 달아 주세요

OctoPrint : FFMpeg 설치

3D 프린터 2020. 10. 3. 02:50 Posted by 파란크리스마스

출처

기존에 설치되어 있는 ffmpeg 삭제, ffmpeg 컴파일 관련 패키지 설치

pi@raspberrypi:~$ sudo apt-get remove ffmpeg x264 libav-tools libvpx-dev libx264-dev yasm
pi@raspberrypi:~$ sudo apt-get update
pi@raspberrypi:~$ sudo apt-get -y install autoconf automake build-essential checkinstall git libass-dev \
   libgpac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libspeex-dev \
   libtheora-dev libtool libvorbis-dev pkg-config texi2html zlib1g-dev

yasm 소스 다운로드, 컴파일

pi@raspberrypi:~$ mkdir ~/workspace.ffmpeg
pi@raspberrypi:~$ cd ~/workspace.ffmpeg
pi@raspberrypi:~/workspace.ffmpeg$ wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
pi@raspberrypi:~/workspace.ffmpeg$ tar xzvf yasm-1.2.0.tar.gz && cd yasm-1.2.0
pi@raspberrypi:~/workspace.ffmpeg/yasm-1.2.0$ ./configure && make
pi@raspberrypi:~/workspace.ffmpeg/yasm-1.2.0$ sudo make install

lame 소스 다운로드, 컴파일

pi@raspberrypi:~$ cd ~/workspace.ffmpeg
pi@raspberrypi:~/workspace.ffmpeg$ wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.tar.gz
pi@raspberrypi:~/workspace.ffmpeg$ tar xzvf lame-3.99.tar.gz && cd lame-3.99
pi@raspberrypi:~/workspace.ffmpeg/lame-3.99$ ./configure && make
pi@raspberrypi:~/workspace.ffmpeg/lame-3.99$ sudo make install

faac 소스 다운로드, 컴파일 (ffmpeg가 최신버전의 경우 불필요한 라이브러리)

pi@raspberrypi:~$ cd ~/workspace.ffmpeg
pi@raspberrypi:~/workspace.ffmpeg$ wget https://sourceforge.net/projects/faac/files/faac-src/faac-1.29/faac-1.29.9.2.tar.gz
pi@raspberrypi:~/workspace.ffmpeg$ tar xzvf faac-1.29.9.2.tar.gz && cd faac-1.29.9.2
pi@raspberrypi:~/workspace.ffmpeg/faac-1.29.9.2$ ./configure && make
pi@raspberrypi:~/workspace.ffmpeg/faac-1.29.9.2$ sudo make install

fdk-aac 소스 다운로드, 컴파일

pi@raspberrypi:~$ cd ~/workspace.ffmpeg
pi@raspberrypi:~/workspace.ffmpeg$ git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git
pi@raspberrypi:~/workspace.ffmpeg$ cd fdk-aac/
pi@raspberrypi:~/workspace.ffmpeg/fdk-aac$ autoreconf -fiv
pi@raspberrypi:~/workspace.ffmpeg/fdk-aac$ ./configure --disable-shared
pi@raspberrypi:~/workspace.ffmpeg/fdk-aac$ make
pi@raspberrypi:~/workspace.ffmpeg/fdk-aac$ sudo make install

H264 소스 다운로드, 컴파일

pi@raspberrypi:~$ cd ~/workspace.ffmpeg
pi@raspberrypi:~/workspace.ffmpeg$ git clone https://code.videolan.org/videolan/x264.git
pi@raspberrypi:~/workspace.ffmpeg$ cd x264
pi@raspberrypi:~/workspace.ffmpeg/x264$ ./configure --enable-static
platform:       ARM
byte order:     little-endian
system:         LINUX
cli:            yes
libx264:        internal
shared:         no
static:         yes
bashcompletion: yes
asm:            yes
interlaced:     yes
avs:            avxsynth
lavf:           no
ffms:           no
mp4:            no
gpl:            yes
thread:         posix
opencl:         yes
filters:        crop select_every
lto:            no
debug:          no
gprof:          no
strip:          no
PIC:            no
bit depth:      all
chroma format:  all
 
You can run 'make' or 'make fprofiled' now.
pi@raspberrypi:~/workspace.ffmpeg/x264$ make
pi@raspberrypi:~/workspace.ffmpeg/x264$ sudo make install
install -d /usr/local/bin
install x264 /usr/local/bin
install -d /usr/local/include /usr/local/lib/pkgconfig
install -m 644 ./x264.h x264_config.h /usr/local/include
install -m 644 x264.pc /usr/local/lib/pkgconfig
install -d /usr/local/lib
install -m 644 libx264.a /usr/local/lib
gcc-ranlib /usr/local/lib/libx264.a
install -d /usr/share/bash-completion/completions
install -m 644 -T ./tools/bash-autocomplete.sh /usr/share/bash-completion/completions/x264

ffmpeg 소스 다운로드, 컴파일

pi@raspberrypi:~$ cd ~/workspace.ffmpeg
pi@raspberrypi:~/workspace.ffmpeg$ git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
pi@raspberrypi:~/workspace.ffmpeg$ cd ffmpeg
pi@raspberrypi:~/workspace.ffmpeg/ffmpeg$ ./configure --extra-libs="-ldl" --enable-gpl --enable-libass --enable-libfdk-aac \
   --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libspeex --enable-libtheora \
   --enable-libvorbis --enable-libx264 --enable-nonfree --enable-version3 --extra-ldflags="-latomic"
pi@raspberrypi:~/workspace.ffmpeg/ffmpeg$ make
pi@raspberrypi:~/workspace.ffmpeg/ffmpeg$ sudo make install

ffmpeg 명령 - 이미지 추출

pi@raspberrypi:~$ ffmpeg -f video4linux2 -i /dev/video0 -r 10 -f image2 camera%03d.jpg
ffmpeg version N-99456-g45070eec4c Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 8 (Raspbian 8.3.0-6+rpi1)
  configuration: --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-version3 --extra-ldflags=-latomic
  libavutil      56. 60.100 / 56. 60.100
  libavcodec     58.108.100 / 58.108.100
  libavformat    58. 59.100 / 58. 59.100
  libavdevice    58. 11.102 / 58. 11.102
  libavfilter     7. 87.100 /  7. 87.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 48460.801672, bitrate: 36864 kb/s
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 640x480, 36864 kb/s, 10 fps, 10 tbr, 1000k tbn, 1000k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0x2944ec0] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to 'camera%03d.jpg':
  Metadata:
    encoder         : Lavf58.59.100
    Stream #0:0: Video: mjpeg, yuvj420p(pc), 640x480, q=2-31, 200 kb/s, 10 fps, 10 tbn, 10 tbc
    Metadata:
      encoder         : Lavc58.108.100 mjpeg
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
frame=   24 fps= 10 q=24.8 Lsize=N/A time=00:00:02.40 bitrate=N/A speed=1.02x    
video:404kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Exiting normally, received signal 2.

확인

pi@raspberrypi:~$ ls camera*.jpg
camera001.jpg  camera005.jpg  camera009.jpg  camera013.jpg  camera017.jpg  camera021.jpg
camera002.jpg  camera006.jpg  camera010.jpg  camera014.jpg  camera018.jpg  camera022.jpg
camera003.jpg  camera007.jpg  camera011.jpg  camera015.jpg  camera019.jpg  camera023.jpg
camera004.jpg  camera008.jpg  camera012.jpg  camera016.jpg  camera020.jpg  camera024.jpg

ffmpeg 명령 - flv 포멧으로 동영상 저장

pi@raspberrypi:~$ ffmpeg -f video4linux2 -i /dev/video0 -f flv out.flv
ffmpeg version N-99456-g45070eec4c Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 8 (Raspbian 8.3.0-6+rpi1)
  configuration: --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-version3 --extra-ldflags=-latomic
  libavutil      56. 60.100 / 56. 60.100
  libavcodec     58.108.100 / 58.108.100
  libavformat    58. 59.100 / 58. 59.100
  libavdevice    58. 11.102 / 58. 11.102
  libavfilter     7. 87.100 /  7. 87.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 48635.919862, bitrate: 36864 kb/s
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 640x480, 36864 kb/s, 10 fps, 10 tbr, 1000k tbn, 1000k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> flv1 (flv))
Press [q] to stop, [?] for help
Output #0, flv, to 'out.flv':
  Metadata:
    encoder         : Lavf58.59.100
    Stream #0:0: Video: flv1 (flv) ([2][0][0][0] / 0x0002), yuv420p, 640x480, q=2-31, 200 kb/s, 10 fps, 1k tbn, 10 tbc
    Metadata:
      encoder         : Lavc58.108.100 flv
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
frame=   46 fps= 10 q=14.1 size=     256kB time=00:00:04.50 bitrate= 465.9kbits/s speed=0.988x   frame=   51 fps= 10 q=19.0 size=     256kB time=00:00:05.00 bitrate= 419.3kbits/s speed=0.989x   frame=   54 fps= 10 q=20.0 Lsize=     346kB time=00:00:05.30 bitrate= 535.2kbits/s speed=0.989x    
video:345kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.304310%
Exiting normally, received signal 2.

ffmpeg 명령 - mp4 파일로 저장

pi@raspberrypi:~$ ffmpeg -f video4linux2 -i /dev/video0 -s 640x480 -r 25 -f mpeg out.mp4
ffmpeg version N-99456-g45070eec4c Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 8 (Raspbian 8.3.0-6+rpi1)
  configuration: --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-version3 --extra-ldflags=-latomic
  libavutil      56. 60.100 / 56. 60.100
  libavcodec     58.108.100 / 58.108.100
  libavformat    58. 59.100 / 58. 59.100
  libavdevice    58. 11.102 / 58. 11.102
  libavfilter     7. 87.100 /  7. 87.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 49109.741243, bitrate: 36864 kb/s
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 640x480, 36864 kb/s, 10 fps, 10 tbr, 1000k tbn, 1000k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg1video (native))
Press [q] to stop, [?] for help
[mpeg @ 0x22224d0] VBV buffer size not set, using default size of 230KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer size
Output #0, mpeg, to 'out.mp4':
  Metadata:
    encoder         : Lavf58.59.100
    Stream #0:0: Video: mpeg1video, yuv420p, 640x480, q=2-31, 200 kb/s, 25 fps, 90k tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.108.100 mpeg1video
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
frame=   14 fps=0.0 q=8.3 size=     130kB time=00:00:00.44 bitrate=2420.3kbits/s dup=8 drop=0 speframe=   27 fps= 26 q=8.1 size=     162kB time=00:00:00.96 bitrate=1382.4kbits/s dup=16 drop=0 spframe=   39 fps= 25 q=10.5 size=     192kB time=00:00:01.44 bitrate=1092.3kbits/s dup=23 drop=0 sframe=   52 fps= 25 q=11.9 size=     224kB time=00:00:01.96 bitrate= 936.2kbits/s dup=31 drop=0 sframe=   59 fps= 25 q=9.8 Lsize=     232kB time=00:00:02.28 bitrate= 833.6kbits/s dup=35 drop=0 speed=0.948x    
video:229kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.153889%
Exiting normally, received signal 2.

댓글을 달아 주세요

OctoPrint : mjpg-streamer 설치

3D 프린터 2020. 10. 3. 01:44 Posted by 파란크리스마스

출처

MJPG streamer 컴파일 관련 라이브러리 설치

pi@raspberrypi:~$ sudo apt update
pi@raspberrypi:~$ sudo apt upgrade 
pi@raspberrypi:~$ sudo apt-get install cmake libjpeg8-dev imagemagick libv4l-dev

MJPG streamer 소스 다운로드, 컴파일, 설치

pi@raspberrypi:~$ git clone https://github.com/jacksonliam/mjpg-streamer.git
pi@raspberrypi:~$ cd mjpg-streamer/mjpg-streamer-experimental/
pi@raspberrypi:~/mjpg-streamer/mjpg-streamer-experimental$ make
pi@raspberrypi:~/mjpg-streamer/mjpg-streamer-experimental$ sudo make install

LD_LIBRARY_PATH 경로 추가

pi@raspberrypi:~$ echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/lib:/usr/local/lib/mjpg-streamer" | sudo tee -a /etc/profile

MJPG Streamer 수동 실행

출처 : MJPG Streamer configuration

pi@raspberrypi:~$ mjpg_streamer -i "input_raspicam.so -x 640 -y 480 -fps 10 -rot 180 -ex night" --output "output_http.so -w /usr/local/share/mjpg-streamer/www --port 4998"
MJPG Streamer Version: git rev: 85f89a8c321e799fabb1693c5d133f3fb48ee748
 i: fps.............: 10
 i: resolution........: 640 x 480
 i: camera parameters..............:

Sharpness 0, Contrast 0, Brightness 50
Saturation 0, ISO 0, Video Stabilisation No, Exposure compensation 0
Exposure Mode 'night', AWB Mode 'auto', Image Effect 'none'
Metering Mode 'average', Colour Effect Enabled No with U = 128, V = 128
Rotation 180, hflip No, vflip No
ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000
 o: www-folder-path......: /usr/local/share/mjpg-streamer/www/
 o: HTTP TCP port........: 4998
 o: HTTP Listen Address..: (null)
 o: username:password....: disabled
 o: commands.............: enabled
 i: Starting Camera
Encoder Buffer Size 81920

서비스등록

pi@raspberrypi:~$ sudo vi /etc/init.d/mjpg_streamer

mjpg_streamer 파일 내용

#!/bin/bash
# /etc/init.d/mjpg_streamer.sh
# v0.2 phillips321.co.uk
### BEGIN INIT INFO
# Provides:          mjpg_streamer.sh
# Required-Start:    $network
# Required-Stop:     $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: mjpg_streamer for webcam
# Description:       Streams /dev/video0 to http://IP/?action=stream
### END INIT INFO

#
export width=640
export height=480
export bitrate=10
export SHUTDOWN_WAIT=2

if [ -n "$2" ]; then
  width=$2 
fi

if [ -n "$3" ]; then
  height=$3
fi

if [ -n "$4" ]; then
  bitrate=$4
fi

export LD_MJPG_STREAMER=/usr/local/lib/mjpg-streamer

f_message(){
        echo "[+] $1"
}

mjpg_streamer_pid() {
  echo `ps aux | grep mjpg-streamer | grep -v grep | awk '{ print $2 }'`
}

start() {
  pid=$(mjpg_streamer_pid)
  if [ -n "$pid" ] 
  then
    echo "mjpg_streamer is already running (pid: $pid)"
  else
    # Start mjpg_streamer
		f_message "Starting mjpg_streamer"
		mjpg_streamer -b -i "$LD_MJPG_STREAMER/input_uvc.so -r "$width"x"$height" -f $bitrate -y" -o "$LD_MJPG_STREAMER/output_http.so -p 4998 -w /usr/local/share/mjpg-streamer/www"
		sleep 2
		f_message "mjpg_streamer started"
  fi

  return 0
}

stop() {
  pid=$(mjpg_streamer_pid)
  if [ -n "$pid" ]
  then
    f_message "Stopping mjpg_streamer..."
    kill -9 $pid

    let kwait=$SHUTDOWN_WAIT
    let count=0;
    until [ `ps -p $pid | grep -c $pid` = '0' ] || [ $count -gt $kwait ]
    do
      echo -n -e "\nwaiting for processes to exit";
      sleep 1
      let count=$count+1;
    done

    if [ $count -gt $kwait ]; then
      echo -n -e "\nkilling processes which didn't stop after $SHUTDOWN_WAIT seconds\n"
      kill -9 $pid
    fi
  else
    echo "mjpg_streamer is not running"
  fi
 
  return 0
}

# Carry out specific functions when asked to by the system
case "$1" in
        start)
                 start
                 ;;
        stop)
                 stop
                 ;;
        restart)
                 stop
                 sleep 2
                 start
                 ;;
        resolution)
                resolution=`ps axu | grep mjpg-streamer | grep -v grep | awk '{ print $16 }'`
                if [ -n "$resolution" ];
                then
                        echo "${resolution}"
                else
                        echo "0x0"
                fi
                ;;
        status)
                pid=`ps -A | grep mjpg_streamer | grep -v "grep" | grep -v mjpg_streamer. | awk '{print $1}' | head -n 1`
                if [ -n "$pid" ];
                then
                        f_message "mjpg_streamer is running with pid ${pid}"
                        f_message "mjpg_streamer was started with the following command line"
                        cat /proc/${pid}/cmdline ; echo ""
                else
                        f_message "Could not find mjpg_streamer running"
                fi
                ;;
        *)
                f_message "Usage: $0 {start|stop|status|restart}"
                exit 1
                ;;
esac
exit 0

등록

pi@raspberrypi:~$ sudo chmod u+x /etc/init.d/mjpg_streamer
pi@raspberrypi:~$ sudo update-rc.d mjpg_streamer defaults

서비스 실행 및 실행 확인

pi@raspberrypi:~$ sudo service mjpg_streamer start
pi@raspberrypi:~$ sudo service mjpg_streamer status
● mjpg_streamer.service - LSB: mjpg_streamer for webcam
   Loaded: loaded (/etc/init.d/mjpg_streamer; generated)
   Active: active (running) since Fri 2020-10-02 18:06:59 BST; 16s ago
     Docs: man:systemd-sysv-generator(8)
    Tasks: 3 (limit: 1942)
   CGroup: /system.slice/mjpg_streamer.service
           └─4761 mjpg_streamer -b -i /usr/local/lib/mjpg-streamer/input_uvc.so -r 640x480 -f 10 -y -o /usr/local/lib/mjpg-streamer/output_http.so -p 4998 -w /usr/local/share/mjpg-streamer/www
 
Oct 02 18:06:57 raspberrypi mjpg_streamer[4761]: MJPG-streamer [4761]: TV-Norm...........: DEFAULT
Oct 02 18:06:57 raspberrypi mjpg_streamer[4761]: MJPG-streamer [4761]: www-folder-path......: /usr/local/share/mjpg-streamer/www/
Oct 02 18:06:57 raspberrypi mjpg_streamer[4761]: MJPG-streamer [4761]: HTTP TCP port........: 4998
Oct 02 18:06:57 raspberrypi mjpg_streamer[4761]: MJPG-streamer [4761]: HTTP Listen Address..: (null)
Oct 02 18:06:57 raspberrypi mjpg_streamer[4761]: MJPG-streamer [4761]: username:password....: disabled
Oct 02 18:06:57 raspberrypi mjpg_streamer[4761]: MJPG-streamer [4761]: commands.............: enabled
Oct 02 18:06:57 raspberrypi mjpg_streamer[4761]: MJPG-streamer [4761]: starting input plugin /usr/local/lib/mjpg-streamer/input_uvc.so
Oct 02 18:06:57 raspberrypi mjpg_streamer[4761]: MJPG-streamer [4761]: starting output plugin: /usr/local/lib/mjpg-streamer/output_http.so (ID: 00)
Oct 02 18:06:59 raspberrypi mjpg_streamer[4751]: [+] mjpg_streamer started
Oct 02 18:06:59 raspberrypi systemd[1]: Started LSB: mjpg_streamer for webcam.

확인

GPU 매모리 늘리기

pi@raspberrypi:~ $ sudo raspi-config

댓글을 달아 주세요

OctoPrint : 라즈베리파이 카메라 활성화

3D 프린터 2020. 10. 2. 00:54 Posted by 파란크리스마스

출처

라즈베리파이 카메라 활성화

pi@raspberrypi:~ $ sudo raspi-config

카메라 테스트(캡쳐)

pi@raspberrypi:~$ raspistill -v -o test.jpg
 
"raspistill" Camera App (commit f97b1af1b3e6 Tainted)
 
Camera Name imx219
Width 3280, Height 2464, filename test.jpg
Using camera 0, sensor mode 0
 
GPS output Disabled
 
Quality 85, Raw no
Thumbnail enabled Yes, width 64, height 48, quality 35
Time delay 5000, Timelapse 0
Link to latest frame enabled  no
Full resolution preview No
Capture method : Single capture
 
Preview Yes, Full screen Yes
Preview window 0,0,1024,768
Opacity 255
Sharpness 0, Contrast 0, Brightness 50
Saturation 0, ISO 0, Video Stabilisation No, Exposure compensation 0
Exposure Mode 'auto', AWB Mode 'auto', Image Effect 'none'
Flicker Avoid Mode 'off'
Metering Mode 'average', Colour Effect Enabled No with U = 128, V = 128
Rotation 0, hflip No, vflip No
ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000
Camera component done
Encoder component done
Starting component connection stage
Connecting camera preview port to video render.
Connecting camera stills port to encoder input port
Opening output file test.jpg
Enabling encoder output port
Starting capture -1
Finished capture -1
Closing down
Close down completed, all components disconnected, disabled and destroyed

댓글을 달아 주세요