|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
OpenCV VideoWriter Raspberry Pi
Hello everyone,
My team is trying to run vision tracking on our Raspberry Pi for the lifts. We wanted to record the video output so we could debug in real time just in case something went wrong during a match, but OpenCV doesn't run the commands related to the VideoWriter class. There aren't any errors that come from the shell, but the program literally skips over those lines of code. Has anyone else had any problems similar to this on the pi? Do you know how to fix this error? Thanks, Jonathan Daniel Head Programmer Fernbank LINKS Robotics |
|
#2
|
||||
|
||||
|
Re: OpenCV VideoWriter Raspberry Pi
The wpilib opencv artifacts are not compiled with non-free codec support. Because of this, both VideoWriter and VideoCapture do not support reading or writing from encoded streams such as Avi or mpeg-4. You will need to write individual frames as jpegs using imwrite if you want to write frames.
|
|
#3
|
||||
|
||||
|
Re: OpenCV VideoWriter Raspberry Pi
OK, thanks!
|
|
#4
|
||||
|
||||
|
Re: OpenCV VideoWriter Raspberry Pi
Quote:
|
|
#5
|
||||
|
||||
|
Re: OpenCV VideoWriter Raspberry Pi
Yes, it should be able to do mjpeg, since it does support jpeg images. I have not explicitly tested this however.
|
|
#6
|
||||
|
||||
|
Re: OpenCV VideoWriter Raspberry Pi
Be careful with MJPEG for recording on an embedded arm device. MJPEG is bitrate hungry and ranges anywhere from 10x to 20x larger than something like h264 or v8. This can easily saturate your SD card's throughput.
WebM might be an option. Another possibility is to use the v4l2-loopback and gstreamer to record locally with x264 in a separate thread, while having your vision processing run on a forked stream. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|