diff --git a/README.md b/README.md index adb5271..52d4683 100644 --- a/README.md +++ b/README.md @@ -45,14 +45,15 @@ TODO ### OctoPrint Setup - If the GUI is enabled, you can setup OctoPrint on the Raspberry Pi. You can also setup OctoPrint by opening up a web browser on another computer and navigating to `https://RPI-IP`, replacing RPI-IP with the IP address of your Raspberry Pi. -- If MJPG-Streamer is enabled, you can put `/webcam/?action=stream` into the Stream URL box to enable it in OctoPrint. +- If MJPG-Streamer is enabled, you can put `/webcam` into the Stream URL box to enable it in OctoPrint. ### Accessing OctoPrint - If OctoPrint is enabled, you can access it at `https://RPI-IP`, replacing RPI-IP with the IP address of your Raspberry Pi. ### Reporting Bugs -Please report any bugs by [filing an issue](/issues). Please include as much detail as you can, including: +Please report any bugs by [filing an issue](/issues). Please include as much detail as you can, including (but not limited to): - Raspberry Pi Model +- Version of TouchPrint - What you were doing when the bug occured - Steps to reproduce - Logs diff --git a/stage2/05-mjpgstreamer/files/start-mjpg b/stage2/05-mjpgstreamer/files/start-mjpg index 6484ce0..df7569a 100644 --- a/stage2/05-mjpgstreamer/files/start-mjpg +++ b/stage2/05-mjpgstreamer/files/start-mjpg @@ -1,2 +1,6 @@ #!/bin/bash -/usr/local/bin/mjpeg-server -a 127.0.0.1:9000 -- ffmpeg -i /dev/video0 -f v4l2 -f mpjpeg - +if [[ "$(ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=nokey=1:noprint_wrappers=1 /dev/video0)" == "h264" ]]; then + /usr/local/bin/mjpeg-server -a 127.0.0.1:9000 -- ffmpeg -input_format h264 -i /dev/video0 -c:v h264_v4l2m2m -f mpjpeg - +else + /usr/local/bin/mjpeg-server -a 127.0.0.1:9000 -- ffmpeg -i /dev/video0 -f mpjpeg - +fi