Open
Description
Expected behaviour
The idea is to use GStream with OpenCV to compress a video.
Actual behaviour
The code raises an error because of the pipeline
Steps to reproduce
- operating system: ubuntu 20.04
- opencv-python version 4.20
My code is:
`compressed_video_path = os.path.join(picture_path, f"{datetime.datetime.now()}.mp4")
gst_pipeline = (
f"appsrc format=GST_APP_FORMAT_TIME ! videoconvert ! x264enc ! mp4mux ! filesink location={compressed_video_path}"
)
recorded_video = cv2.VideoWriter(gst_pipeline,
cv2.CAP_GSTREAMER,
0,
self.camera_fps,
(self.frame_size[1], self.frame_size[0]))
if not recorded_video.isOpened():
raise ValueError("Error!!!")
for frame in frames_to_compress:
recorded_video.write(frame)
recorded_video.release()
rospy.loginfo(f"Compressed video saved in {compressed_video_path}.")`
And when calling the ros service involved, I have the error "Error!!!"
Metadata
Metadata
Assignees
Labels
No labels