rocnet:cam-en
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rocnet:cam-en [2019/08/01 12:16] – rjversluis | rocnet:cam-en [2020/01/15 17:18] (current) – [Text] rjversluis | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ======CAM====== | + | ======Camera Streaming====== |
+ | [[: | ||
+ | [[: | ||
+ | * [[: | ||
+ | |||
+ | |< >| | ||
+ | ^ [[https:// | ||
+ | \\ | ||
+ | \\ | ||
{{: | {{: | ||
+ | |||
+ | =====Demos===== | ||
+ | * https:// | ||
Line 24: | Line 35: | ||
< | < | ||
< | < | ||
- | < | + | < |
</ | </ | ||
< | < | ||
- | <img src=" | + | <img src=" |
</ | </ | ||
</ | </ | ||
Line 92: | Line 103: | ||
daemon_threads = True | daemon_threads = True | ||
- | with picamera.PiCamera(resolution=' | + | with picamera.PiCamera(resolution=' |
output = StreamingOutput() | output = StreamingOutput() | ||
#Uncomment the next line to change your Pi's Camera rotation (in degrees) | #Uncomment the next line to change your Pi's Camera rotation (in degrees) | ||
Line 121: | Line 132: | ||
< | < | ||
< | < | ||
- | < | + | < |
</ | </ | ||
< | < | ||
- | < | + | <img src=" |
- | < | + | |
</ | </ | ||
</ | </ | ||
Line 133: | Line 143: | ||
\\ | \\ | ||
=====Viewers===== | =====Viewers===== | ||
- | ====wxWidgets==== | + | ====Text==== |
- | * https://docs.wxwidgets.org/ | + | To enable MJPEG streaming in a text object, the text content must be set to: |
+ | < | ||
+ | mjpg:< | ||
+ | </code> | ||
+ | For example: | ||
+ | < | ||
+ | mjpg:192.168.100.167: | ||
+ | </ | ||
+ | ====Loco Throttle==== | ||
+ | Set the camera host and port on the Interface Tab of the loco properties.\\ | ||
\\ | \\ | ||
=====Links===== | =====Links===== | ||
* https:// | * https:// | ||
* https:// | * https:// | ||
+ | * https:// | ||
====IE Solutions==== | ====IE Solutions==== | ||
MS IE does not support mjpg video streaming. | MS IE does not support mjpg video streaming. | ||
* https:// | * https:// | ||
+ | |||
+ | \\ | ||
+ | =====Splitting===== | ||
+ | < | ||
+ | 00000130: 55 E6 9D 09 E3 78 60 4E 31 81 BB 05 94 12 A3 38 |U....x`N1......8| | ||
+ | 00000140: 27 6B 74 23 D3 03 35 B5 2E 6E 58 B6 BF AD 46 D3 |' | ||
+ | 00000150: B6 FB 7E 07 FF D9 0D 0A 2D 2D 46 52 41 4D 45 0D |..~.....--FRAME.| | ||
+ | 00000160: 0A 43 6F 6E 74 65 6E 74 2D 54 79 70 65 3A 20 69 |.Content-Type: | ||
+ | 00000170: 6D 61 67 65 2F 6A 70 65 67 0D 0A 43 6F 6E 74 65 |mage/ | ||
+ | 00000180: 6E 74 2D 4C 65 6E 67 74 68 3A 20 31 32 35 32 34 |nt-Length: 12524| | ||
+ | 00000190: 33 0D 0A 0D 0A FF D8 FF DB 00 84 00 01 01 01 01 |3...............| | ||
+ | 000001A0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 |................| | ||
+ | 000001B0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 02 02 |................| | ||
+ | | ||
+ | | ||
+ | 00000120: 8D B9 66 EE EF AD 96 DD 74 E4 76 DF FA 63 FA AD |..f.....t.v..c..| | ||
+ | 00000130: 29 2D 62 AD A6 AA FA FC B9 B4 F9 9F FF D9 0D 0A |)-b.............| | ||
+ | 00000140: 2D 2D 46 52 41 4D 45 0D 0A 43 6F 6E 74 65 6E 74 |--FRAME..Content| | ||
+ | 00000150: 2D 54 79 70 65 3A 20 69 6D 61 67 65 2F 6A 70 65 |-Type: image/jpe| | ||
+ | 00000160: 67 0D 0A 43 6F 6E 74 65 6E 74 2D 4C 65 6E 67 74 |g..Content-Lengt| | ||
+ | 00000170: 68 3A 20 34 37 30 37 37 0D 0A 0D 0A FF D8 FF DB |h: 47077........| | ||
+ | 00000180: 00 84 00 01 01 01 01 01 01 01 01 01 01 01 01 01 |................| | ||
+ | 00000190: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 |................| | ||
+ | 000001A0: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 |................| | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | Source: https:// | ||
+ | <code python> | ||
+ | import cv2 | ||
+ | import urllib | ||
+ | import numpy as np | ||
+ | |||
+ | stream = urllib.urlopen(' | ||
+ | bytes = '' | ||
+ | while True: | ||
+ | bytes += stream.read(1024) | ||
+ | a = bytes.find(' | ||
+ | b = bytes.find(' | ||
+ | if a != -1 and b != -1: | ||
+ | jpg = bytes[a: | ||
+ | bytes = bytes[b+2:] | ||
+ | i = cv2.imdecode(np.fromstring(jpg, | ||
+ | cv2.imshow(' | ||
+ | if cv2.waitKey(1) == 27: | ||
+ | exit(0) |
rocnet/cam-en.1564654571.txt.gz · Last modified: 2019/08/01 12:16 by rjversluis