ratal / mdfreader

Read Measurement Data Format (MDF) versions 3.x and 4.x file formats in python
Other
171 stars 75 forks source link

GigE Vision (GVSP) does not read last byte of Ethernet payload #193

Open angelo0027 opened 3 years ago

angelo0027 commented 3 years ago

Python version

3.7.4 (default, Aug 9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)]

Platform information

Windows-10-10.0.18362-SP0

Numpy version

1.19.1

mdfreader version

4.1

Description

I'm reading a camera image log via GigE Vision, GVSP protocol. In filling my image with pixels, there is a diagonal shift every 2 rows. The image resolution is 4112x900. As you can see in the attached screenshot, the declared length of every message is 8972, therefore one message fills little more than two rows in the final image (8972-8224 = 748 px). The actual length of the GVSP message is 8971 (one byte less than declared). The message should be of length 8972 (this is the correct length, I tested the same mdf with asammdf with the same resolution and the image is reconstructed correctly). image

Further looking into the payload, there is actually one byte missing in the message from mdfreader that is present in asammdf: image

And this causes the incorrect image reconstruction.

Is this a bug or does the file have to be loaded in another way? Currently I simply do: mdf = mdfreader.Mdf(mdf_file) The MDF version in the header is: MDF 4.10

ratal commented 3 years ago

Could be a bug, hard to say for now. Most efficient is to share the file but you might have confidentiality issues with that. Otherwise, you could scramble the file by using script shared by Daniel (asamMdf developper) in issue https://github.com/ratal/mdfreader/issues/189#issuecomment-711626428 If still problematic, can you inform the block structure using MDFValidator (from Vector, freely downloadable) ? It would help understand if you are facing a specific case or a bug. Most important are CNBlock of GSV_DataPacketBytes, and related CGBlock and DGBlock.