usb_cam icon indicating copy to clipboard operation
usb_cam copied to clipboard

Added support for hardware-accelerated decoding

Open twdragon opened this issue 1 year ago • 4 comments

Added hardware-accelerated decoding with FFMPEG HWACCEL API for mjpeg and h264 pixel formats

  • Feature supported only from libavcodec 52.00.100
  • Added configuration parameters for activating hardware acceleration on decoding
  • Added ROS service to enumerate available hardware accelerators
  • Tested on:
    • CUDA/NVENC decoder on H.264 streams
    • VDPAU on MJPEG streams

twdragon avatar Jun 07 '23 18:06 twdragon

@knorth55 @twdragon I thought we were trying to merge together our ROS 1 and ROS 2 branches....not continue to diverge.

This feature would be great to use in both ROS 1 and ROS 2.

flynneva avatar Jun 07 '23 19:06 flynneva

@flynneva i think its better to first find a way to migrate ros1 and ros2 branch. sorry, buy i could have enough time to work on it.

knorth55 avatar Jun 08 '23 00:06 knorth55

Dear @flynneva @knorth55! We are free to merge ROS1 and ROS2 parts of the project, and I support your opinion about this. We can keep the branch for as long time as we need. This pull request is created again as a side effect of my own work that I consider important for the community. I developed and tested the modification of usb_cam to enable hardware acceleration for my internal works, then decided to create a dedicated branch and PR to let the willing ROS1 users test the feature. I also wanted to point your attention to the way the new architecture of internal API maintains the changes. Actually, to adopt it we just need a compatible node wrapper for ROS2 as for ROS1 everything is already done.

twdragon avatar Jun 08 '23 08:06 twdragon

@flynneva @knorth55 I added issue #255 to facilitate the experience, especially I want to kindly ask @flynneva for a point to the way to generate the ROS2 parameters dynamically during startup. This could really accelerate the process

twdragon avatar Jun 08 '23 08:06 twdragon