GithubHelp home page GithubHelp logo

arnefmeyer / rpicameraplugin Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 13.0 138 KB

A plugin for the open-ephys plugin-GUI to control a Raspberry Pi camera

License: GNU General Public License v3.0

Python 57.81% Makefile 1.22% C++ 35.47% CMake 5.50%

rpicameraplugin's People

Contributors

arnefmeyer avatar bouromain avatar jonahpearl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rpicameraplugin's Issues

Framecount inconsistencies between reported TTLs and video files

Hi,

There seem to be an inconsistency between the number of reported frames in the timestamps.csv and the number of frames in the converted mp4 video file - this inconsistency persists, and is accurately reproduced, even when converting the videos format via opencv frame-by-frame.

Have you encountered this phenomenon?

I am having trouble syncing up the videos as the reported number of frames (and the open-ephys events file which records TTLs from the two RPis) do not match the amount of frames I end up with after conversion to mp4.

Thanks again, and sorry for the trouble.

Unable to run rpi_host.py

Hello Arne! I am setting up mousecam in my lab and was unable to run rpi_host.py in standalone mode (wanted to test it in standalone before doing the remote control via SSH)

My setup:
Installed Raspian buster on raspberry pi3 model B+
Installed Berryconda3-2.00 and created python 3.6 environment
installed picamera, pyzmq, RPi.GPIO and numpy
activated camera interface and SSH via sudo raspi-config
installed camera ardafruit 1937 on raspberry pi
tested the camera via "raspivid -o vid.h264" and can record video and see the camera preview

running the script in standalone mode throws me this error

(pupilcam) pi@raspberrypi:~/Desktop/rpicam/RPiCameraPlugin-master/Python/scripts $ python rpi_host.py standalone
Data path: RPiCamera_test
Opening controller and camera
Traceback (most recent call last):
  File "/home/pi/berryconda3/envs/pupilcam/lib/python3.6/site-packages/rpicamera/controller.py", line 146, in __init__
    self.camera = CameraGPIO(**kwargs)
  File "/home/pi/berryconda3/envs/pupilcam/lib/python3.6/site-packages/rpicamera/camera.py", line 112, in __init__
    for k, value in kwargs.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'
Starting preview and warming up camera for 2 seconds
Starting recording
Traceback (most recent call last):
  File "rpi_host.py", line 289, in <module>
    out = func(**args)
  File "rpi_host.py", line 175, in run_standalone
    controller.resolution[0],
TypeError: 'NoneType' object is not subscriptable
/home/pi/berryconda3/envs/pupilcam/lib/python3.6/site-packages/rpicamera/camera.py:132: RuntimeWarning: No channels have been set up yet - nothing to clean up!  Try cleaning up at the end of your program instead!
  GPIO.cleanup()
(pupilcam) 

if i try it without standalone mode it gives me this error


pi@raspberrypi:~/Desktop/rpicam/RPiCameraPlugin-master/Python/scripts $ python rpi_host.py
Traceback (most recent call last):
  File "rpi_host.py", line 288, in <module>
    func = args.pop('func')
KeyError: 'func'
(pupilcam) pi@raspberrypi:~/Desktop/rpicam/RPiCameraPlugin-master/Python/scripts $ 

with the following messages:

stopping the camera, and editing the settings

Hi Arne, thank you so much for this software. I'm setting it up with my rasberry pi to use in the lab i work for.
i downloaded everything and got into the proper directory pi@raspberrypi:~/RPiCameraPlugin/Python/scripts $

and have two problems
1- the code to start it - python rpi_host.Py standalone works, but when it starts it fills the screen and theres no code or button to close/stop the recording

2- i tried the code with --h to get the options up. for some reason i think this is shooting at 30 or 60 fps and i need to up the frame rate, as well as flip it over. im not sure how to integrate the --vflip command or framerate option in a way that will affect what is shown on screen when i start the camera
thank you So much !!!

Integrating with windows based open-ephys version v0.5.3.1

Hello again, and thank you for the previous reply!

This may be my own misunderstanding and not an actual issue but I couldn't make the plugin work with the windows plugin architecture - The newer Open-Ephys GUI versions offer a plugin installer and I'm trying to figure out the correct way to build the plugin around it.

Is the plugin compatible with this windows version? Is there something I'm missing? or is it simply a matter of using a correct build procedure?

Again, much appreciation for the work and responsiveness!

Nimrod

h.264 files seem to have no container

Hello Arne, thank you for developing this plugin!

I am using the plugin to record eye tracking videos through the run_standalone() command.

The video output has the title "video_name.h264" but it seems to be in no particular container codec (not recognized as an h.264 file on the RPi, linux and windows systems) and when force played by VLC runs at 29.97 FPS instead of the 60 FPS which it was recorded in via the plugin.

I couldn't figure out why the files are not contained, it seems like you specified a format through picamera.PiVideoEncoder (VideoEncoderGPIO in the code), but the output file is problematic for some reason.

I've tried using ffmpeg to re-contain it in an mp4 file with the correct frame-rate but I can't be certain that ffmpeg doesn't duplicate / drops frames while converting so I have been trying to understand how to change your code to send the output as a contained file - is there something I'm missing? How did you intend the files to be saved on the RPi (format-wise)? how did you read these files?

Thank you in advance, and sorry for being a beginner :)

Nimrod Leberstein

Problem creating plugin "PluginInfo.h: No such file or directory"

Hello,

I'm having a problem with the install.

I have followed all the steps on the git up to building the plugin in using cmake.
after running:

sudo cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..

i went to run "make" still within the build directory and i got the following error:

usr/local/bin/open-ephys-gui/plugins/RPiCamera/Source/OpenEphysLib.cpp:24:10: fatal error: PluginInfo.h: No such file or directory
24 | #include <PluginInfo.h>
| ^~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/RPiCamera.dir/build.make:63: CMakeFiles/RPiCamera.dir/Source/OpenEphysLib.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/RPiCamera.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

I know i'm probably doing something dumb but i cant seem to fix the problem.

Problem getting name of recording with new recording node system

Hi Arne,

Thank you again for adapting your plugin to the last version of open ephys.

On my side it correctly compile but it seem that the plugin does not manage to get the name of the currently recorded path.
In RPiCam.cpp, line 413:

String recPath = CoreServices::RecordNode::getRecordingPath().getFullPathName();
seem to always return an empty string.
Thus it falls back to your function generateDateString() and does not allow to add suffix or prefixes to the recording name.

I tried to debug it today and will insist to make it work (my knowledge of c++ is limited), but just in case, is it an isolated issue? Would you have an idea of how to return the name of the current file?

Thank you in advance.

Best

Romain

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.