News:

LATEST RELEASE:  FPP 8.5.1 - Download from here - https://github.com/FalconChristmas/fpp/releases/tag/8.5

+-+-

+-User

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+-Site Stats

Members
Total Members: 16896
Latest: nolatron
New This Month: 12
New This Week: 0
New Today: 0
Stats
Total Posts: 135485
Total Topics: 16987
Most Online Today: 159
Most Online Ever: 7634
(January 21, 2020, 02:14:03 AM)
Users Online
Members: 0
Guests: 52
Total: 52

Video Capture and Output to Matrix

Started by Kensington Graves, April 26, 2020, 09:07:44 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

CaptainMurdoch

Quote from: Kensington Graves on June 22, 2020, 04:46:24 PMtail /home/fpp/media/logs/fppd.log

2020-06-22 02:33:42.569 (2485) src/v4l2Capture.cpp:246: v4l2_ioctl() failed: No such device
2020-06-22 02:33:42.569 (2485) src/v4l2Capture.cpp:246: v4l2_ioctl() failed: No such device
2020-06-22 02:33:42.569 (2485) src/v4l2Capture.cpp:246: v4l2_ioctl() failed: No such device 

For some reason one of the calls is failing.  I just added some more error checking which should check for this situation and stop capturing.  The capture thread was still running and that was what was spamming the logs.  The latest code will stop capturing and we should be able to see the last error message in the logs indicating why the capture stopped.

Can you pull in the latest plugin updates and try again?
-
Chris

Kensington Graves

#76
I updated to the latest version of master branch to rebuild fppd.  I removed the old plugin, rebooted, reinstalled, rebooted, and attempted to snap a preview.  The plugin opened with the correctly-sized preview window (640x480; camera default), but I could not capture a frame--pressed the button, nothing happened (no green crop box or anything).  I've posted the tails from the logs you had me post last time.  lsusb still finds the camera.  The logs are not being spammed anymore--at least I don't see massive files and the messages tail doesn't show lost messages.

tail /home/fpp/media/logs/fppd.log

2020-06-23 06:19:03.070 (2036) log.c:230: Branch: master
2020-06-23 06:19:03.070 (2036) log.c:231: =========================================   
2020-06-23 06:19:03.084 (2036) common.cpp:663: JSON File /home/fpp/media/config/schedule.json does not exist
2020-06-23 06:19:03.577 (2036) channeloutput/channeloutput.c:399: Determined range needed 0 - 7
2020-06-23 06:19:03.605 (2036) command.c:74: Initializing Command Module
2020-06-23 06:19:03.606 (2036) Scheduler.cpp:788: Current Schedule: (Status: '+' = Enabled, '-' = Disabled, '!' = Outside Date Range, '*' = Repeat, Stop (G)raceful/(L)oop/(H)ard
2020-06-23 06:19:03.606 (2036) Scheduler.cpp:789: Stat Start & End Dates       Days         Start & End Times   Playlist
2020-06-23 06:19:03.607 (2036) Scheduler.cpp:790: ---- ----------------------- ------------ ------------------- ---------------------------------------------
2020-06-23 06:19:03.613 (2036) common.cpp:663: JSON File /home/fpp/media/config/co-universes.json does not exist
2020-06-23 06:19:03.616 (2036) fppd.c:746: Starting main processing loop


sudo tail /var/log/syslog

Jun 23 06:23:44 FPP systemd[2206]: Listening on GnuPG cryptographic agent and passphrase cache (access for web browsers).
Jun 23 06:23:44 FPP systemd[2206]: Reached target Timers.
Jun 23 06:23:44 FPP systemd[2206]: Reached target Sockets.
Jun 23 06:23:44 FPP systemd[2206]: Reached target Basic System.
Jun 23 06:23:44 FPP systemd[1]: Started User Manager for UID 500.
Jun 23 06:23:44 FPP systemd[2206]: Reached target Default. 
Jun 23 06:23:44 FPP systemd[2206]: Startup finished in 1.170s.
Jun 23 06:23:44 FPP systemd[1]: Started Session 3 of user fpp.
Jun 23 06:25:01 FPP CRON[2234]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Jun 23 06:25:01 FPP CRON[2233]: (root) CMD (test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ))


sudo tail /var/log/messages

Jun 23 06:15:25 FPP kernel: [   41.942016] uvcvideo 1-1:1.0: Entity type for entity Extension 2 was not initialized!
Jun 23 06:15:25 FPP kernel: [   41.942038] uvcvideo 1-1:1.0: Entity type for entity Processing 3 was not initialized!
Jun 23 06:15:25 FPP kernel: [   41.942048] uvcvideo 1-1:1.0: Entity type for entity Camera 1 was not initialized!
Jun 23 06:15:25 FPP kernel: [   41.956910] input: HD USB Camera as /devices/platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1/usb1/1-1/1-1:1.0/input/input1
Jun 23 06:15:25 FPP kernel: [   41.962756] usbcore: registered new interface driver uvcvideo
Jun 23 06:15:25 FPP kernel: [   41.962769] USB Video Class driver (1.1.1)
Jun 23 06:15:50 FPP kernel: [   66.166027] remoteproc remoteproc0: 4a334000.pru is available
Jun 23 06:15:50 FPP kernel: [   66.170233] pru-rproc 4a334000.pru: PRU rproc node pru@4a334000 probed successfully
Jun 23 06:15:50 FPP kernel: [   66.178292] remoteproc remoteproc1: 4a338000.pru is available
Jun 23 06:15:50 FPP kernel: [   66.178417] pru-rproc 4a338000.pru: PRU rproc node pru@4a338000 probed successfully   ]
[/color]

CaptainMurdoch

Quote from: Kensington Graves on June 23, 2020, 07:35:42 AMI updated to the latest version of master branch to rebuild fppd.  I removed the old plugin, rebooted, reinstalled, rebooted, and attempted to snap a preview.  The plugin opened with the correctly-sized preview window (640x480; camera default), but I could not capture a frame--pressed the button, nothing happened (no green crop box or anything).  I've posted the tails from the logs you had me post last time.  lsusb still finds the camera.  The logs are not being spammed anymore--at least I don't see massive files and the messages tail doesn't show lost messages.

OK, good, so the plugin is correctly detecting that the video device failed to initialize.  I do need to add some code to detect a failure and attempt to reinit, but that wouldn't help in your case.

Quote from: Kensington Graves on June 23, 2020, 07:35:42 AMsudo tail /var/log/messages

Jun 23 06:15:25 FPP kernel: [   41.942016] uvcvideo 1-1:1.0: Entity type for entity Extension 2 was not initialized!
Jun 23 06:15:25 FPP kernel: [   41.942038] uvcvideo 1-1:1.0: Entity type for entity Processing 3 was not initialized!
Jun 23 06:15:25 FPP kernel: [   41.942048] uvcvideo 1-1:1.0: Entity type for entity Camera 1 was not initialized!

I think these may be the key.

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1626731  seems to indicate that something changed in the kernel which affected some UVC based cameras.

Can you try running "sudo apt-get -y install uvcdynctrl" and then rebooting the system and seeing if it helps.  Some comments in that thread and other related ones indicate that this solved their issue, but others said it didn't.
-
Chris

Kensington Graves

I pulled the update you asked for.  No effect.  Log tails below:

2020-06-23 18:53:40.820 (1336) log.c:231: ========================================= 
2020-06-23 18:53:40.867 (1336) common.cpp:663: JSON File /home/fpp/media/config/schedule.json does not exist
2020-06-23 18:53:41.840 (1336) src/FPP-VideoCapture.cpp:92: Device /dev/video0 does not exist
2020-06-23 18:53:41.957 (1336) channeloutput/channeloutput.c:399: Determined range needed 0 - 7
2020-06-23 18:53:42.042 (1336) command.c:74: Initializing Command Module                                                                             
2020-06-23 18:53:42.052 (1336) Scheduler.cpp:788: Current Schedule: (Status: '+' = Enabled, '-' = Disabled, '!' = Outside Date Range, '*' = Repeat, Stop (G)raceful/(L)oop/(H)ard
2020-06-23 18:53:42.052 (1336) Scheduler.cpp:789: Stat Start & End Dates       Days         Start & End Times   Playlist
2020-06-23 18:53:42.052 (1336) Scheduler.cpp:790: ---- ----------------------- ------------ ------------------- ---------------------------------------------
2020-06-23 18:53:42.077 (1336) common.cpp:663: JSON File /home/fpp/media/config/co-universes.json does not exist
2020-06-23 18:53:42.084 (1336) fppd.c:746: Starting main processing loop



Jun 23 19:03:21 FPP-Octoscroller systemd[2086]: Reached target Paths.
Jun 23 19:03:21 FPP-Octoscroller systemd[2086]: Listening on GnuPG network certificate management daemon.
Jun 23 19:03:21 FPP-Octoscroller systemd[2086]: Reached target Sockets.
Jun 23 19:03:21 FPP-Octoscroller systemd[2086]: Reached target Timers.
Jun 23 19:03:21 FPP-Octoscroller systemd[2086]: Reached target Basic System.
Jun 23 19:03:21 FPP-Octoscroller systemd[1]: Started User Manager for UID 500.
Jun 23 19:03:21 FPP-Octoscroller systemd[2086]: Reached target Default.
Jun 23 19:03:21 FPP-Octoscroller systemd[2086]: Startup finished in 420ms.
Jun 23 19:03:21 FPP-Octoscroller systemd[1]: Started Session 2 of user fpp.
Jun 23 19:05:01 FPP-Octoscroller CRON[2112]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)



Jun 23 18:53:42 FPP-Octoscroller kernel: [   43.386098] uvcvideo 1-1:1.0: Entity type for entity Extension 2 was not initialized!
Jun 23 18:53:42 FPP-Octoscroller kernel: [   43.386119] uvcvideo 1-1:1.0: Entity type for entity Processing 3 was not initialized!
Jun 23 18:53:42 FPP-Octoscroller kernel: [   43.386128] uvcvideo 1-1:1.0: Entity type for entity Camera 1 was not initialized!
Jun 23 18:53:42 FPP-Octoscroller kernel: [   43.386550] input: HD USB Camera as /devices/platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1/usb1/1-1/1-1:1.0/input/input1
Jun 23 18:53:42 FPP-Octoscroller kernel: [   43.394935] usbcore: registered new interface driver uvcvideo
Jun 23 18:53:42 FPP-Octoscroller kernel: [   43.394948] USB Video Class driver (1.1.1)
Jun 23 18:53:53 FPP-Octoscroller kernel: [   53.580305] remoteproc remoteproc0: 4a334000.pru is available                   
Jun 23 18:53:53 FPP-Octoscroller kernel: [   53.580466] pru-rproc 4a334000.pru: PRU rproc node pru@4a334000 probed successfully
Jun 23 18:53:53 FPP-Octoscroller kernel: [   53.586481] remoteproc remoteproc1: 4a338000.pru is available
Jun 23 18:53:53 FPP-Octoscroller kernel: [   53.586642] pru-rproc 4a338000.pru: PRU rproc node pru@4a338000 probed successfully 

CaptainMurdoch

Quote from: Kensington Graves on June 23, 2020, 08:21:11 PMI pulled the update you asked for.  No effect.  Log tails below:

By 'update', do you mean you installed the package using the apt command line I gave?

Just to confirm, does this camera work on a Pi or is it failing on both the Pi and BBB?

Can you login via ssh and do the following to test the webcam outside of FPP?

sudo su - root
cd /opt/fpp/www/images/
apt-get -y install fswebcam
fswebcam webcam.jpg
# now, if that looked like it ran correctly, point your web browser at
# http://YourFPPSystemIP/images/webcam.jpg to view the image
rm webcam.jpg
exit
exit

If that fails then the issue is at the OS level, but if it works then we should be able to make the plugin work.

You can also try different resolutions by changing the fswebcam command line to something like this:

fswebcam -r 1280x720 webcam.jpg

To list the valid resolutions, you can run this:

v4l2-ctl --list-formats-ext -d /dev/video0
-
Chris

Kensington Graves

I used "sudo apt-get -y install uvcdynctrl" to perform the "update" most recently mentioned.  I'll be more careful with my choice of words, as that's a package install rather than an "update."

The camera worked without issues on a Surface Pro out of the box, and then on a Raspberry Pi 4 after you pushed the June 20-ish update to the plugin.  It was still working on the RPi when I last checked, and it had survived multiple reboots and hot swaps of the camera.  The issues I've noted after post #64 are exclusive to the Beaglebone Black.

I'll reinstall PuTTY on my system and ssh into the offending FPP and report back.

CaptainMurdoch

Quote from: Kensington Graves on June 24, 2020, 12:51:22 PMI used "sudo apt-get -y install uvcdynctrl" to perform the "update" most recently mentioned.  I'll be more careful with my choice of words, as that's a package install rather than an "update."

...

I'll reinstall PuTTY on my system and ssh into the offending FPP and report back.

Thanks.  I just wanted to make sure I wasn't asking for the wrong thing.  It may come down to a kernel or kernel module version if it works on the Pi but not on the BBB.  I try to see if I can dig up a spare webcam from somewhere around the house otherwise I'll pull the one from my test Pi and check on a BBB.
-
Chris

Kensington Graves

SUCCESS!  But not exactly the way you thought, and I have not tried the plugin after the following procedure:

First, the package downloaded and installed fine into the /opt/fpp/www/images/ directory.  Next I tried to manually snap a pic with the fswebcam command (fswebcam webcam.jpg).  I got a "device busy" error, and I hadn't rebooted since the last failed attempt to snap a picture, so I rebooted.

Then, I went back into the /opt/fpp/www/images/ directory and again tried "fswebcam webcam.jpg).  This is what I got:


---Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
Adjusting resolution from 384x288 to 320x240.
---Capturing frame...
Captured frame in 0.00 seconds.
---Processing captured image...
Error opening file for output webcam.jpg
Error: permission denied.

So I tried checking the resolution to see if it worked (v4l2-ctl --list-formats-ext -d /dev/video0) and the list of available resolutions popped right up.

THEN I had an epiphany: it couldn't write to the output file for lack of permission, which meant I probably had to run the command as superuser in that directory.  So I tried "sudo fswebcam webcam.jpg" and shazam, it worked.  Then I tried it in the root directory without sudo and it worked, but when I attempted it again in the /opt/fpp/www/images directory, I had to run the command as a superuser.

Hope this helps.

CaptainMurdoch

Quote from: Kensington Graves on June 24, 2020, 08:55:34 PMHope this helps.

Thanks, I should have asked about a reboot after installing the uvc tools package.  One thing that I read is that part of the uvc initialization was now done in user space by the package, so if the system wasn't rebooted, then the camera may not have been initialized properly even after the package was installed.

Let me know once you've had a chance to test the plugin to see if the uvc tools package install and reboot have had any effect.  It could be the kernel module versions are different enough in the BBB vs Pi kernel where it works fine on the Pi but not on the BBB.
-
Chris

Kensington Graves

The plugin still doesn't work even after a reboot and installation of all the packages above.  Here are the log tails:

2020-06-25 18:16:54.593 (1358) log.c:231: =========================================
2020-06-25 18:16:54.651 (1358) common.cpp:663: JSON File /home/fpp/media/config/schedule.json does not exist
2020-06-25 18:16:55.529 (1358) src/FPP-VideoCapture.cpp:92: Device /dev/video0 does not exist
2020-06-25 18:16:55.606 (1358) channeloutput/channeloutput.c:399: Determined range needed 0 - 7
2020-06-25 18:16:55.660 (1358) command.c:74: Initializing Command Module
2020-06-25 18:16:55.665 (1358) Scheduler.cpp:788: Current Schedule: (Status: '+' = Enabled, '-' = Disabled, '!' = Outside Date Range, '*' = Repeat, Stop (G)raceful/(L)oop/(H)ard
2020-06-25 18:16:55.666 (1358) Scheduler.cpp:789: Stat Start & End Dates       Days         Start & End Times   Playlist
2020-06-25 18:16:55.666 (1358) Scheduler.cpp:790: ---- ----------------------- ------------ ------------------- ---------------------------------------------    
2020-06-25 18:16:55.680 (1358) common.cpp:663: JSON File /home/fpp/media/config/co-universes.json does not exist
2020-06-25 18:16:55.681 (1358) fppd.c:746: Starting main processing loop
 
Jun 25 18:17:57 FPP-Octoscroller systemd[1994]: Listening on GnuPG cryptographic agent (ssh-agent emulation).
Jun 25 18:17:57 FPP-Octoscroller systemd[1994]: Listening on GnuPG network certificate management daemon.
Jun 25 18:17:57 FPP-Octoscroller systemd[1994]: Reached target Sockets.
Jun 25 18:17:57 FPP-Octoscroller systemd[1994]: Reached target Basic System.
Jun 25 18:17:57 FPP-Octoscroller systemd[1]: Started User Manager for UID 500.
Jun 25 18:17:57 FPP-Octoscroller systemd[1994]: Reached target Default. 
Jun 25 18:17:57 FPP-Octoscroller systemd[1994]: Startup finished in 428ms.
Jun 25 18:17:57 FPP-Octoscroller systemd[1]: Started Session 2 of user fpp.
Jun 25 18:19:40 FPP-Octoscroller systemd[1]: Started Session 4 of user fpp.
Jun 25 18:20:21 FPP-Octoscroller systemd[1]: session-2.scope: Succeeded.
 
 
Jun 25 18:16:55 FPP-Octoscroller kernel: [   43.324352] uvcvideo 1-1:1.0: Entity type for entity Extension 2 was not initialized!
Jun 25 18:16:55 FPP-Octoscroller kernel: [   43.324374] uvcvideo 1-1:1.0: Entity type for entity Processing 3 was not initialized!
Jun 25 18:16:55 FPP-Octoscroller kernel: [   43.324383] uvcvideo 1-1:1.0: Entity type for entity Camera 1 was not initialized!
Jun 25 18:16:55 FPP-Octoscroller kernel: [   43.329118] input: HD USB Camera as /devices/platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1/usb1/1-1/1-1:1.0/input/input1
Jun 25 18:16:55 FPP-Octoscroller kernel: [   43.330301] usbcore: registered new interface driver uvcvideo               
Jun 25 18:16:55 FPP-Octoscroller kernel: [   43.330310] USB Video Class driver (1.1.1)
Jun 25 18:17:07 FPP-Octoscroller kernel: [   55.048739] remoteproc remoteproc0: 4a334000.pru is available
Jun 25 18:17:07 FPP-Octoscroller kernel: [   55.048911] pru-rproc 4a334000.pru: PRU rproc node pru@4a334000 probed successfully
Jun 25 18:17:07 FPP-Octoscroller kernel: [   55.056443] remoteproc remoteproc1: 4a338000.pru is available
Jun 25 18:17:07 FPP-Octoscroller kernel: [   55.056601] pru-rproc 4a338000.pru: PRU rproc node pru@4a338000 probed successfully

CaptainMurdoch

Quote from: Kensington Graves on June 25, 2020, 07:30:27 PM2020-06-25 18:16:55.529 (1358) src/FPP-VideoCapture.cpp:92: Device /dev/video0 does not exist

That line indicates that the /dev/video0 file does not exist at all.  Can you run "ls -al /dev/video*" and see if any video device files exist?
-
Chris

Kensington Graves

#86
ETA: missed the asterisk.

Both "video0" and "video1" exist in the /dev directory and "ls -al /dev/video0" returns the following:

crw—rw—— 1 root video 81, 0 Jun 25 18:17 /dev/video0

ETA: You know, I could have Amazon drop ship you one of these modules on my dime if you'd like one for testing.  Might make it easier for you to diagnose the problem.  PM me your address is you want one shipped.

ScaryJerry

Hi, I'm trying to play video from a Pi V3 camera to an HDMI output.  Hours of forums and youtube without getting a result. I'll ship a free camera to anyone who can figure it out.  Thx

Poporacer

Are you using the Video capture plugin?
If to err is human, I am more human than most people.

Kensington Graves

This is a blast from the past.  I think I got this working eventually, although I never deployed it on the IMBN Matrix because I got involved with other projects and because my S4 sender wasn't cooperating.  I'm pretty sure the plugin should work as expected at this point.

Support FPP

+- Recent Topics

Backup Feature not functional by efamlights
March 16, 2025, 11:58:28 AM

WS2811, Raspberry Pi 5, GPIO, could not initialize. by Ulysse-srfc24
March 16, 2025, 05:07:48 AM

K16A-B Issue by nolatron
March 15, 2025, 01:52:26 PM

F16V5 and SRx1 v5 by jkp
March 15, 2025, 07:19:44 AM

Differential Board: PSU & Enclosure by hakko808
March 14, 2025, 09:17:01 AM

FPP 8.4 Back up by Jradical
March 13, 2025, 05:38:18 AM

FPP on Pi5 won't start with "FPPD boot delay" set to 2 min or higher by dnapier65
March 12, 2025, 05:39:00 PM

OBJ File in Sketchup by dspenman
March 11, 2025, 09:19:08 AM

K2-Pi-Servo - xLights Visulizer by dkulp
March 06, 2025, 09:20:30 AM

DIYLIGHTANIMATION shutting down Feb 28, 2023 by jnealand
March 02, 2025, 10:58:12 AM

Powered by EzPortal
Powered by SMFPacks Menu Editor Mod