<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/">
  <channel>
    <title>3dprint on Reticulated</title>
    <link>https://reticulated.net/tags/3dprint/</link>
    <description>Recent content in 3dprint on Reticulated</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Sat, 13 Apr 2024 12:37:52 +0000</lastBuildDate><atom:link href="https://reticulated.net/tags/3dprint/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Making the Ideal 3d Printer Montioring Live-Stream</title>
      <media>https://reticulated.net/posts/making-the-ideal-3d-printer-montioring-live-stream/img/hero.png</media>
      <link>https://reticulated.net/posts/making-the-ideal-3d-printer-montioring-live-stream/</link>
      <pubDate>Sat, 13 Apr 2024 12:37:52 +0000</pubDate>
      
      <guid>https://reticulated.net/posts/making-the-ideal-3d-printer-montioring-live-stream/</guid>
      <description>Using Youtube, RTMP and Monaserver to make a better 3d Printing Monitor</description>
      <content:encoded><![CDATA[<p><img src="/posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413081445_hub962f233def60c5ff03cd31d42c92e2a_256215_1170x0_resize_q82_h2_lanczos_3.webp#centered" srcset="/posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413081445_hub962f233def60c5ff03cd31d42c92e2a_256215_720x0_resize_q82_h2_lanczos_3.webp#centered 720w, /posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413081445_hub962f233def60c5ff03cd31d42c92e2a_256215_1080x0_resize_q82_h2_lanczos_3.webp#centered 1080w, /posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413081445_hub962f233def60c5ff03cd31d42c92e2a_256215_1170x0_resize_q82_h2_lanczos_3.webp#centered 1170w" sizes="(min-width: 768px) 720px, 100vw"
    width="1170" height="662"
    alt=""
     class="responsive-image"
    loading="lazy" decoding="async">
<a href="https://youtube.com/clip/Ugkx3QuuC1uODjsebCsx8K3bDsb1YEk1Z5_2?si=XVJA3OMjSWB-fs-C">See a clip of the monitor in action here!</a></p>
<h2 id="the-octoprint-problem">The Octoprint Problem</h2>
<p>I don&rsquo;t know exactly how long I&rsquo;ve been using Octoprint to manage my 3d printers, but I can&rsquo;t remember a time I had a printer and didn&rsquo;t use Octoprint.</p>
<p>It&rsquo;s a fantastic piece of software for everything 3dprint related with one glaring exception &ndash; Live camera monitoring.</p>
<p><img src="/posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413085002_hu459acd715f6bb95315c97cbd79ad8fa5_55228_1286x0_resize_q82_h2_lanczos_3.webp#centered" srcset="/posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413085002_hu459acd715f6bb95315c97cbd79ad8fa5_55228_720x0_resize_q82_h2_lanczos_3.webp#centered 720w, /posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413085002_hu459acd715f6bb95315c97cbd79ad8fa5_55228_1080x0_resize_q82_h2_lanczos_3.webp#centered 1080w, /posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413085002_hu459acd715f6bb95315c97cbd79ad8fa5_55228_1286x0_resize_q82_h2_lanczos_3.webp#centered 1286w" sizes="(min-width: 768px) 720px, 100vw"
    width="1286" height="818"
    alt=""
     class="responsive-image"
    loading="lazy" decoding="async"></p>
<p>Octoprint&rsquo;s live monitoring only supports cameras like Picam, that serve a URL you can poll and get an Mjpeg. While I have half a dozen cameras laying around the house, none of them support this.</p>
<p>Disclaimer: I have not yet moved to Klipper but it is on the list and I&rsquo;m aware will probably solve some of these problems (and/or make new ones)</p>
<div class="sib-form" style="text-align: center;
background-color: transparent;                                 ">
<div id="sib-form-container" class="sib-form-container">
<div id="error-message" class="sib-form-message-panel" style="font-size:16px; text-align:left; font-family:&quot;Helvetica&quot;, sans-serif; color:#661d1d; background-color:#ffeded; border-radius:3px; border-color:#ff4949;max-width:540px;">
<div class="sib-form-message-panel__text sib-form-message-panel__text--center">
<svg viewBox="0 0 512 512" class="sib-icon sib-notification__icon">
 <path d="M256 40c118.621 0 216 96.075 216 216 0 119.291-96.61 216-216 216-119.244 0-216-96.562-216-216 0-119.203 96.602-216 216-216m0-32C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm-11.49 120h22.979c6.823 0 12.274 5.682 11.99 12.5l-7 168c-.268 6.428-5.556 11.5-11.99 11.5h-8.979c-6.433 0-11.722-5.073-11.99-11.5l-7-168c-.283-6.818 5.167-12.5 11.99-12.5zM256 340c-15.464 0-28 12.536-28 28s12.536 28 28 28 28-12.536 28-28-12.536-28-28-28z" />
</svg>
<span class="sib-form-message-panel__inner-text">
                 Something went wrong
             </span>
</div>
</div>
<div></div>
<div id="success-message" class="sib-form-message-panel" style="font-size:16px; text-align:left; font-family:&quot;Helvetica&quot;, sans-serif; color:#085229; background-color:#e7faf0; border-radius:3px; border-color:#13ce66;max-width:540px;">
<div class="sib-form-message-panel__text sib-form-message-panel__text--center">
<svg viewBox="0 0 512 512" class="sib-icon sib-notification__icon">
 <path d="M256 8C119.033 8 8 119.033 8 256s111.033 248 248 248 248-111.033 248-248S392.967 8 256 8zm0 464c-118.664 0-216-96.055-216-216 0-118.663 96.055-216 216-216 118.664 0 216 96.055 216 216 0 118.663-96.055 216-216 216zm141.63-274.961L217.15 376.071c-4.705 4.667-12.303 4.637-16.97-.068l-85.878-86.572c-4.667-4.705-4.637-12.303.068-16.97l8.52-8.451c4.705-4.667 12.303-4.637 16.97.068l68.976 69.533 163.441-162.13c4.705-4.667 12.303-4.637 16.97.068l8.451 8.52c4.668 4.705 4.637 12.303-.068 16.97z" />
</svg>
<span class="sib-form-message-panel__inner-text">
                 Success!
             </span>
</div>
</div>
<div></div>
<div id="sib-container" class="sib-container--large sib-container--vertical" style="text-align:center; background-color:rgba(255,255,255,1); max-width:540px; border-radius:3px; border-width:1px; border-color:#C0CCD9; border-style:solid; direction:ltr">
<form id="sib-form" method="POST" action="https://094c12d9.sibforms.com/serve/MUIFALLkvhMwUn1kNvrYTU7uLg8Uixf4tjLkUKWm1529H_FvNi-y7NWuHyYGkbgomOia8-veELP0qJUvWhBUUYNvrVOdf7EVq4UJI4aO8j6qOpFJa2ugPxWMzs_IOKNn_uvU9JqFQe-eCkyH4xLEv9S8Djswo6lQm9wGs2PDqBPNKY5GwLCT7SMZ-UCLbRzcMNAbv5GkaciXYWPz" data-type="subscription">
<div style="padding: 8px 0;">
 <div class="sib-form-block" style="font-size:32px; text-align:left; font-weight:700; font-family:&quot;Futura&quot;, sans-serif; color:#3C4858; background-color:transparent; text-align:left">
   <p>Subscribe for post alerts!</p>
 </div>
</div>
<div style="padding: 8px 0;">
 <div class="sib-form-block" style="font-size:16px; text-align:left; font-family:&quot;Futura&quot;, sans-serif; color:#3C4858; background-color:transparent; text-align:left">
   <div class="sib-text-form-block">
     <p>Sign-up for the latest <strong>Reticulated.net</strong> posts below</p>
   </div>
 </div>
</div>
<div style="padding: 8px 0;">
 <div class="sib-input sib-form-block">
   <div class="form__entry entry_block">
     <div class="form__label-row ">

       <div class="entry__field">
         <input class="input " type="text" id="EMAIL" name="EMAIL" autocomplete="off" placeholder="EMAIL" data-required="true" required />
       </div>
     </div>

     <label class="entry__error entry__error--primary" style="font-size:16px; text-align:left; font-family:&quot;Helvetica&quot;, sans-serif; color:#661d1d; background-color:#ffeded; border-radius:3px; border-color:#ff4949;">
     </label>
     <label class="entry__specification" style="font-size:12px; text-align:left; font-family:&quot;Futura&quot;, sans-serif; color:#8390A4; text-align:left">
       Provide your email address to subscribe. For e.g abc@xyz.com
     </label>
   </div>
 </div>
</div>
<div style="padding: 8px 0;">
 <div class="sib-form-block" style="text-align: left">
   <button class="sib-form-block__button sib-form-block__button-with-loader" style="font-size:16px; text-align:left; font-weight:700; font-family:&quot;Futura&quot;, sans-serif; color:#FFFFFF; background-color:#0c0e12; border-radius:6px; border-width:0px;" form="sib-form" type="submit">
     <svg class="icon clickable__icon progress-indicator__icon sib-hide-loader-icon" viewBox="0 0 512 512">
       <path d="M460.116 373.846l-20.823-12.022c-5.541-3.199-7.54-10.159-4.663-15.874 30.137-59.886 28.343-131.652-5.386-189.946-33.641-58.394-94.896-95.833-161.827-99.676C261.028 55.961 256 50.751 256 44.352V20.309c0-6.904 5.808-12.337 12.703-11.982 83.556 4.306 160.163 50.864 202.11 123.677 42.063 72.696 44.079 162.316 6.031 236.832-3.14 6.148-10.75 8.461-16.728 5.01z" />
     </svg>
     SUBSCRIBE
   </button>
 </div>
</div>

<input type="text" name="email_address_check" value="" class="input--hidden">
<input type="hidden" name="locale" value="en">
</form>
</div>
</div>
</div>
<h3 id="cheap-wyzekasa-cameras">Cheap Wyze/Kasa Cameras</h3>
<p>Those cheap $20 cameras you can get on Amazon are pretty great. Of course, they&rsquo;re all locked down to only work with their associated mobile apps out of the box, but most are able to be exposed over RTMP if you do some command line with FFMPEG.</p>
<p>These cameras can&rsquo;t really work wtih Octoprint without you doing something crazy like converting RTMP to an mjpeg stream, which feels like going backwards. I have done this in the past and don&rsquo;t recommend it.</p>
<p>I&rsquo;ll cover setting up RTMP on the 2 cameras I&rsquo;m using, the <a href="https://www.amazon.com/YI-Action-Sports-Camera-Control/dp/B01FU9ZIMU/">Xiamoi Yi 4k+</a> and a <a href="https://amzn.to/3Q2n4hl">Kasa EC60</a>, in the setup steps below.</p>
<h3 id="the-pi-problem">The Pi Problem</h3>
<p>The real issue with using Octoprint to stream your 3d printer videos is the hardware most people are running it on. A Raspberry pi that&rsquo;s working with the printer to figure our GCODE to stepper-motor translation isn&rsquo;t the place to also pipe in one or more HD live stream feeds, unless you want skipped steps and layer shifts.</p>
<h2 id="enter-youtube-live">Enter Youtube Live</h2>
<p>Now that we don&rsquo;t have to worry about Octoprint&rsquo;s restrictions, we&rsquo;ll have to figure out where our stream will live. Youtube Live will let us easily stream dozens of hours of our printer feed with no hassle and make sure it&rsquo;s available anywhere with an internet connection. We also can make clips, seek back 2 hours to see why a print failed, etc.</p>
<p>Why deal with your own stream when YT makes this so nice and easy (and free!)</p>
<h2 id="the-full-list-of-tools">The Full List of Tools</h2>
<p>Here&rsquo;s everything we&rsquo;ll be using to make our stream.</p>
<ul>
<li>Youtube Live</li>
<li><a href="https://obsproject.com/">OBS Studio</a> for streaming to Youtube
<ul>
<li><a href="https://obsproject.com/forum/resources/url-api-source-live-data-media-and-ai-on-obs-made-simple.1756/">URL/API Plugin for OBS</a> to create our job and temp data.</li>
</ul>
</li>
<li>Yi 4k+ and Kasa EC60 setup for RTMP Streaming
<ul>
<li><a href="https://marines.github.io/yi-qrcodes/">QR Code Generator for Yi4k RTMP stream</a></li>
</ul>
</li>
<li><a href="https://www.monaserver.ovh/">Monaserver</a> to run our own RTMP Server</li>
<li><a href="https://ffmpeg.org/">FFMPEG</a></li>
</ul>
<h2 id="setting-up-rtmp">Setting up RTMP</h2>
<p>Setting up Monaserver is simple. We don&rsquo;t need to do any configuration, just download and run it and make sure you see <code>Protocols.h[82] RTMP server started on 0.0.0.0:1935</code> in the console when it launches.</p>
<p><img src="/posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413101611_hua78484668fff844d7e4269b52649a2a9_179640_1371x0_resize_q82_h2_lanczos_3.webp#centered" srcset="/posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413101611_hua78484668fff844d7e4269b52649a2a9_179640_720x0_resize_q82_h2_lanczos_3.webp#centered 720w, /posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413101611_hua78484668fff844d7e4269b52649a2a9_179640_1080x0_resize_q82_h2_lanczos_3.webp#centered 1080w, /posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413101611_hua78484668fff844d7e4269b52649a2a9_179640_1371x0_resize_q82_h2_lanczos_3.webp#centered 1371w" sizes="(min-width: 768px) 720px, 100vw"
    width="1371" height="712"
    alt=""
     class="responsive-image"
    loading="lazy" decoding="async"></p>
<h3 id="camera-setup">Camera Setup</h3>
<p>If you happen to have a Yi 4k+, it comes with a live stream mode out of the box. You can use <a href="https://marines.github.io/yi-qrcodes/">this qr code generator</a> to connecto to Monaserver. You&rsquo;ll need to enter the local IP Address of the computer running Monaserver for the RTMP URL: <code>x.x.x.x:1935</code> and enter your wifi details as well. It&rsquo;s handy to print this out on paper so you can easily connect the camera when you need to.</p>
<p>For the Kasa EC60 or similar, I followed <a href="https://medium.com/@hu3vjeen/reverse-engineering-tp-link-kc100-bac4641bf1cd">this article</a> to get RTMP working. I did not find all the info in the article to be correct. You should just be able to update and save the code below in a .bat file on Windows and run the file after your start Mona and connect to the Kasa camera.</p>
<p>Be sure to replace <code>KASA_EMAIL_ADDRESS</code>, <code>MY_PASSWORD</code> and <code>[KASA_IP_ADDRESS]</code> before use.</p>
<pre tabindex="0"><code>@echo off
F:\download\curl-8.7.1_6-win64-mingw\curl-8.7.1_6-win64-mingw\bin\curl.exe -vv -k -u KASA_EMAIL_ADDRESS:MY_PASSWORD --ignore-content-length &#34;https://[KASA_IP_ADDRESS]:19443/https/stream/mixed?video=h264&amp;audio=g711&#34; --output  - |ffmpeg -re -i - -f flv rtmp://127.0.0.1:1935/live/2 
</code></pre><p><img src="/posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413101902_hu006b72d83c4ac1b1f8a2ee8cd069d8d0_618203_1440x0_resize_q82_h2_lanczos_3.webp#centered" srcset="/posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413101902_hu006b72d83c4ac1b1f8a2ee8cd069d8d0_618203_720x0_resize_q82_h2_lanczos_3.webp#centered 720w, /posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413101902_hu006b72d83c4ac1b1f8a2ee8cd069d8d0_618203_1080x0_resize_q82_h2_lanczos_3.webp#centered 1080w, /posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413101902_hu006b72d83c4ac1b1f8a2ee8cd069d8d0_618203_1440x0_resize_q82_h2_lanczos_3.webp#centered 1440w" sizes="(min-width: 768px) 720px, 100vw"
    width="1440" height="810"
    alt=""
     class="responsive-image"
    loading="lazy" decoding="async"></p>
<h2 id="setting-up-obs">Setting up OBS</h2>
<p>Now that we have our cameras both streaming out to Monaserver, we can start setting up OBS with the inputs we&rsquo;ll need.</p>
<p>I&rsquo;ve exported my OBS Scene with all features <a href="https://gist.github.com/pwillia7/5fdfddb22bb5c481577b3c4be2897972">here</a>. You should just need to change the camera setups if different than I&rsquo;m using and replace the Auth token for the Octoprint API.</p>
<h3 id="cameras">Cameras</h3>
<p>Importing our feeds into OBS is easy. Just select New Source &ndash;&gt; Media Source and enter <code>rtmp://127.0.0.1:1935/live</code></p>
<p>if you setup a 2nd camera, setup a 2nd Media Source and enter <code>rtmp://127.0.0.1:1935/live/2</code></p>
<p><img src="/posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413102050_hud7e4b94511e9ba76a4020c08a9069425_195779_1440x0_resize_q82_h2_lanczos_3.webp#centered" srcset="/posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413102050_hud7e4b94511e9ba76a4020c08a9069425_195779_720x0_resize_q82_h2_lanczos_3.webp#centered 720w, /posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413102050_hud7e4b94511e9ba76a4020c08a9069425_195779_1080x0_resize_q82_h2_lanczos_3.webp#centered 1080w, /posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413102050_hud7e4b94511e9ba76a4020c08a9069425_195779_1440x0_resize_q82_h2_lanczos_3.webp#centered 1440w" sizes="(min-width: 768px) 720px, 100vw"
    width="1440" height="933"
    alt=""
     class="responsive-image"
    loading="lazy" decoding="async"></p>
<h3 id="data">Data</h3>
<p>Getting all our data in will be a bit more challenging. The <a href="https://obsproject.com/forum/resources/url-api-source-live-data-media-and-ai-on-obs-made-simple.1756/">URL/API Source</a> Plugin can help us set this up in a nice way.</p>
<p>You&rsquo;ll need an <a href="https://docs.octoprint.org/en/master/api/general.html#authorization">API key from Octoprint</a> to set this up. I won&rsquo;t go into each source I&rsquo;ve setup, but I&rsquo;ll briefly cover how to use the plugin.</p>
<ul>
<li>
<p>After you install the plugin, setup a new source and select URL/API, then click Setup Data Source.</p>
</li>
<li>
<p>Enter http://[MY_OCTOPRINT_IP]:5000/api/printer in the URL field and setup a new header `Authorization: BEARER [MY_OCTOPRINT_KEY].</p>
</li>
<li>
<p>In the JSON Pointer field, enter <code>/temperature/tool0/actual</code> to grab the Extruder Temperature from the API. Other fields can be pulled in in a similar way.</p>
</li>
<li>
<p>Exit the Data Source screen and scroll down to the output template. Enter <code>Extruder Temp: {{output}}°</code></p>
</li>
</ul>
<p><img src="/posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413102151_huba3ca9e7fe25f5bc23d973d07baf2ed4_66573_1009x0_resize_q82_h2_lanczos_3.webp#centered" srcset="/posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413102151_huba3ca9e7fe25f5bc23d973d07baf2ed4_66573_720x0_resize_q82_h2_lanczos_3.webp#centered 720w, /posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413102151_huba3ca9e7fe25f5bc23d973d07baf2ed4_66573_1009x0_resize_q82_h2_lanczos_3.webp#centered 1009w" sizes="(min-width: 768px) 720px, 100vw"
    width="1009" height="956"
    alt=""
     class="responsive-image"
    loading="lazy" decoding="async"></p>
<h3 id="print-image">Print Image</h3>
<p>The last thing we&rsquo;ll walk through setting up is the print image. This requires the <a href="https://plugins.octoprint.org/plugins/prusaslicerthumbnails/">Slicer Thumbnails plugin</a> for Octoprint and that you setup your slicer to output the preview images.</p>
<p>Caution: I tried dynamically pulling in the jpg file through the URL/API source based on the active job file name, but the string manipulation tools in the plugin/OBS didn&rsquo;t let me find a way that could work. I know setting up things this way is pretty nonstandard &ndash; If you can get the image URL pulled into OBS dynamically, please leave a comment!</p>
<ul>
<li>Create a Browser Source and enter your Octoprint Dashboard URL.</li>
<li>Open the filters pane on the Browser Source and select &ldquo;Crop/Pad&rdquo; and adjust the cropping to only show the printer image</li>
<li>Create a new filter &ldquo;Color Key&rdquo;, pick custom color and select white (#ffffff)</li>
<li>Adjust the settings to make the background transparent
<img src="/posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413084529_hubaaeffb70b5c2e5863742e425e8a2f7f_47904_1050x0_resize_q82_h2_lanczos_3.webp#centered" srcset="/posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413084529_hubaaeffb70b5c2e5863742e425e8a2f7f_47904_720x0_resize_q82_h2_lanczos_3.webp#centered 720w, /posts/making-the-ideal-3d-printer-montioring-live-stream/img/20240413084529_hubaaeffb70b5c2e5863742e425e8a2f7f_47904_1050x0_resize_q82_h2_lanczos_3.webp#centered 1050w" sizes="(min-width: 768px) 720px, 100vw"
    width="1050" height="833"
    alt=""
     class="responsive-image"
    loading="lazy" decoding="async"></li>
<li>Optionally add a &ldquo;Color Correction&rdquo; filter to change the color of the image.</li>
</ul>
<h2 id="final-thoughts">Final Thoughts</h2>
<p>And that&rsquo;s it! Now you can multi-camera monitor your 3d prints from anywhere. With this and the telegram notification plugin in Octoprint to tell me when prints are done, I&rsquo;m having a much better 3d print experience than in the past.</p>
<p>I&rsquo;ve also recently spent a ton of time fine-tuning my Kingroon trying to get as close to perfect settings and dimensions and may do a quick write up on that in the near future since there were some things even as a long time 3d printer that were new to me.</p>
<p>Thanks for reading!</p>
]]></content:encoded>
    </item>
    
  </channel>
</rss>
