{"id":1624,"date":"2015-08-04T21:12:06","date_gmt":"2015-08-04T20:12:06","guid":{"rendered":"https:\/\/stevepedwards.today\/DebianAdmin\/?p=1624"},"modified":"2015-08-04T21:12:06","modified_gmt":"2015-08-04T20:12:06","slug":"first-python-scripts-for-pi-camera","status":"publish","type":"post","link":"https:\/\/stevepedwards.today\/DebianAdmin\/first-python-scripts-for-pi-camera\/","title":{"rendered":"First Python Scripts For Pi Camera"},"content":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_1624\" class=\"pvc_stats all  \" data-element-id=\"1624\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p><a href=\"https:\/\/www.raspberrypi.org\/documentation\/hardware\/camera.md\" target=\"_blank\">https:\/\/www.raspberrypi.org\/documentation\/hardware\/camera.md<\/a><\/p>\n<p>I'm not a programmer at all - never was - I tried a few times at college with C and Java, but hated it...<\/p>\n<p>So this is an enjoyable start for me, as there is immediate satisfaction, as Python is \"English\"; plain and simple as it gets with programming - so far anyway - one script only into it.<\/p>\n<p>But at least it works immediately, with just python3, some libs and tools installed and the vim editor to write\/paste with!<\/p>\n<p>All I have done with the PiCam is enable it and create a video, as you saw in the prior posts using:<\/p>\n<p><span style=\"color: #0070c0;\">raspi-config<br \/>\n<\/span><\/p>\n<p><span style=\"color: #0070c0;\">raspivid -o \/vidname.h264<br \/>\n<\/span><\/p>\n<p><iframe loading=\"lazy\" title=\"PiVidTest.H264\" width=\"1778\" height=\"1000\" src=\"https:\/\/www.youtube.com\/embed\/oNYevgEVuV8?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p>You can change the view time of that to a ten second long recording:<\/p>\n<p><span style=\"color: #0000ff;\">raspivid -t 10000 -o \/videoname.h264<\/span><\/p>\n<p>Your h264 video is viewable in VLC for Windows\/Mint, or in the Pi using the same method for the \"hello...\" range of examples in the \/opt\/vc\/src\/hello_pi\/hello_video folders, using the latent binary prefix:<\/p>\n<p>root@pi:\/opt\/vc\/src\/hello_pi\/hello_video# <span style=\"color: #0070c0;\">.\/hello_video.bin test.h264<br \/>\n<\/span><\/p>\n<p><iframe loading=\"lazy\" title=\"BigBuckBunny.h264\" width=\"1778\" height=\"1000\" src=\"https:\/\/www.youtube.com\/embed\/B9SaBsnrTrI?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p>So, how to get the camera going to make vids and pics in Python, learn functionality and get up to a point where video can be streamed for a surveillance camera?<\/p>\n<p><a href=\"https:\/\/www.raspberrypi.org\/documentation\/raspbian\/applications\/camera.md\" target=\"_blank\">https:\/\/www.raspberrypi.org\/documentation\/raspbian\/applications\/camera.md<\/a><\/p>\n<p><a href=\"https:\/\/www.raspberrypi-spy.co.uk\/2015\/07\/robotsentry-home-security-system-part-1\/\" target=\"_blank\">https:\/\/www.raspberrypi-spy.co.uk\/2015\/07\/robotsentry-home-security-system-part-1\/<\/a><\/p>\n<p>Research weblinks of course, but it would be good to get some background tech understanding too eh?<\/p>\n<p>The initial hard part is finding out what you may need to get the camera setup optimally at first with firmware updates etc. so it is compatible with whatever environment you decide to use, as there are options.<\/p>\n<p>I found these introductory pages useful to get started as a background and first scripts sources:<\/p>\n<p><a href=\"https:\/\/picamera.readthedocs.org\/en\/latest\/install3.html\">https:\/\/picamera.readthedocs.org\/en\/latest\/install3.html<\/a><\/p>\n<p><a href=\"https:\/\/www.pyimagesearch.com\/2015\/03\/30\/accessing-the-raspberry-pi-camera-with-opencv-and-python\/\">https:\/\/www.pyimagesearch.com\/2015\/03\/30\/accessing-the-raspberry-pi-camera-with-opencv-and-python\/<\/a><\/p>\n<p><a href=\"https:\/\/www.raspberrypi.org\/blog\/picamera-pure-python-interface-for-camera-module\/\">https:\/\/www.raspberrypi.org\/blog\/picamera-pure-python-interface-for-camera-module\/<\/a><\/p>\n<p>First, I upgraded the firmware for the Pi from the first link - important I feel, to have a reference for where you start, with what capabilities for debug later:<\/p>\n<p><em>You can determine the revision of your current firmware with the following command:<\/em><\/p>\n<p><em>$ <span style=\"color: #0000ff;\">uname -a<\/span><\/em><\/p>\n<p><em>The firmware revision is the number after the\u00a0#:<\/em><\/p>\n<p><em>Linux kermit 3.12.26+ #707 PREEMPT Sat Aug 30 17:39:19 BST 2014 armv6l GNU\/Linux<\/em><\/p>\n<p><em> \/<\/em><\/p>\n<p><em> \/<\/em><\/p>\n<p style=\"background: white;\"><em> firmware revision --+<span style=\"color: #404040; font-family: Consolas; font-size: 5pt;\"><br \/>\n<\/span><\/em><\/p>\n<p><em>On Raspbian, the standard upgrade procedure should keep your firmware up to date:<\/em><\/p>\n<p><em>$ sudo <span style=\"color: #0000ff;\">apt-get update<\/span><\/em><\/p>\n<p style=\"background: white;\"><em>$ sudo <span style=\"color: #0000ff;\">apt-get upgrade<\/span><\/em><span style=\"color: #404040; font-family: Consolas; font-size: 5pt;\"><br \/>\n<\/span><\/p>\n<p><em>Warning<\/em><\/p>\n<p><em>Previously, these documents have suggested using the\u00a0rpi-update\u00a0utility to update the Pi's firmware; this is now discouraged. If you have previously used the\u00a0rpi-update\u00a0utility to update your firmware, you can switch back to using\u00a0apt\u00a0to manage it with the following commands:<\/em><\/p>\n<pre><em>$ sudo <span style=\"color: #0000ff;\">apt-get update\n<\/span><\/em><\/pre>\n<pre><em>$ sudo <span style=\"color: #0000ff;\">apt-get install --reinstall libraspberrypi0 libraspberrypi-{bin,dev,doc} raspberrypi-bootloader\n<\/span><\/em><\/pre>\n<pre><em>$ sudo <span style=\"color: #0000ff;\">rm \/boot\/.firmware_revision\n<\/span><\/em><\/pre>\n<p><em>You will need to reboot after doing so.<\/em><\/p>\n<p>After the update, I installed:<\/p>\n<p><span style=\"color: #0070c0;\">apt-get install python3-picamera<br \/>\n<\/span><\/p>\n<p><span style=\"color: #0070c0;\">apt-get install libav-tools<br \/>\n<\/span><\/p>\n<p><span style=\"color: #0070c0;\">man python3<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\">DESCRIPTION<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\"> Python is an interpreted, interactive, object-oriented programming<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\"> language that combines remarkable power with very clear syntax. For<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\"> an introduction to programming in Python you are referred to the<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\"> Python Tutorial. The Python Library Reference documents built-in and<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\"> standard types, constants, functions and modules. Finally, the<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\"> Python Reference Manual describes the syntax and semantics of the<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\"> core language in (perhaps too) much detail. (These documents may be<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\"> located via the INTERNET RESOURCES below; they may be installed on<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\"> your system as well.)<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\"> Python's basic power can be extended with your own modules written in<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\"> C or C++. On most systems such modules may be dynamically loaded.<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\"> Python is also adaptable as an extension language for existing appli\u00c3:<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\"> cations. See the internal documentation for hints.<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\"> Documentation for installed Python modules and packages can be viewed<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\"> by running the pydoc program.<br \/>\n<\/span><\/p>\n<p>So far this first script works the camera directly with:<\/p>\n<p><span style=\"color: #0070c0;\">python3 \/scriptname.py<br \/>\n<\/span><\/p>\n<p>but exact use will depend on your initial environment choice from the links above - OPENCV, etc. - and whether you \"sandbox\" it using that or not. I just wanted to copy and paste a script into a vim text doc and be able to run it, and that is working so far using the code example in a text doc:<\/p>\n<p><span style=\"color: #0070c0;\">vi \/pythonpi1.py<br \/>\n<\/span><\/p>\n<p>-------<\/p>\n<p><span style=\"color: #ff0000;\">import picamera<\/span><\/p>\n<p><span style=\"color: #ff0000;\">from time import sleep<\/span><\/p>\n<p><span style=\"color: #ff0000;\">camera = picamera.PiCamera()<\/span><\/p>\n<p><span style=\"color: #ff0000;\">camera.capture('image.jpg')<\/span><\/p>\n<p><span style=\"color: #ff0000;\">camera.start_preview()<\/span><\/p>\n<p><span style=\"color: #ff0000;\">camera.vflip = 0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">camera.hflip = 0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">camera.brightness = 60<\/span><\/p>\n<p><span style=\"color: #ff0000;\">camera.start_recording('video.h264')<\/span><\/p>\n<p><span style=\"color: #ff0000;\">sleep(5)<\/span><\/p>\n<p><span style=\"color: #ff0000;\">camera.stop_recording()<\/span><\/p>\n<p>----------<\/p>\n<p><span style=\"color: #0070c0;\">python3 \/pythonpi1.py<br \/>\n<\/span><\/p>\n<p>You should get about a 5sec TV output from the camera.<\/p>\n<p>Now, this is where it gets interesting! How to get that stream into a file for viewing after?<\/p>\n<p>I tried various crude pipe methods (I'm not a script kid either!) like:<\/p>\n<p><span style=\"color: #0070c0;\">python3 \/pythonpi1.py &gt;&gt; \/Share\/pythonpi1.h264<br \/>\n<\/span><\/p>\n<p><span style=\"color: #0070c0;\">python3 \/pythonpi1.py pipe:1 | \/Share\/pythonpi1.h264 <\/span>(from the ffmpeg man page)<\/p>\n<p><span style=\"color: #0070c0;\">python3 \/pythonpi1.py | cat &gt; \/Share\/pythonpi1.h264<\/span><\/p>\n<p>to no avail, but what did work, with complaints, was:<\/p>\n<p><span style=\"color: #0070c0;\">python3 \/pythonpi1.py | raspivid -o \/PiShare\/pythonpi1.h264<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\">mmal: mmal_vc_component_enable: failed to enable component: ENOSPC<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\">Traceback (most recent call last):<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\"> File \"\/pythonpi1.py\", line 4, in &lt;module&gt;<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\"> camera = picamera.PiCamera()<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\"> File \"\/usr\/lib\/python3\/dist-packages\/picamera\/camera.py\", line 488, in __init__<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\"> self.STEREO_MODES[stereo_mode], stereo_decimate)<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\"> File \"\/usr\/lib\/python3\/dist-packages\/picamera\/camera.py\", line 620, in _init_camera<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\"> prefix=\"Camera component couldn't be enabled\")<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\"> File \"\/usr\/lib\/python3\/dist-packages\/picamera\/exc.py\", line 191, in mmal_check<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\"> raise PiCameraMMALError(status, prefix)<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\">picamera.exc.PiCameraMMALError: Camera component couldn't be enabled: Out of resources (other than memory)<br \/>\n<\/span><\/p>\n<p><iframe loading=\"lazy\" title=\"pythonpi1.h264\" width=\"1778\" height=\"1000\" src=\"https:\/\/www.youtube.com\/embed\/WvrrxewG_sQ?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p>I can look at all that fault output later for reasons and understanding, but for now, just using what I know so far, I have something functional and an incentive to build on, for the overall goal of getting surveillance setup at work sometime but having a bit more working knowledge and camera familiarity, even if using another App like ZoneMinder (zm) or other, and following someone else's instructions.<\/p>\n<p>Add the other lines in for the fade from light to dark also, and uncomment them to see the effect:<\/p>\n<p><span style=\"color: red;\">-<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\">import picamera<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\">from time import sleep<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\">camera = picamera.PiCamera()<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\">camera.capture('image.jpg')<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\">camera.start_preview()<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\">camera.vflip = 0<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\">camera.hflip = 0<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\">camera.brightness = 60<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\">#for i in range(100):<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\"># camera.brightness = i<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\"># sleep(0.1)<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\">camera.start_recording('video.h264')<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\">sleep(5)<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\">camera.stop_recording()<br \/>\n<\/span><\/p>\n<p><span style=\"color: red;\">-<\/span><\/p>\n<p>The uncommented version does not save the fade output to the vid file oddly, so I can't show it, it's just a normal vid...?<\/p>\n<p>You can also run vids on the Pi with:<\/p>\n<p><span style=\"color: #0000ff;\">omxplayer \/PiShare\/Buck.h264<\/span><\/p>\n<p>Get the whole movie with sound in a format to suit here:<\/p>\n<p><a href=\"https:\/\/peach.blender.org\/download\/\" target=\"_blank\">https:\/\/peach.blender.org\/download\/<\/a><\/p>\n<p><span style=\"color: #0000ff;\">avplay \/PiShare\/big_buck_bunny_720p_stereo.mov<\/span><br \/>\n<span style=\"color: #ff0000;\">avplay version 9.14-6:9.14-1rpi1rpi1, Copyright (c) 2003-2014 the Libav develope<\/span><br \/>\n<span style=\"color: #ff0000;\">rs<\/span><br \/>\n<span style=\"color: #ff0000;\"> built on Jul 22 2014 15:08:12 with gcc 4.6 (Debian 4.6.3-14+rpi1)<\/span><br \/>\n<span style=\"color: #ff0000;\">Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\/PiShare\/big_buck_bunny_720p_stereo.mov<\/span><br \/>\n<span style=\"color: #ff0000;\">':<\/span><br \/>\n<span style=\"color: #ff0000;\"> Metadata:<\/span><br \/>\n<span style=\"color: #ff0000;\"> major_brand : qt<\/span><br \/>\n<span style=\"color: #ff0000;\"> minor_version : 512<\/span><br \/>\n<span style=\"color: #ff0000;\"> compatible_brands: qt<\/span><br \/>\n<span style=\"color: #ff0000;\"> encoder : Lavf54.20.4<\/span><br \/>\n<span style=\"color: #ff0000;\"> Duration: 00:09:56.45, start: 0.000000, bitrate: 3761 kb\/s<\/span><br \/>\n<span style=\"color: #ff0000;\"> Stream #0.0(eng): Video: msmpeg4v2, yuv420p, 1280x720, 3556 kb\/s, 24 fps, 24<\/span><br \/>\n<span style=\"color: #ff0000;\"> tbr, 24 tbn<\/span><br \/>\n<span style=\"color: #ff0000;\"> Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, fltp, 200 kb\/s<\/span><\/p>\n<p>If you have QT - guess what?<\/p>\n<p><em>MOV H264 video, AAC surround sound Apple Quicktime Compatible. (has audio playback problems with VLC and possibly other non-QT players on stereo systems; VLC users should choose one of the other formats)<\/em><\/p>\n<p>If you want picture filter\/effect options, there is script for 6 pics here, with 90 degree tilt for some reason:<\/p>\n<p><a href=\"https:\/\/wget https:\/\/www.raspberrypi-spy.co.uk\/archive\/python\/pi_camera_options.py\" target=\"_blank\">wget https:\/\/www.raspberrypi-spy.co.uk\/archive\/python\/pi_camera_options.py<\/a><\/p>\n<p>then run:<\/p>\n<p><span style=\"color: #0000ff;\">\u00a0python pi_camera_options.py<\/span><\/p>\n<p>Just found a series of pages that cover a lot of requirements for streaming and surveillance:<\/p>\n<p><a href=\"https:\/\/www.linux-magazine.com\/Issues\/2014\/160\/PiCam-Surveillance\" target=\"_blank\">https:\/\/www.linux-magazine.com\/Issues\/2014\/160\/PiCam-Surveillance<\/a><\/p>\n<p><a href=\"https:\/\/www.linux-magazine.com\/Issues\/2014\/160\/PiCam-Surveillance\/(offset)\/3\" target=\"_blank\">https:\/\/www.linux-magazine.com\/Issues\/2014\/160\/PiCam-Surveillance\/(offset)\/3<\/a><\/p>\n<p><a href=\"https:\/\/www.linux-magazine.com\/Issues\/2007\/83\/Motion-Detection\" target=\"_blank\">https:\/\/www.linux-magazine.com\/Issues\/2007\/83\/Motion-Detection<\/a><\/p>\n<p><a href=\"https:\/\/www.linux-magazine.com\/Issues\/2011\/125\/Security-Lessons-Secure-Video\" target=\"_blank\">https:\/\/www.linux-magazine.com\/Issues\/2011\/125\/Security-Lessons-Secure-Video<\/a><\/p>\n<p><a href=\"https:\/\/www.linux-magazine.com\/Issues\/2012\/143\/Surveillance-with-NAS\" target=\"_blank\">https:\/\/www.linux-magazine.com\/Issues\/2012\/143\/Surveillance-with-NAS<\/a><\/p>\n<p>...but you have to buy them..duh...<\/p>\n<p>Basic streaming from that to another host:<\/p>\n<p>MintPC stevee # <span style=\"color: #0000ff;\">nc -l -p 4444 &gt;&gt; Downloads\/pistreamtest.h264<\/span><\/p>\n<p>root@pi:\/home\/stevee# <span style=\"color: #0000ff;\">raspivid -t 0 -o - | nc mintpc 4444<\/span><\/p>\n<p>MintPC stevee # <span style=\"color: #0000ff;\">ls -als Downloads\/pistreamtest.h264<\/span><br \/>\n<span style=\"color: #ff0000;\">61180 -rw-r--r-- 1 root root 62648320 Aug 5 23:48 Downloads\/pistreamtest.h264<\/span><\/p>\n<p>I could play back this streamed and saved video with VLC; after a directory perms change:<\/p>\n<p>MintPC stevee # <span style=\"color: #0000ff;\">vlc Downloads\/pistreamtest.h264<\/span><br \/>\n<span style=\"color: #ff0000;\">VLC is not supposed to be run as root. Sorry.<\/span><br \/>\n<span style=\"color: #ff0000;\">If you need to use real-time priorities and\/or privileged TCP ports<\/span><br \/>\n<span style=\"color: #ff0000;\">you can use vlc-wrapper (make sure it is Set-UID root and<\/span><br \/>\n<span style=\"color: #ff0000;\">cannot be run by non-trusted users first).<\/span><br \/>\nMintPC stevee # <span style=\"color: #0000ff;\">exit<\/span><br \/>\nexit<br \/>\nstevee@MintPC ~ $ <span style=\"color: #0000ff;\">vlc Downloads\/pistreamtest.h264<\/span><br \/>\n<span style=\"color: #ff0000;\">VLC media player 2.1.6 Rincewind (revision 2.1.6-0-gea01d28)<\/span><br \/>\n<span style=\"color: #ff0000;\">Failed to create secure directory (\/run\/user\/1000\/pulse): Permission denied<\/span><br \/>\n<span style=\"color: #ff0000;\">[0xeb85e8] pulse audio output error: PulseAudio server connection failure: Connection refused<\/span><br \/>\n<span style=\"color: #ff0000;\">Failed to create secure directory (\/run\/user\/1000\/pulse): Permission denied<\/span><br \/>\n<span style=\"color: #ff0000;\">^C<\/span><br \/>\n<span style=\"color: #ff0000;\">^Z<\/span><br \/>\n<span style=\"color: #ff0000;\">[1]+ Stopped vlc Downloads\/pistreamtest.h264<\/span><br \/>\nstevee@MintPC ~ $ <span style=\"color: #0000ff;\">sudo mkdir \/run\/user\/1000\/pulse<\/span><br \/>\n<span style=\"color: #ff0000;\">[sudo] password for stevee: <\/span><br \/>\n<span style=\"color: #ff0000;\">mkdir: cannot create directory \\u2018\/run\/user\/1000\/pulse\\u2019: File exists<\/span><br \/>\nstevee@MintPC ~ $<span style=\"color: #0000ff;\"> chmod 755 \/run\/user\/1000\/pulse<\/span><br \/>\n<span style=\"color: #ff0000;\">chmod: changing permissions of \\u2018\/run\/user\/1000\/pulse\\u2019: Operation not permitted<\/span><br \/>\nstevee@MintPC ~ $ <span style=\"color: #0000ff;\">sudo chmod 755 \/run\/user\/1000\/pulse<\/span><br \/>\nstevee@MintPC ~ $ <span style=\"color: #0000ff;\">vlc Downloads\/pistreamtest.h264<\/span><br \/>\n<span style=\"color: #ff0000;\">VLC media player 2.1.6 Rincewind (revision 2.1.6-0-gea01d28)<\/span><br \/>\n<span style=\"color: #ff0000;\">[0x885118] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.<\/span><br \/>\n<span style=\"color: #ff0000;\">[h264 @ 0x7f9640c20c20] Estimating duration from bitrate, this may be inaccurate<\/span><br \/>\n<span style=\"color: #ff0000;\">\"sni-qt\/5496\" WARN 00:03:27.625 void StatusNotifierItemFactory::connectToSnw() Invalid interface to SNW_SERVICE <\/span><br \/>\n<span style=\"color: #ff0000;\">[0x7f9640c0f8d8] main input error: Invalid PCR value in ES_OUT_SET_(GROUP_)PCR !<\/span><br \/>\n<span style=\"color: #ff0000;\">Fontconfig warning: FcPattern object size does not accept value \"0\"<\/span><br \/>\n<span style=\"color: #ff0000;\">Fontconfig warning: FcPattern object size does not accept value \"0\"<\/span><br \/>\n<span style=\"color: #ff0000;\">Fontconfig warning: FcPattern object size does not accept value \"0\"<\/span><br \/>\n<span style=\"color: #ff0000;\">Fontconfig warning: FcPattern object size does not accept value \"0\"<\/span><br \/>\n<span style=\"color: #ff0000;\">[0x7f9610001248] main vout display error: Failed to resize display<\/span><\/p>\n<p>There is a whole management package for xxx Euros I am researching now, here:<\/p>\n<p><a href=\"https:\/\/picam.tgd-consulting.de\/\" target=\"_blank\">https:\/\/picam.tgd-consulting.de\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_1624\" class=\"pvc_stats all  \" data-element-id=\"1624\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p>https:\/\/www.raspberrypi.org\/documentation\/hardware\/camera.md I'm not a programmer at all - never was - I tried a few times at college with C and Java, but hated it... So this is an enjoyable start for me, as there is immediate satisfaction, as Python is \"English\"; plain and simple as it gets with programming - so far anyway - <a href=\"https:\/\/stevepedwards.today\/DebianAdmin\/first-python-scripts-for-pi-camera\/\" class=\"more-link\">...<span class=\"screen-reader-text\">\u00a0 First Python Scripts For Pi Camera<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-1624","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"a3_pvc":{"activated":true,"total_views":1,"today_views":0},"_links":{"self":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/1624","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/comments?post=1624"}],"version-history":[{"count":0,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/1624\/revisions"}],"wp:attachment":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/media?parent=1624"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/categories?post=1624"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/tags?post=1624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}