AVC / H.264 video support #88
-
Currently Foxglove Studio supports rendering image frames using the sensor_msgs/Image and sensor_msgs/CompressedImage. The latter supports PNG or JPEG compression. Several people have asked for the ability to render video data, most commonly in h264 format. Often, this data is recorded as a separate file alongside a ROS bag, but in theory the NAL units could be wrapped within a ROS or Protobuf message, or stored directly in MCAP. Several methods to implement this have been discussed, from using native HTML video elements, to decoding the frames in WASM. Related tickets: https://github.com/foxglove/studio/issues/1069 https://github.com/foxglove/studio/issues/537 |
Beta Was this translation helpful? Give feedback.
Replies: 13 comments 19 replies
-
This would be very useful. ROS Image topics are horribly inefficent, since they are raw image frames without intra-frame or frame-to-frame compression (like H.264). Specifically, being able to subscribe to RTSP streams would be amazing. |
Beta Was this translation helpful? Give feedback.
-
@Aposhian How do you imagine those streams would be synced with other message data coming from the main data source? |
Beta Was this translation helpful? Give feedback.
-
I suppose what I was envisioning was primarily supporting the live use case, where you are streaming from a dedicated video source that is assumed to be synced with your primary data source. However, absolute timing information can be obtained from a container protocol like RTSP. While I may be incorrect on this, it seems that RTCP messages can contain NTP timestamps, and RTP packets contain relative timestamps, so that by combining the two, you can obtain an absolute timestamp for each RTP packet. Then, if your RTSP source is synced with the same NTP server as your primary data source, it should be synced. I've primarily used RTSP in my applications, so I'm unsure of what container formats with H.264 data other people would want to visualize in foxglove. |
Beta Was this translation helpful? Give feedback.
-
Related: We should support visualizing h264 directly in MCAP (foxglove/mcap#427) |
Beta Was this translation helpful? Give feedback.
-
https://github.com/foxglove/studio/issues/3739#issue-1286687657 |
Beta Was this translation helpful? Give feedback.
-
How to set the rosbag's image into a RTSP |
Beta Was this translation helpful? Give feedback.
-
Not sure if this is the correct way to go about it, but it might also be good to take note of https://github.com/clydemcqueen/h264_image_transport |
Beta Was this translation helpful? Give feedback.
-
What is the current thinking on this? Even being able to display H.264 frames packed into ROS messages would be very helpful, since that would be a lot more storage and bandwidth efficient. |
Beta Was this translation helpful? Give feedback.
-
I'm working on a live connector for Foxglove that uses webrtc (over UDP) for the connection and h264 for video-compression: https://transitiverobotics.com/caps/transitive-robotics/foxglove-webrtc/. It's still early but it's already usable and if anyone is interested I'd love a design partner. |
Beta Was this translation helpful? Give feedback.
-
I remember https://github.com/aws-robotics/kinesisvideo-ros1/blob/master/kinesis_video_msgs/msg/KinesisVideoFrame.msg - this project isn't live any more, and I'm not sure if there's other generic encoded data stream msgs predefined anywhere. But it seems pretty sensible to me to have a EDIT: I hadn't read the prior discussion closely enough - I see now that https://github.com/clydemcqueen/h264_image_transport/blob/master/h264_msgs/msg/Packet.msg is an attempt at this approach, thanks for the link @Aposhian |
Beta Was this translation helpful? Give feedback.
-
I think the best way to play h264 in web browser is webrtc. we can implement a signaling server in webbridge server and the sensor node can directly encode frames as RTP packet and send to foxglove ( with some simple extra handshake). |
Beta Was this translation helpful? Give feedback.
-
We have also implemented a RTSP extension https://github.com/foxglove-custom/rtsp-player-extension |
Beta Was this translation helpful? Give feedback.
-
Yesterday we announced H.264 support in foxglove. This is available across all of our built-in data-sources (mcap, bag, websocket, data-platform streaming) and plays in-sync with all of your other data. https://foxglove.dev/blog/announcing-h264-support-in-foxglove |
Beta Was this translation helpful? Give feedback.
Yesterday we announced H.264 support in foxglove. This is available across all of our built-in data-sources (mcap, bag, websocket, data-platform streaming) and plays in-sync with all of your other data.
https://foxglove.dev/blog/announcing-h264-support-in-foxglove