-
The current version of Foxglove Studio has a bug. Bug description and reproductionStart streaming H.264 CompressedVideo via a Foxglove Websocket server. Connect the Studio to the client. If the first video frame does not happen to be a keyframe by accident, the screen will stay black forever. This does not happen with MCAP playback, where the video starts playing once the first keyframe gets played. This is extremely annoying, because you need to have the studio pre-opened and pre-configured, before you start streaming. If you don't know the names of the topics in advance, then it's simply impossible to reliably get a video playing on the first try. Expected behaviorThe video appears once a key frame is reached, same as for MCAP playback. |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 7 replies
-
It would help if you could make an mcap recording of the server data where the first messages on the topic are not keyframes. You can record to an mcap from your existing websocket server with this one-liner (if you have nodejs installed):
|
Beta Was this translation helpful? Give feedback.
-
@AlexKirko I was not able to reproduce using Are you able to provide example data that reproduces this behavior? If not, could you tell us what error(s) you're getting in the image panel and/or the browser console? Does this happen with local data as well? Could you tell us a bit more about the nature of your data? How frequently are you sending a keyframe? |
Beta Was this translation helpful? Give feedback.
-
@snosenzo , this makes sense, as MCAP does not have this bug, only Websocket streaming does. I was on vacation, so I was not able to produce a fail for you. I will provide an MCAP with the same data that's causing the problem when streaming by the end of the week. This is of limited use, however, since MCAP resets correctly on a keyframe, while the streaming does not. |
Beta Was this translation helpful? Give feedback.
-
This is very strange. I have tried skipping a bunch of key frames, but I'm not getting this bug anymore when streaming from mcap with mcap-play. Maybe due to the recent video processing update that you guys had? Unfortunately, the exact multi-camera setup that produced the bug is in another city, so give me a few days to recruit some colleagues to check if we are still experiencing the bug. If yes, then I'll have to use mcap-record to create a proper dump from that setup. |
Beta Was this translation helpful? Give feedback.
-
The colleagues will be able to test tomorrow. |
Beta Was this translation helpful? Give feedback.
-
Okay, I have finally been able to produce a couple files for you. One results in a black screen Image panel with 'waiting for key frame' forever for me, and the other is fine. The only difference is that, for the first one, I ran the server first and then ran the record utility, and for the non-broken one, I did the opposite. Since you guys do not support attaching an .mcap here, I'm putting the files into .zip archives. |
Beta Was this translation helpful? Give feedback.
-
The key frame rate is a bug with this particular dataset, normally we produce one for every 10 frames. The lacking SPS, however, is probably the reason why we are observing this behavior. It must be getting broadcast at the start of the stream and never again, s oif the client joins in the middle, we run into trouble. |
Beta Was this translation helpful? Give feedback.
-
I have added the SPS data to key frames, and the issue is now fixed. I can join mid-stream, and the decoding starts. Thank you. |
Beta Was this translation helpful? Give feedback.
Testing these files:
Could you try changing your encoder to include SPS in every key frame?
It is expected behavior that the video will not display until a key frame is reached – this is the nature of video compression. If you would like to be able to start playback from an arbitrary point, you could consider configuring the encoder/publisher to add key frames every so often (for example ever…