Open frapit opened 2 years ago
Hmm, good catch. Looking at the code, while that's possible, I think it would be pretty weird for that situation to happen. I think you would need to have a bag file with an image topic that has at least two frames, but every frame's header would have to have an identical timestamp, causing it to think that that the average period between frames is 0. Do you know if that's the case here?
If a topic doesn't have reasonable timestamps on its image messages, it might not be possible to determine the frame rate for the topic, but I suppose we could just make something up or ask the user for a default frame rate.
Edit: I also think it'd be possible to calculate the frame rate based on the time messages were recorded in the bag file, although it'll take a little work on the bag reader library to make that accessible at this place in the code.
Thanks for the quick answer. Yes you are right, I just checked some of the bags for which the video stream is broken and they all have all timestamps zero on the image topics. That probably causes the issue. I am wondering why rtq tools, etc. have no problem with such messages. Anyway, I think a reasonable default framerate in that case should be sufficient.
Hi,
the video stream in some bag files appears to be broken, I think the calculation of the frame rate in https://github.com/swri-robotics/bag-database/blob/63196f2b7c6bb74b087f60555b1d9bec03041dc1/src/main/java/com/github/swrirobotics/bags/BagService.java#L371 may need some additional checking.