Comments (9)
Hello
Can you please let me know the tcambin version? Run tcam-ctrl -l
Also can you please post a minimal reproducible sample script? Even if I have an idea about what you are doing?
Thank you in advance!
Stefan
from tiscamera.
Sure!
tcambin version:
Versions:
Tcam: 1.1.1_master/ee45fcf7_rev_4142
Aravis: 0.8_version_e977fa4
Modules: gst_aravis_arvu3v_v4l2_libusb_tools_doc_tests
I am not using aravis.
Camera initialization:
# initialize callback function and TIS
IC = ImageCallback(False, None)
Tis = TIS()
# Set callback function and open device.
Tis.set_image_callback(on_new_image, self.IC)
# select camera
Tis.open_device(serial_number, height, width, framerate, SinkFormats.GRAY8, binning=binning, showvideo=False)
# Start Pipeline
Tis.set_property("TriggerMode", "Off")
IC.busy = True
Tis.start_pipeline()
# Set Properties
Tis.set_property("TriggerMode", "On")
# and set whatever other properties here
time.sleep(0.1)
IC.busy = False
I slightly modified the Gst caps function to enable binning:
caps = Gst.Caps.from_string('video/x-raw,format=%s,width=%d,height=%d,binning=2x2,framerate=%s' % (self.sinkformat.value, self.width, self.height, self.framerate))
When I take an picture right now I'm simply using software triggers:
Tis.execute_command("TriggerSoftware")
And then for starting and stopping the camera I go from Ready => Paused => Playing then Playing => Paused => Ready.
def start_pipeline(self):
"""
Start the pipeline, so the video runs
"""
self._setcaps()
if self.pipeline.get_state(5000000000)[1] != Gst.State.READY:
self.pipeline.set_state(Gst.State.READY)
self.pipeline.set_state(Gst.State.PAUSED)
self.pipeline.set_state(Gst.State.PLAYING)
error = self.pipeline.get_state(5000000000)
if error[1] != Gst.State.PLAYING:
print("Error starting pipeline. {0}".format(error))
return False
return True
def stop_pipeline(self):
self.pipeline.set_state(Gst.State.PAUSED)
self.pipeline.set_state(Gst.State.READY)
So in total my main loop is like:
# start camera
cam = Camera(serial_number = "12345",
height = 1216,
width = 1024,
framerate = "60/1",
binning = True)
# take pictures
foo()
# on exit
Tis.stop_pipeline()
The hang up happens both when stopping and starting the camera in the main code or when running the program multiple times. Right now I have eliminated starting and stopping the camera in the same program to try to isolate the error.
from tiscamera.
Hello teawizardry,
i tried to reproduce your issue but it is working on my machine.
But for some code optimization you can skip the step of state paused. Because if you set from playing to ready it will walk also through paused.
As you mentioned before "I'm trying to catch the behavior in a log file, but I think I didn't have the debug level set high enough. I'll update with that when I get it."
for logging you should use GST_DEBUG=:3,tcam:5
If you could let us know what the logging says we appreciate it.
Thank you in advance!
Kevin
from tiscamera.
Additionally i like to add something to my last message.
Because i saw you are working on PI with a usb camera. Is the camera connected directly to the Pi or is it connected to a powered usb hub?
In case of the direct connection there may be some issues with the power supply for the camera. That could cause the problem you occure.
from tiscamera.
It is connected directly to the Pi. Is there a way to see if power supply issues are the problem? And if so, how much power does it need?
from tiscamera.
Hello teawizardry,
well there can be issues caused by the power supply to the Pi but typically are power saving mechanisms.
You may check this Website which provides already many informations about power supply problems with a Pi:
https://pimylifeup.com/raspberry-pi-low-voltage-warning/
However, as i can see you are using tiscamera 1.1 and the udev rules should disable the power saving mechanisms for our cameras.
To be on the sure site i suggest to connect the camera to a powered usb hub and check if the camera works fine then.
How is it about your logging results?
Is there any output you may provide to us?
Best Regards
Kevin
from tiscamera.
Hello
And then for starting and stopping the camera I go from Ready => Paused => Playing then Playing => Paused => Ready.
Going into pause state explicitly is not necessary in this situation, therefore, you may remove that from your code.
If the camera is in trigger mode, it can happen, that starting the pipeline fails, because all modules may need a frame to prepare themself. Thus a state change to playing is never achieved. I suggest to disable trigger mode, start the stream and if the stream is in state playing, enable the trigger mode. Same goes for stopping the stream. Disable the trigger mode, then stop the stream. I see, you did that for starting the stream already.
I do not think, it is a power issue. If so, you saw a four color icon in the upper right corner on the screen.
Stefan
from tiscamera.
I will try that and see if it fixes the issue. I'm unsure why but the gst log is not actually logging anything.
from tiscamera.
Did you run
export GST_DEBUG=:3,tcam:5
before starting your script? In the same terminal?
Stefan
from tiscamera.
Related Issues (20)
- Black dashed lines across image HOT 5
- Can't set acquire period longer than 0.5s when capturing less than full region HOT 2
- Cannot get image/video from DFK 42BUC03 on Linux HOT 2
- ERROR tcam-libtcam timeout while waiting for new image buffer HOT 5
- Broken dependency HOT 4
- Failed to find any device to open DMK23G445 HOT 2
- Feature Requset: Callback for external trigger, before sensor read-off HOT 6
- Cmake cannot find tcam HOT 1
- PolarizedMono12Packed HOT 5
- Is there a DFK31BU camera driver available for the Raspberry Pi? HOT 7
- Unable to use v4l2-ctl to update gain HOT 2
- Rasberry Pi 3 Arducam Day-Night Vision Camera not available HOT 1
- unable to detect camera on ubuntu HOT 5
- AttributeError: 'GstTcamBin' object has no attribute 'get_device_serials_backend' while running the 00-list-devices.py HOT 6
- support 23.04, 23.10, and 24.04 HOT 1
- Performance Variation Across Ubuntu Versions and tiscamera Package Versions HOT 4
- Is it Possible to Share a GigE Camera Feed Between Two PCs? HOT 2
- Use dfk 33ux287 tisCam code to install library fail HOT 7
- Stuck setting pipeline state to ready - pipeline.set_state(Gst.State.READY) due to TriggerMode HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tiscamera.