Comments (6)
I remember I used this code at that time and it worked perfect! Just create a python file and copy paste these codes into that file and modify the codes according to your own camera settings.
#!/usr/bin/python3
# general stuff
import cv2
import numpy as np
import time
import copy
import os
import math
# ros stuff
import rospy
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
from datetime import datetime
# is used to convert ROS message into OpenCV structure
bridge = CvBridge()
# opencv video write object
# camera resolution is 2064x1544
out = cv2.VideoWriter('test.avi',cv2.VideoWriter_fourcc('M','J','P','G'), 30, (2064,1544))
def cbImg(msg):
global bridge, out
cv_image = bridge.imgmsg_to_cv2(msg, desired_encoding="bgr8")
# image is flipped
out.write(cv2.flip(cv_image, -1))
def main():
global out
rospy.init_node('video_writer', anonymous=True)
#change comments for different topics
rospy.Subscriber("/ximea_cam_left/image_raw", Image, cbImg, queue_size=1)
# rospy.Subscriber("/ximea_cam_right/image_raw", Image, cbImg, queue_size=1)
# spin() simply keeps python from exiting until this node is stopped
rate = rospy.Rate(10)
while not rospy.is_shutdown():
rate.sleep()
# end video write
out.release()
rospy.spin()
if __name__ == '__main__':
main()
from rosbag2video.
I have the same problem
from rosbag2video.
I have the same problem as well. Is this issue be solved now?
from rosbag2video.
However, I run the ros2 bag2videos. It stuck like the figure below.
from rosbag2video.
I don't think this problem has been solved... You'd better try other ways to transfer the files...
from rosbag2video.
I see... Would you please share some methods for converting the rosbag .db3 files into .mp4 files?
from rosbag2video.
Related Issues (20)
- rosbag2video not showingup any output
- Code correction suggestion !!
- Code is not working HOT 4
- dependencies not found HOT 10
- arg parse error HOT 1
- Port to ROS2 HOT 8
- Object has no attribute 'format' HOT 5
- E: Unable to locate package python3-roslib & python3-sensor-msgs HOT 2
- AttributeError: 'CompressedImage' object has no attribute 'encoding' HOT 3
- no roslib module HOT 1
- unsupported encoding: mono16 /depth_image HOT 4
- Generated video file is black HOT 2
- please,helpe me.How did this error occur
- Ros2 Humble is installed on the Ubuntu 22.04 but I get error for no module named rclpy._rclpy_pybind11 while the package is installed HOT 1
- /usr/bin/python3.10 ros2bag2video.py ~/Downloads/cheezit_1280_whole.bag --> rclpy.exceptions.InvalidTopicNameException: Invalid topic name: topic name must not be empty string: '' HOT 1
- how to convert a ros2 humble bag to a video using ros2bag2video.py Python script? HOT 4
- ros2bag2video.py script gets stuck Python 3.10, ros2 humble, Ubuntu 22.04 in converting color raw bag to video HOT 4
- Update Readme To Make the Features of the Package Explicit. ros2bag2video.py only works with compressed image stream
- ros2bag2video.py script gets stuck Python 3.10, ros2 humble, Ubuntu 22.04 in converting color raw bag to video
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 rosbag2video.