Reading a video file (*.mp4) using gscam
I am trying to read a video file of mp4 type using gscam and display onto image_view. It seems working at the first try but it does not work again once it is terminated. Is there something I missed? I am new to ROS.
Here are commands that I have typed to read a video file (test_video.mp4) using gscam
$ roscore
$ roslaunch gscam videofile.launch FILENAME:=/home/jhk/test_video.mp4
$ rosrun image_view image_view image:=/video_file/camera/image_raw
It worked well showing the video playing in the image_view. However, after I interrupted the roslaunch by pressing CTRL+C and tried it again. It does not work anymore. The only solution was I had to reboot my ubuntu system. Then it started work again but once I killed the process related to the gscam node and relaunching won't work. Basically, it does not publish streaming. Here is the output of the command at second time.
$ roslaunch gscam videofile.launch FILENAME:=/home/jhk/test_video.mp4
... logging to /home/jhk/.ros/log/5a094bfa-4e27-11e4-8e1f-e82aeab21ee8/roslaunch-COMSCI-4064-5408.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://COMSCI-4064:48329/
SUMMARY
========
PARAMETERS
* /rosdistro: indigo
* /rosversion: 1.11.9
* /videofile/gscam_driver_v4l/camera_info_url: package://gscam/e...
* /videofile/gscam_driver_v4l/camera_name: default
* /videofile/gscam_driver_v4l/frame_id: /videofile_frame
* /videofile/gscam_driver_v4l/gscam_config: filesrc location=...
* /videofile/gscam_driver_v4l/reopen_on_eof: True
* /videofile/gscam_driver_v4l/sync_sink: True
NODES
/videofile/
gscam_driver_v4l (gscam/gscam)
ROS_MASTER_URI=http://localhost:11311
core service [/rosout] found
process[videofile/gscam_driver_v4l-1]: started with pid [5426]
[ INFO] [1412720273.052893830]: Using gstreamer config from rosparam: "filesrc location=/home/jhk/test_video.mp4 ! decodebin ! ffmpegcolorspace"
[ INFO] [1412720273.056832654]: camera calibration URL: package://gscam/examples/uncalibrated_parameters.ini
[ INFO] [1412720273.065801792]: Loaded camera calibration from package://gscam/examples/uncalibrated_parameters.ini
[ INFO] [1412720273.086922863]: Time offset: 1412719055.015
I have tried to kill the node and cleanup using commands
$ rosnode kill $ rosnode cleanup
but still does not work. I also tried rerun roscore but not successful. Is there any initialization command of ROS? or is there a better way of stopping gscam node?
My best guess is that some part of the gstreamer pipeline is not getting cleaned up properly. I would start there.
Hello, I have the same problem. Have you already solved it ?
I could not solve the problem with gscam, but I could work around with rbx1 followed by my modification. Check out video2ros.py in my fork on rbx1 ( https://github.com/jaehak/rbx1 ).
Thank you very much! I checked out your video2ros.py and I found a problem with my mp4 file. It doesn't find the file. I checked the path and it is right. I was reading about this problem but I am not sure how to solve it. Could be a problem with ffmpeg?