no picture with fswebcam - python-3.x

A month ago, I test the following code to take picture with my webcam connected to a Raspberry pi (I used python3).
import os
import datetime
os.system ("fswebcam -d/dev/video0 -r640x480 /home/pi/Documents/%s.jpeg" %datetime.datetime.utcnow().strftime (%Y-%m-%d- -%H-%M-%S"))
It works well and I had no problem but, since a week or so, it doesn't work anymore. The code returns no error message but, there is no picture in the 'Documents' folder. Everything seems to indicate that pictures are taken, but I cannot find them.
I looked for the pictures in the other folders but couldn't find them.
I updated the raspberry pi but it changed nothing.
I tried to run the script 'alone' with the command line
fswebcam -r 640x480 test.jpeg
The picture is taken and appears in the home/pi/ folder.
I tried to run the script as a super user but it opens the help menu of fswebcam. (???)
does one of you have an idea why it does not work anymore, what I did wrong and where are my pictures?

Your script might be changed, you should check it or change to another folder.
Because Raspberry Pi has no realtime, so you should consider this point if you set names of pictures according to the "date", so there might be the new pictures are saved in Documents folder but overwrite old pictures.

Related

Problem with Imagemagick import (import-im6.q16) jammy/gnome

I use Imagemagick's "import" (import-im6.q16) a lot for capturing screen data. And it works great on my primary workstation using the Mate desktop.
But I am trying to use it on Jammy/Gnome and it just hangs.
Nothing in any of the obvious logs (syslog,Xorg). Searched the web and the Imagemagick communities and come up empty.
Executing import tmp.png should turn the "cross-hair" cursor on and allow selection of a region of the default X display. Upon "mouse up", the selected region is written to the file specified. An existing file will be overwritten permissions permitting. The suffix should be an image file type or errors can occur (.pdf is an example).
Can anyone confirm this is broken or working with Gnome?

Garageband Save & Save As & Export Buttons Do Not Function

I recently started making music using GarageBand's MIDI software. I've made it up to a certain point, where losing all my progress would be disastrous.
Here's the issue I have:
When I go to File > Save/Save As or just cmd+S or cmd+shift+S, or Share > Export Song to Disk, instead of functioning and saving the file (I checked in Finder; last time I exited the app without saving due to this issue, the untitled garageband file disappeared) properly onto the app, it would either do nothing or give me the rainbow wheel of death for 10-20 seconds and then proceed to not function.
I've searched online for answers to this, and there were several (2) users I found that had the same problem. Their post either had no answer or the answer was unintuitive (such as always using a different, more complicated method to save, like messing around with the garageband files themselves everytime to save).
I'm looking for an answer to this issue that would result in slightly more convenient, one-time edits to the app / any software beneath that would fix this issue, if there are any. However, if the community has any alternate way to save the file right now, I would greatly appreciate it.
======
Also:
Since I'd assume most of the solutions would involve closing the app and then making edits, then reinstalling it, please tell me if I could just copy the notes (not the tracks) onto a text document and paste it into the new file after. I would prefer to save my music.
Try this . . .
First QUIT Garageband (yes you will lose unsaved work).
Find the Garageband folder where all the .BAND files are saved. Usually it is in Users -> Username -> Music -> Garageband.
Move older .band files into another folder (EG: "Garageband OLD")
Then start a new project (or open a project still in the Garageband folder).
Save and Save-As should now work.
It seems there is some sort of file limit for the Garageband folder. In my case the file limit is either 170 .band files or about 125GB.
I am currently using Garageband 10.3.5 on High Sierra.

Batch fixing corrupted JPG files?

Ugh. So I went on a vacation in Indonesia and the photographer just sent (after 6 weeks) a USB with about 300 photos, each 6.5 or so MB large...and only FOUR open up into actual JPGs. EVERY OTHER IMAGE doesn't display a thumbnail and won't open -- I've tried renaming the files as JPGs, tried guessing if it's a png or gif and renaming them that way, tried dragging into Chrome (apparently a robust file viewer).
When I open with Image Viewer (I'm on Lubuntu 18.04LTS) I get an error:
"Not a JPEG file: starts with 0xff 0xff"
And when I use "file" I get this:
"ISO-8859 text, with very long lines and no line terminators"
Sooooo...that's why these aren't opening up. Unfortunately I can't reconnect with the driver so my ONLY hope in getting these vacation pics is to somehow bulk fix them. Even if it's painful. I don't have much hope but if anyone knows what's happened I would love to know if there's anything I can try. I am thinking doing some kind of hex editor might remove the initial tag and make it a JPG again??? The fact that they are the right size seems to make me think maybe it's just a small thing that has gotten borked here and maybe I could fix it manually.
As mentioned above, running Lubuntu 18.04LTS. Any help or thoughts would be great.

force vlc to load ui on raspberry booted to cli

I've been googling for this all week, struggling to find a good solution.
I have a training video kiosk script that I've set up for my company, running on an intel NUC. to me, that feels like overkill, so I'm trying to get the script to run on a pi 3 model b to save a little on costs to deploy this thing.
my script works great from desktop, I've been able to get it to run on startup from the cli, & I can even load the videos with the dummy UI - the problem is that there's no sound, and when the video loads in the cli, it fills the screen with errors, then plays as text, like the picture below.
If I run it from desktop, it's fine (just really jittery)
is there a way to force vlc to load its interface without loading the desktop of raspian?
right now, when I call a video, the terminal line inputs like:
vlc-wrapper <file path> --play-and-exit --fullscreen -Idummy
video image
got it to load the video
from command line:
X & vlc <filepath>
also got it to run from python
import os.subprocess
subprocess.call(['xinit', '--', '/usr/bin/vlc-wrapper, '<filepath>'])

Terminal not clearing after auto start bashscript in raspbian wheezy

I'm using a raspberry pi 2 to show all the video's in a folder. The raspberry automatically boots up (with a generic electric timer) in to console (not the gui) and after it boots it runs a bashscript I found here. This bashscript contains an infinite loop to play all the videos in a folder using omxplayer.
When I boot in to consolemode and manually start the script everything works perfectly. The terminal screen clears, the first video starts, and after it ends there is a second or two of black screen (empty terminal) and the second video starts playing. This is exactly what I want.
However, when I use crontab to start this script (#reboot /path/to/script.sh) the terminal messages stay and it doesn't clear everything between video's.
I've tried creating my own script that first clears everything, and then calls the second script. But this doesn't work.
I'm really really new in this field (but I'm having fun) so any pointers in the right direction would be appreciated!
P.S. I edited the /boot/cmdline.txt file so it doesn't display critical kernal logs as a work-around.
You should not be doing this using cron. You should be changing the inittab so that it runs outside any environment that may be created. See the inittab(5) man page for details. You may also be interested in openvt(1) as well.

Resources