2

I am trying to read .mf4 file using python 3.7 (Spyder IDE). The main idea of reading .mf4 file is to see if I can access each information separately. That means, for example, to check the Road Signs detection points only or Pedestrian identifications only or to extract video only.. and at the later stage to count the FP/FN/TP/TN and link it to the frame counter using GPS data.

I tried to use asammdf library.

Following is the function i used:

from asammdf import MDF, Signal
data = MDF('filename.mf4')

I get the error as follows :

bus_type = channel_group.acq_source.bus_type

AttributeError: 'NoneType' object has no attribute 'bus_type'

Community
  • 1
  • 1
Rakesh
  • 21
  • 1
  • 1
  • 4

2 Answers2

1

I've pushed a fix to the development branch.

You can install the code by running:

pip install -I --no-deps https://github.com/danielhrisca/asammdf/archive/development.zip

If you have other problems please open a new issue on github

danielhrisca
  • 665
  • 1
  • 5
  • 11
  • Thanks a lot for your reply. But its unfortunately not getting installed.ERROR: Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='github.com', port=443): Max retries exceeded with url: /danielhrisca/asammdf/archive/development.zip (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 11001] getaddrinfo failed')) – Rakesh Aug 13 '19 at 08:32
  • if you have a network proxy then you need to provide it in the command line ``pip pip install -I --no-deps --proxy=http://:@: https://github.com/danielhrisca/asammdf/archive/development.zip`` by replacing the user, password, server_address and server_port with your settings – danielhrisca Aug 13 '19 at 09:44
  • I would really love to switch to asammdf lib if it has a solution for this challenge: https://stackoverflow.com/questions/72287301/how-to-read-dat-file-from-aws-s3-using-mdfreader ? Can you help with this? @danielhrisca – Aakash Basu May 18 '22 at 13:15
  • @AakashBasu maybe this can help you https://github.com/CSS-Electronics/api-examples/blob/master/examples/other/s3-basics/s3_basics.py – danielhrisca May 18 '22 at 15:56
  • I know those operations, trying to figure out a way to read MDF in such a bytestream format and parse. Can you check my query in the link above pls? – Aakash Basu May 18 '22 at 16:26
  • The MDF spec allows for really fragmented files, so streaming is not a viable option. You would be doing a lot of random access over the network – danielhrisca May 19 '22 at 17:37
0

You can use this:

from asammdf import MDF, Signal

mdf= MDF(version ="4.10")

path=mdf("file path")
Reza Rahemtola
  • 1,182
  • 7
  • 16
  • 30