Skip to content

Instantly share code, notes, and snippets.

@bakman2
Last active September 19, 2024 21:01
Show Gist options
  • Save bakman2/521fd7333b4fad6602b9f9955c4fbc2c to your computer and use it in GitHub Desktop.
Save bakman2/521fd7333b4fad6602b9f9955c4fbc2c to your computer and use it in GitHub Desktop.

Revisions

  1. bakman2 revised this gist Feb 13, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion octoprint.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    Install [Dafang Hacks](https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks) on the Wyze Cam.

    Once running and all is functional, continue.
    Set video bitrate to 1500
    Set video bitrate to 1500, VBR, 30fps.

    ### Installation

  2. bakman2 revised this gist Feb 12, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion octoprint.md
    Original file line number Diff line number Diff line change
    @@ -28,7 +28,7 @@ paste the following line:
    cvlc -I dummy rtsp://ip_of_yourcam --sout "#transcode{vcodec=mjpg,quality=3,fps=5,acodec=none,width=1280,height=720}:standard{access=http{mime=multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8888/videostream.cgi}" 2>/dev/null
    ```

    Change the ip_of_yourcam to match your camera
    Change the ip_of_yourcam to match the full rtsp url from your camera

    CTRL+x to save

  3. bakman2 renamed this gist Feb 12, 2020. 1 changed file with 8 additions and 10 deletions.
    18 changes: 8 additions & 10 deletions mpminidelta.md → octoprint.md
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,14 @@
    ## Octoprint with Wyze cam V2 (or any IP camera that has an RTSP stream available)
    ## How to use Octoprint with an IP camera that has an RTSP stream available

    #### Installation
    #### Optional: For Wyze cam only

    Install [Dafang Hacks](https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks) on the Wyze Cam.

    Once running and all is functional, continue.
    Set video bitrate to 1500

    ### Installation

    If OctoPrint is running on a Raspberry Pi (3B minimum):

    ```
    @@ -23,10 +25,10 @@ nano http_stream.sh
    paste the following line:

    ```
    cvlc -I dummy rtsp://<user:pass@yourwyzecamip>:8554/unicast --sout "#transcode{vcodec=mjpg,quality=3,fps=5,acodec=none,width=1280,height=720}:standard{access=http{mime=multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8888/videostream.cgi}" 2>/dev/null
    cvlc -I dummy rtsp://ip_of_yourcam --sout "#transcode{vcodec=mjpg,quality=3,fps=5,acodec=none,width=1280,height=720}:standard{access=http{mime=multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8888/videostream.cgi}" 2>/dev/null
    ```

    Change the user:pass@yourwyzecamip to match your camera
    Change the ip_of_yourcam to match your camera

    CTRL+x to save

    @@ -41,15 +43,11 @@ Now you should be able to open your browser:

    If it works, you can use this url in OctoPrint for the `Stream URL`

    For the snapshot URL use:

    `https://<user:pass@wyzecamip>/cgi-bin/currentpic.cgi`
    For the snapshot URL use the stills url from your camera

    Change your user/pass and ip to match your setup
    Click `advanced options` and **uncheck** `Validate SSL on snapshot URL (if applicable)`

    As this process is cpu intensive you will need to play around with the `quality=x,fps=x` (fps = frames per second) options in the cvlc command. These settings work for me, but as I wanted better quality I have this process running on a more powerful device
    As this process is cpu intensive you will need to play around with the `quality=x,fps=x` (fps = frames per second) options in the cvlc command. These settings work for me, but as I wanted better quality I have this process running on a more powerful device.

    #### Other devices

    Same steps, but change the vb and fps option if possible.
  4. bakman2 revised this gist Feb 12, 2020. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions mpminidelta.md
    Original file line number Diff line number Diff line change
    @@ -23,8 +23,7 @@ nano http_stream.sh
    paste the following line:

    ```
    cvlc -I dummy rtsp://<user:pass@yourwyzecamip>:8554/unicast --sout "#transcode{vcodec=mjpg,quality=3,fps=5,acodec=none,width=1280,height=720}:standard{access=http{mime=multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst
    =:8888/videostream.cgi}" 2>/dev/null
    cvlc -I dummy rtsp://<user:pass@yourwyzecamip>:8554/unicast --sout "#transcode{vcodec=mjpg,quality=3,fps=5,acodec=none,width=1280,height=720}:standard{access=http{mime=multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8888/videostream.cgi}" 2>/dev/null
    ```

    Change the user:pass@yourwyzecamip to match your camera
  5. bakman2 revised this gist Jan 23, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion mpminidelta.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ## Octoprint with Wyze cam V2
    ## Octoprint with Wyze cam V2 (or any IP camera that has an RTSP stream available)

    #### Installation

  6. bakman2 revised this gist Jan 23, 2020. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions mpminidelta.md
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,7 @@
    Install [Dafang Hacks](https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks) on the Wyze Cam.

    Once running and all is functional, continue.
    Set video bitrate to 1500

    If OctoPrint is running on a Raspberry Pi (3B minimum):

    @@ -22,8 +23,7 @@ nano http_stream.sh
    paste the following line:

    ```
    cvlc -I dummy rtsp://<user:pass@yourwyzecamip>:8554/unicast --sout "#transcode{vcodec=mjpg,vb=1200,fps=3,scale=1.0,acodec=n
    one}:standard{access=http{mime=multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst
    cvlc -I dummy rtsp://<user:pass@yourwyzecamip>:8554/unicast --sout "#transcode{vcodec=mjpg,quality=3,fps=5,acodec=none,width=1280,height=720}:standard{access=http{mime=multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst
    =:8888/videostream.cgi}" 2>/dev/null
    ```

    @@ -49,7 +49,7 @@ For the snapshot URL use:
    Change your user/pass and ip to match your setup
    Click `advanced options` and **uncheck** `Validate SSL on snapshot URL (if applicable)`

    As this process is cpu intensive you will need to play around with the `vb=x,fps=x` (vb = bitrate, fps = frames per second) options in the cvlc command. These settings work for me, but as I wanted better quality I have this process running on a more powerful device
    As this process is cpu intensive you will need to play around with the `quality=x,fps=x` (fps = frames per second) options in the cvlc command. These settings work for me, but as I wanted better quality I have this process running on a more powerful device

    #### Other devices

  7. bakman2 revised this gist Nov 28, 2019. 1 changed file with 55 additions and 1 deletion.
    56 changes: 55 additions & 1 deletion mpminidelta.md
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,56 @@
    # Monoprice Mini Delta - collection of useful things
    ## Octoprint with Wyze cam V2

    #### Installation

    Install [Dafang Hacks](https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks) on the Wyze Cam.

    Once running and all is functional, continue.

    If OctoPrint is running on a Raspberry Pi (3B minimum):

    ```
    ssh pi@<raspberry_ip>
    sudo apt update
    sudo apt install vlc
    ```

    VLC will be used to transcode the rtsp stream to a http stream which OctoPrint can use as streaming URL

    ```
    nano http_stream.sh
    ```
    paste the following line:

    ```
    cvlc -I dummy rtsp://<user:pass@yourwyzecamip>:8554/unicast --sout "#transcode{vcodec=mjpg,vb=1200,fps=3,scale=1.0,acodec=n
    one}:standard{access=http{mime=multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst
    =:8888/videostream.cgi}" 2>/dev/null
    ```

    Change the user:pass@yourwyzecamip to match your camera

    CTRL+x to save

    ```
    chmod +x http_stream.sh
    ./http_stream.sh
    ```

    Now you should be able to open your browser:

    `http://<raspberryip>:8888/videostream.cgi`

    If it works, you can use this url in OctoPrint for the `Stream URL`

    For the snapshot URL use:

    `https://<user:pass@wyzecamip>/cgi-bin/currentpic.cgi`

    Change your user/pass and ip to match your setup
    Click `advanced options` and **uncheck** `Validate SSL on snapshot URL (if applicable)`

    As this process is cpu intensive you will need to play around with the `vb=x,fps=x` (vb = bitrate, fps = frames per second) options in the cvlc command. These settings work for me, but as I wanted better quality I have this process running on a more powerful device

    #### Other devices

    Same steps, but change the vb and fps option if possible.
  8. bakman2 created this gist Nov 28, 2019.
    2 changes: 2 additions & 0 deletions mpminidelta.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    # Monoprice Mini Delta - collection of useful things