Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test the visualization of video stream from avi/mp4 file or camera device #106

Open
nunoguedelha opened this issue Apr 21, 2022 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@nunoguedelha
Copy link
Collaborator

nunoguedelha commented Apr 21, 2022

We need to better anticipate the issues that could be encountered by the Telexistence team when using the yarp-openmct tool for visualizing the cameras. For that purpose we replace the fakeframeGrabber "scrolling line" simple test image by:

  • a video stream read from an AVI (or MP4) file,
  • a video stream extracted from a camera device.
  • the fakeframeGrabber's scrolling line but with a complex background (for instance a random colorful image) for considering the cases where less JPEG compression is possible.
@nunoguedelha nunoguedelha self-assigned this Apr 21, 2022
@nunoguedelha nunoguedelha added the enhancement New feature or request label Apr 21, 2022
@nunoguedelha
Copy link
Collaborator Author

nunoguedelha commented Apr 21, 2022

Video Stream Read from an AVI or MP4 File

We recompile YARP with the following CMake configuration:

YARP_COMPILE_CARRIER_PLUGINS = ON
ENABLE_yarpcar_mjpeg_carrier = ON
MJPEG_AUTOCOMPRESS = ON
ENABLE_yarpmod_ffmpeg_grabber

After building is complete, we can find the ffmpeg_grabber device "ini" file ffmpeg_grabber.ini in one of the folders specified in YARP_DATA_DIRS (namely <robotology-superbuild path>/build/install/share/yarp/plugins)

We define an additional custom config file ffmpegGrabber.ini:

# read from an avi file
device ffmpeg_grabber
source testMovie2cropped.mp4
nodelay
name /icubSim/camLeftEye

Run the grabber

yarpdev --from ffmpegGrabber.ini

We then run the yarp-openmct visualizer as usual.

testMovie2cropped-on-yarpopenmct.mp4

@nunoguedelha nunoguedelha changed the title Test the visualization of video stream from avi file or camera device Test the visualization of video stream from avi/mp4 file or camera device Apr 21, 2022
@nunoguedelha
Copy link
Collaborator Author

CC @S-Dafarra @traversaro

@S-Dafarra
Copy link
Member

Just to understand, what would be the expected output? Is it normal that the images are still?

@nunoguedelha
Copy link
Collaborator Author

They're actually changing, but at a very slow refresh rate because of issue #104 , which is not a transmission issue but rather a buffering issue in the open-mct viewer implementation. More precisely a problem with the Open-MCT Time conductor plugin implementation I think. I will add more details in #104 . Analysis ongoing. I will add here a lighter video example.

@nunoguedelha
Copy link
Collaborator Author

I will add here a lighter video example.

Actually it's not worth it. With a tcp connection to a yarpview I get a very smooth visualisation of the same video, without any delay.

@nunoguedelha
Copy link
Collaborator Author

fakeframeGrabber scrolling line but with a complex background

Define the custom configuration file fakeFrameGrabber_testImage.ini

device fakeFrameGrabber
name /icubSim/camLeftEye
mode line
period 50

We chose here a 50ms period for matching the same FPS rate used by the iCub cameras.

Run the grabber

yarpdev --from fakeFrameGrabber_testImage.ini --src testImageBeach.ppm

The grabber adds the scrolling line on top of the test image testImageBeach.ppm. In this case, the test image was created from a snapshot of the test movie testMovie2cropped-on-yarpopenmct.mp4 saved as a PPM image.

testImageBeach-with-scrollingLine.mp4

We could use the "time" clock mode instead of the "line" mode. Note that there is a bug in the fakeFrameGrabber since the displayed clock appears slanted.

testImageBeach-with-time.mp4

It is probably due to the fact that the image size used for displaying the clock is hardcoded and instead of being computed from the background input image.

@nunoguedelha
Copy link
Collaborator Author

nunoguedelha commented Apr 29, 2022

video stream extracted from a camera device

Refer to Using OpenCV Grabber with YARP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants