# Zerocam

Scripte:

\#/bin/bash

raspistill -t 86000000 -tl 10000 --rotation 90 -q 80 -o /home/pi/Photo/image%04d.jpg

\------------------------------------------------------------------------------------------------------------------------------

\#/bin/bash

raspistill -t 0 -tl 10000 -w 1920 -h 1080 --annotate 12 --rotation 90 -o /home/pi/Photo/image%04d.jpg

\------------------------------------------------------------------------------------------------------------------------------

rc.local:

\#!/bin/sh -e  
\#  
\# rc.local  
\#  
\# This script is executed at the end of each multiuser runlevel.  
\# Make sure that the script will "exit 0" on success or any other  
\# value on error.  
\#  
\# In order to enable or disable this script just change the execution  
\# bits.  
\#  
\# By default this script does nothing.  
\#aktivieren...  
\#/home/pi/10sec-still\_FullHD.sh  
\#/home/pi/camstream.sh  
\# Print the IP address  
\_IP=$(hostname -I) || true  
if \[ "$\_IP" \]; then  
 printf "My IP address is %s\\n" "$\_IP"  
fi

exit 0

\------------------------------------------------------------------------------------------------------------------------------

Streaming: http://zerocam2:8080/?action=stream

/bin/bash

v4l2-ctl -c compression\_quality=85  
v4l2-ctl -c brightness=55  
v4l2-ctl -c rotate=90  
v4l2-ctl -c contrast=30  
v4l2-ctl -c saturation=20  
v4l2-ctl -c scharpness=60  
mjpg\_streamer -i "input\_uvc.so -d /dev/video0 -r 1280x720 -f 25" -o "output\_http.so -w /usr/local/share/mjpg-streamer/www -p 8080"  
  
\------------------------------------------------------------------------------------------------------------------------------

Anleitung:

<div class="wp-block-syntaxhighlighter-code" id="bkmrk-"><div><div class="syntaxhighlighter  plain" id="bkmrk--0"></div></div></div>Let’s test by trying to run mjpg-streamer against the input\_uvc.so plugin, since I”m not using a Raspi-Camera, but a USB one instead. (**See notes at the bottom about Raspberry Pi Bullseye and Raspi-Cameras**). I’ll also output using the http plugin. So my testing command line looks like this:

<div class="wp-block-syntaxhighlighter-code" id="bkmrk-1-2-%2Fusr%2Flocal%2Fbin%2Fm"><div><div class="syntaxhighlighter  bash" id="bkmrk-1-2-%2Fusr%2Flocal%2Fbin%2Fm-0"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="gutter"><div class="line number1 index0 alt2">1</div><div class="line number2 index1 alt1">2</div></td><td class="code"><div class="container"><div class="line number1 index0 alt2">`/usr/local/bin/mjpg_streamer`` -i ``"input_uvc.so -f 15 -r 640x480"`` \`</div><div class="line number2 index1 alt1">` -o ``"output_http.so -w /usr/local/share/mjpg-streamer/www"`</div></div></td></tr></tbody></table>

</div></div></div>Executing that line gives us a dump of data – here’s the relevant info:

<div class="wp-block-syntaxhighlighter-code" id="bkmrk-1-2-3-4-5-6-7-8-9-10"><div><div class="syntaxhighlighter  plain" id="bkmrk-1-2-3-4-5-6-7-8-9-10-2"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="gutter"><div class="line number1 index0 alt2">1</div><div class="line number2 index1 alt1">2</div><div class="line number3 index2 alt2">3</div><div class="line number4 index3 alt1">4</div><div class="line number5 index4 alt2">5</div><div class="line number6 index5 alt1">6</div><div class="line number7 index6 alt2">7</div><div class="line number8 index7 alt1">8</div><div class="line number9 index8 alt2">9</div><div class="line number10 index9 alt1">10</div><div class="line number11 index10 alt2">11</div></td><td class="code"><div class="container"><div class="line number1 index0 alt2">`MJPG Streamer Version: git rev: 5a6e0a2db163e6ae9461552b59079870d0959340`</div><div class="line number2 index1 alt1">` i: Using V4L2 device.: /dev/video0`</div><div class="line number3 index2 alt2">` i: Desired Resolution: 640 x 480`</div><div class="line number4 index3 alt1">` i: Frames Per Second.: 15`</div><div class="line number5 index4 alt2">` i: Format............: JPEG`</div><div class="line number6 index5 alt1">` i: TV-Norm...........: DEFAULT`</div><div class="line number7 index6 alt2">` o: www-folder-path......: /usr/local/share/mjpg-streamer/www/`</div><div class="line number8 index7 alt1">` o: HTTP TCP port........: 8080`</div><div class="line number9 index8 alt2">` o: HTTP Listen Address..: (null)`</div><div class="line number10 index9 alt1">` o: username:password....: disabled`</div><div class="line number11 index10 alt2">` o: commands.............: enabled`</div></div></td></tr></tbody></table>

</div></div></div>Our key variables to tweak are **-f for frame rate**, and **-r for resolution**. I’ll change those later, but for a quick test I head on out to my browser and point it at the www server at http://cam-pi-zero.local:8080/

<figure class="wp-block-image size-large" id="bkmrk-i-always-feel-like%E2%80%A6-">![](https://krystof.io/wp-content/uploads/2020/05/2020-05-14_11-08-40.png)<figcaption>I always feel like… somebody’s watching me…</figcaption></figure>Not only do we see the web interface, but a snapshot of the web cam, which was, clearly, laying down on a workbench behind me while I tried this out.

Validating the stream worked (by clicking ‘Stream’) and turning around, I could see myself moving:

<figure class="wp-block-image size-large" id="bkmrk-hello-you%E2%80%A6-come-here">![](https://krystof.io/wp-content/uploads/2020/05/2020-05-14_11-09-38.png)<figcaption>Hello you… come here often?</figcaption></figure>You can now hit CTRL-C in your SSH window (or terminal) and quit the stream. After this point, I could delete the build files I downloaded.

## Tweaking configuration

I wanted to run my camera at its intended resolution and at least a frame rate of 30fps. To do that I modified my command line:

<div class="wp-block-syntaxhighlighter-code" id="bkmrk-1-2-3-%2330fps%2C-1080-h"><div><div class="syntaxhighlighter  bash" id="bkmrk-1-2-3-%2330fps%2C-1080-h-0"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="gutter"><div class="line number1 index0 alt2">1</div><div class="line number2 index1 alt1">2</div><div class="line number3 index2 alt2">3</div></td><td class="code"><div class="container"><div class="line number1 index0 alt2">`#30fps, 1080 HD`</div><div class="line number2 index1 alt1">`/usr/local/bin/mjpg_streamer`` -i ``"input_uvc.so -f 30 -r 1920x1080"`` \`</div><div class="line number3 index2 alt2">` -o ``"output_http.so -w /usr/local/share/mjpg-streamer/www"`</div></div></td></tr></tbody></table>

</div></div></div>I then loaded my own stream up in VLC by opening the direct network path to the stream:

http://cam-pi-zero.local:8080?action=stream

That worked, and I get about a 1-2 second delay from Pi to VLC. So I wouldn’t use this with audio feeds unless I was planning on creating a sync delay. I’m using this to monitor 3D prints, or watch birds outside, so my use case does **not** demand low latency. Is it exactly 30 frames per second? No…. NO it’s not.

At 1280×720, it seemed closer, but at 1920×1080, when set at 30fps, it definitely wasn’t even close. I’d guess more like 15.

The PI wasn’t maxed out on CPU, but it could just be the nature of USB 2.0 at this point. I’m not sure how I can tell if it’s overloaded there or not, but, once again, this is a light monitoring video stream, I don’t care too much about latency. It could be WiFi as well. Someday I may dig in a bit more and find out where the bottleneck is.

I think you could probably choose either 1920×1080 15fps or 1280×720 30fps routes and be okay.

<div class="wp-block-simple-blocks-info-block" data-padding="10" id="bkmrk-be-careful-about-fra" style="background-color: #000000; color: #ffffff; padding: 10px;"><div class="icon" data-iconsize="20" data-iconspace="20" style="margin-right: 20px;">  
</div><div>Be careful about frames and resolution – Watch your CPU, but also make sure you don’t see messages about fps being ‘coerced’ down or up. Your mileage may vary, and you may have to tweak format, fps, and resolution settings further, check out the mjpg-streamer headquarters on their git hub page (see references down below). You can also see the different modes available to your camera by using this command:</div></div><div class="wp-block-syntaxhighlighter-code" id="bkmrk-1-v4l2-ctl---list-fo"><div><div class="syntaxhighlighter  bash" id="bkmrk-1-v4l2-ctl---list-fo-0"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="gutter"><div class="line number1 index0 alt2">1</div></td><td class="code"><div class="container"><div class="line number1 index0 alt2">`v4l2-ctl --list-formats-ext`</div></div></td></tr></tbody></table>

</div></div></div>## Running On Startup

I liked[ Jacob Salmela](https://jacobsalmela.com/2014/05/31/raspberry-pi-webcam-using-mjpg-streamer-over-internet/)‘s script – all I did was change it for my command line on the stop and restart section for my resolution and frame-rate. Save the following script by doing a sudo vi:

<div class="wp-block-syntaxhighlighter-code" id="bkmrk-1-sudo-vi-%2Fetc%2Finit."><div><div class="syntaxhighlighter  plain" id="bkmrk-1-sudo-vi-%2Fetc%2Finit.-0"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="gutter"><div class="line number1 index0 alt2">1</div></td><td class="code"><div class="container"><div class="line number1 index0 alt2">`sudo vi /etc/init.d/livestream.sh`</div></div></td></tr></tbody></table>

</div></div></div><div class="wp-block-syntaxhighlighter-code" id="bkmrk-1-2-3-4-5-6-7-8-9-10-0"><div><div class="syntaxhighlighter  bash" id="bkmrk-1-2-3-4-5-6-7-8-9-10-3"><table border="0" cellpadding="0" cellspacing="0" style="height: 1275px; width: 94.1975%;"><tbody><tr><td class="gutter" style="width: 6.6197%;"><div class="line number1 index0 alt2">1</div><div class="line number2 index1 alt1">2</div><div class="line number3 index2 alt2">3</div><div class="line number4 index3 alt1">4</div><div class="line number5 index4 alt2">5</div><div class="line number6 index5 alt1">6</div><div class="line number7 index6 alt2">7</div><div class="line number8 index7 alt1">8</div><div class="line number9 index8 alt2">9</div><div class="line number10 index9 alt1">10</div><div class="line number11 index10 alt2">11</div><div class="line number12 index11 alt1">12</div><div class="line number13 index12 alt2">13</div><div class="line number14 index13 alt1">14</div><div class="line number15 index14 alt2">15</div><div class="line number16 index15 alt1">16</div><div class="line number17 index16 alt2">17</div><div class="line number18 index17 alt1">18</div><div class="line number19 index18 alt2">19</div><div class="line number20 index19 alt1">20</div><div class="line number21 index20 alt2">21</div><div class="line number22 index21 alt1">22</div><div class="line number23 index22 alt2">23</div><div class="line number24 index23 alt1">24</div><div class="line number25 index24 alt2">25</div><div class="line number26 index25 alt1">26</div><div class="line number27 index26 alt2">27</div><div class="line number28 index27 alt1">28</div><div class="line number29 index28 alt2">29</div><div class="line number30 index29 alt1">30</div><div class="line number31 index30 alt2">31</div><div class="line number32 index31 alt1">32</div><div class="line number33 index32 alt2">33</div><div class="line number34 index33 alt1">34</div><div class="line number35 index34 alt2">35</div><div class="line number36 index35 alt1">36</div><div class="line number37 index36 alt2">37</div><div class="line number38 index37 alt1">38</div><div class="line number39 index38 alt2">39</div><div class="line number40 index39 alt1">40</div><div class="line number41 index40 alt2">41</div><div class="line number42 index41 alt1">42</div><div class="line number43 index42 alt2">43</div><div class="line number44 index43 alt1">44</div><div class="line number45 index44 alt2">45</div><div class="line number46 index45 alt1">46</div><div class="line number47 index46 alt2">47</div><div class="line number48 index47 alt1">48</div><div class="line number49 index48 alt2">49</div><div class="line number50 index49 alt1">50</div><div class="line number51 index50 alt2">51</div><div class="line number52 index51 alt1">52</div></td><td class="code" style="width: 93.3825%;"><div class="container"><div class="line number1 index0 alt2">`#!/bin/sh`</div><div class="line number2 index1 alt1">`# /etc/init.d/livestream.sh`</div><div class="line number3 index2 alt2">`### BEGIN INIT INFO`</div><div class="line number4 index3 alt1">`# Provides:          livestream.sh`</div><div class="line number5 index4 alt2">`# Required-Start:    $network`</div><div class="line number6 index5 alt1">`# Required-Stop:     $network`</div><div class="line number7 index6 alt2">`# Default-Start:     2 3 4 5`</div><div class="line number8 index7 alt1">`# Default-Stop:      0 1 6`</div><div class="line number9 index8 alt2">`# Short-Description: mjpg_streamer for webcam`</div><div class="line number10 index9 alt1">`# Description:       Streams /dev/video0 to <a href="http://IP/?action=stream">http://IP/?action=stream</a>`</div><div class="line number11 index10 alt2">`### END INIT INFO`</div><div class="line number12 index11 alt1">`f_message(){`</div><div class="line number13 index12 alt2">`       `` ``echo`` ``"[+] $1"`</div><div class="line number14 index13 alt1">`}`</div><div class="line number15 index14 alt2"> </div><div class="line number16 index15 alt1">`# Carry out specific functions when asked to by the system`</div><div class="line number17 index16 alt2">`case`` ``"$1"`` ``in`</div><div class="line number18 index17 alt1">`       `` start)`</div><div class="line number19 index18 alt2">`               `` f_message ``"Starting mjpg_streamer"`</div><div class="line number20 index19 alt1">`               `` ``/usr/local/bin/mjpg_streamer`` -b -i ``"input_uvc.so -f 15 -r 1920x1080"`` -o ``"output_http.so -w /usr/local/share/mjpg-streamer/www"`</div><div class="line number21 index20 alt2">`               `` ``sleep`` 2`</div><div class="line number22 index21 alt1">`               `` f_message ``"mjpg_streamer started"`</div><div class="line number23 index22 alt2">`               `` ;;`</div><div class="line number24 index23 alt1">`       `` stop)`</div><div class="line number25 index24 alt2">`               `` f_message ``"Stopping mjpg_streamer…"`</div><div class="line number26 index25 alt1">`               `` killall mjpg_streamer`</div><div class="line number27 index26 alt2">`               `` f_message ``"mjpg_streamer stopped"`</div><div class="line number28 index27 alt1">`               `` ;;`</div><div class="line number29 index28 alt2">`       `` restart)`</div><div class="line number30 index29 alt1">`               `` f_message ``"Restarting daemon: mjpg_streamer"`</div><div class="line number31 index30 alt2">`               `` killall mjpg_streamer`</div><div class="line number32 index31 alt1">`               `` ``/usr/local/bin/mjpg_streamer`` -b -i ``"input_uvc.so -f 15 -r 1920x1080"`` -o ``"output_http.so -w /usr/local/share/mjpg-streamer/www"`</div><div class="line number33 index32 alt2">`               `` ``sleep`` 2`</div><div class="line number34 index33 alt1">`               `` f_message ``"Restarted daemon: mjpg_streamer"`</div><div class="line number35 index34 alt2">`               `` ;;`</div><div class="line number36 index35 alt1">`       `` status)`</div><div class="line number37 index36 alt2">`               `` pid=```ps`` -A | ``grep`` mjpg_streamer | ``grep`` -``v`` ``"grep"`` | ``grep`` -``v`` mjpg_streamer. | ``awk`` ‘{print $1}’ | ``head`` -n 1``</div><div class="line number38 index37 alt1">`               `` ``if`` [ -n ``"$pid"`` ];`</div><div class="line number39 index38 alt2">`               `` ``then`</div><div class="line number40 index39 alt1">`                       `` f_message ``"mjpg_streamer is running with pid ${pid}"`</div><div class="line number41 index40 alt2">`                       `` f_message ``"mjpg_streamer was started with the following command line"`</div><div class="line number42 index41 alt1">`                       `` ``cat`` ``/proc/``${pid}``/cmdline`` ; ``echo`` ``""`</div><div class="line number43 index42 alt2">`               `` ``else`</div><div class="line number44 index43 alt1">`                       `` f_message ``"Could not find mjpg_streamer running"`</div><div class="line number45 index44 alt2">`               `` ``fi`</div><div class="line number46 index45 alt1">`               `` ;;`</div><div class="line number47 index46 alt2">`       `` *)`</div><div class="line number48 index47 alt1">`               `` f_message ``"Usage: $0 {start|stop|status|restart}"`</div><div class="line number49 index48 alt2">`               `` ``exit`` 1`</div><div class="line number50 index49 alt1">`               `` ;;`</div><div class="line number51 index50 alt2">`esac`</div><div class="line number52 index51 alt1">`exit`` 0`</div></div></td></tr></tbody></table>

</div></div></div>Then we enable this on startup by performing:

<div class="wp-block-syntaxhighlighter-code" id="bkmrk-1-2-sudo-chmod-755-%2F"><div><div class="syntaxhighlighter  bash" id="bkmrk-1-2-sudo-chmod-755-%2F-0"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="gutter"><div class="line number1 index0 alt2">1</div><div class="line number2 index1 alt1">2</div></td><td class="code"><div class="container"><div class="line number1 index0 alt2">`sudo`` ``chmod`` 755 ``/etc/init``.d``/livestream``.sh`</div><div class="line number2 index1 alt1">`sudo`` update-rc.d livestream.sh defaults`</div></div></td></tr></tbody></table>

</div></div></div>Now you can reboot your pi, or use commands like ‘sudo service livestream start’ I rebooted my pi, and my fed was running, and running a status command on my service yields:

<div class="wp-block-syntaxhighlighter-code" id="bkmrk-1-2-3-4-5-6-7-8-9-10-1"><div><div class="syntaxhighlighter  bash" id="bkmrk-1-2-3-4-5-6-7-8-9-10-4"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="gutter"><div class="line number1 index0 alt2">1</div><div class="line number2 index1 alt1">2</div><div class="line number3 index2 alt2">3</div><div class="line number4 index3 alt1">4</div><div class="line number5 index4 alt2">5</div><div class="line number6 index5 alt1">6</div><div class="line number7 index6 alt2">7</div><div class="line number8 index7 alt1">8</div><div class="line number9 index8 alt2">9</div><div class="line number10 index9 alt1">10</div><div class="line number11 index10 alt2">11</div><div class="line number12 index11 alt1">12</div><div class="line number13 index12 alt2">13</div><div class="line number14 index13 alt1">14</div><div class="line number15 index14 alt2">15</div><div class="line number16 index15 alt1">16</div><div class="line number17 index16 alt2">17</div><div class="line number18 index17 alt1">18</div><div class="line number19 index18 alt2">19</div><div class="line number20 index19 alt1">20</div></td><td class="code"><div class="container"><div class="line number1 index0 alt2">`pi@cam-pi-zero:~ $ ``sudo`` service livestream status`</div><div class="line number2 index1 alt1">`● livestream.service - LSB: mjpg_streamer ``for`` webcam`</div><div class="line number3 index2 alt2">`  `` Loaded: loaded (``/etc/init``.d``/livestream``.sh; generated)`</div><div class="line number4 index3 alt1">`  `` Active: active (running) since Thu 2020-05-14 11:46:09 CDT; 2min 51s ago`</div><div class="line number5 index4 alt2">`    `` Docs: ``man``:systemd-sysv-generator(8)`</div><div class="line number6 index5 alt1">` `` Process: 411 ExecStart=``/etc/init``.d``/livestream``.sh start (code=exited, status=0``/SUCCESS``)`</div><div class="line number7 index6 alt2">`  `` Memory: 2.2M`</div><div class="line number8 index7 alt1">`  `` CGroup: ``/system``.slice``/livestream``.service`</div><div class="line number9 index8 alt2">`          `` └─416 ``/usr/local/bin/mjpg_streamer`` -b -i input_uvc.so -f 15 -r 1920x1080 -o output_http.so`</div><div class="line number10 index9 alt1"> </div><div class="line number11 index10 alt2">`May 14 11:46:07 cam-pi-zero.``local`` mjpg_streamer[416]: MJPG-streamer [416]: TV-Norm...........: DEFAUL`</div><div class="line number12 index11 alt1">`May 14 11:46:08 cam-pi-zero.``local`` mjpg_streamer[416]: MJPG-streamer [416]: www-folder-path......: ``/us`</div><div class="line number13 index12 alt2">`May 14 11:46:08 cam-pi-zero.``local`` mjpg_streamer[416]: MJPG-streamer [416]: HTTP TCP port........: 808`</div><div class="line number14 index13 alt1">`May 14 11:46:08 cam-pi-zero.``local`` mjpg_streamer[416]: MJPG-streamer [416]: HTTP Listen Address..: (nu`</div><div class="line number15 index14 alt2">`May 14 11:46:08 cam-pi-zero.``local`` mjpg_streamer[416]: MJPG-streamer [416]: username:password....: dis`</div><div class="line number16 index15 alt1">`May 14 11:46:08 cam-pi-zero.``local`` mjpg_streamer[416]: MJPG-streamer [416]: commands.............: ena`</div><div class="line number17 index16 alt2">`May 14 11:46:08 cam-pi-zero.``local`` mjpg_streamer[416]: MJPG-streamer [416]: starting input plugin inpu`</div><div class="line number18 index17 alt1">`May 14 11:46:08 cam-pi-zero.``local`` mjpg_streamer[416]: MJPG-streamer [416]: starting output plugin: ou`</div><div class="line number19 index18 alt2">`May 14 11:46:09 cam-pi-zero.``local`` livestream.sh[411]: [+] mjpg_streamer started`</div><div class="line number20 index19 alt1">`May 14 11:46:09 cam-pi-zero.``local`` systemd[1]: Started LSB: mjpg_streamer ``for`` webcam.`</div></div></td></tr></tbody></table>

</div></div></div>## Conclusion

Using the Raspberry Pi for video streams is good enough if we’re looking for low frame rate monitoring without audio. I’ve yet to find anything that really gives me the frame rate and audio (regardless of latency) that a standard USB webcam directly into my OBS machine would give. Maybe if NDI ever makes it on to the raspberry Pi, or if there is ever SLDP support.

Have you tried streaming across the network on a Raspberry Pi with a USB webcam? Did you fare better than I? Let me know!

Nevertheless, with that, I’m done! I can now embed this into OBS via the VLC media source or anything that can handle an HTTP Motion JPEG video stream. I won’t have audio, but that’s okay for what I’m using this for.

## Raspi-Cameras (libcamera is in, raspivid is out in Bullseye)

Mjpg-Streamer won’t have the raspicam input module anymore if you compile on Bullseye, because I believe the headers don’t exist as the Bullseye version is going the way of libcamera. While I was able to hack around that and build it, I got HORRIBLE artifacts using a raspberry pi camera with the h264 codec and libcamera. I tried switching codecs to MJPEG instead of H264 and had less artifacts, but worse frame rate. So for now I decided to go with gstreamer instead of mjpg-streamer at 1280×720 for a nice 30fps solution.

For me, what worked was to enable the legacy raspi-camera support (so we’re not using libcamera, we’re using v4l2).

Here are the rough steps:

- Started out with Bullseye, latest install with sudo apt update/sudo apt upgrade executed.
- Edit /boot/config.txt and change the following: 
    - start\_x=1 //add this line
    - gpu\_mem=128 //probably no higher
    - \#camera\_auto\_detect=1 //Comment this line out
- Restart
- Installs:

<div class="wp-block-syntaxhighlighter-code" id="bkmrk-1-2-sudo-apt-get-ins"><div><div class="syntaxhighlighter  bash" id="bkmrk-1-2-sudo-apt-get-ins-0"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="gutter"><div class="line number1 index0 alt2">1</div><div class="line number2 index1 alt1">2</div></td><td class="code"><div class="container"><div class="line number1 index0 alt2">`sudo`` apt-get ``install`` gstreamer1.0-tools gstreamer1.0-plugins-base \`</div><div class="line number2 index1 alt1">`    `` gstreamer1.0-plugins-good gstreamer1.0-plugins-bad`</div></div></td></tr></tbody></table>

</div></div></div>Then execute this on the command line:

<div class="wp-block-syntaxhighlighter-code" id="bkmrk-1-%2Fusr%2Fbin%2Fgst-launc"><div><div class="syntaxhighlighter  bash" id="bkmrk-1-%2Fusr%2Fbin%2Fgst-launc-0"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="gutter"><div class="line number1 index0 alt2">1</div></td><td class="code"><div class="container"><div class="line number1 index0 alt2">`/usr/bin/gst-launch-1``.0 v4l2src ! video``/x-h264``,width=1280,height=720,framerate=30``/1`` ! h264parse config-interval=1 ! matroskamux streamable=``true`` ! tcpserversink host=::0 port=9000 ``sync``=``false`` ``sync``-method=2`</div></div></td></tr></tbody></table>

</div></div></div>Once that’s up and running, I ran VLC against it using :network-caching=250 and a URL of tcp://&lt;yourhostname&gt;:9000 and was able to get a decent stream. That’s about the extent I’ve been pushing the raspi-cameras as I typically use the USB side. I did notice it was nice and fluid, along with less power consumption by a 100 milliamps or so, so I think I’ll use this as a portable battery powered wireless camera to use around the house on streams. Hmmm, I may need to look at getting a microphone on here somehow and streaming audio with gstreamer as well.