klv-parser


Nameklv-parser JSON
Version 0.0.3 PyPI version JSON
download
home_pagehttps://github.com/paretech/klvdata/
SummaryA Python library for parsing MISB/STANAG 4609 Key Length Value (KLV) metadata.
upload_time2024-09-27 15:44:09
maintainerNone
docs_urlNone
authorPazshp
requires_python>=3.5
licenseMIT
keywords stanag 4609 misb klv metadata video
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            klv_parser
==========
.. image:: https://travis-ci.org/paretech/klvdata.svg?branch=master
    :target: https://travis-ci.org/paretech/klvdata

.. image:: https://coveralls.io/repos/github/paretech/klvdata/badge.svg?branch=master
    :target: https://coveralls.io/github/paretech/klvdata?branch=master

.. image:: https://img.shields.io/pypi/v/klvdata.svg
        :target: https://pypi.org/project/klvdata/

What?
-----
Klvdata is a Python library for parsing and constructing Key Length Value (KLV_) formatted binary streams. Common uses of the library would be parsing and displaying `MISB ST`_ 0601 Unmanned Air System (UAS) metadata from `STANAG 4609`_ compliant `MPEG-2 Transport Streams (TS) (MPEG-TS)`_. Note that klvdata alone cannot de-mux KLV data from an MPEG-2 TS, but programs like FFmpeg_ and GStreamer_ can be used with klvdata in the workflow to perform the function.

.. _KLV: https://en.wikipedia.org/wiki/KLV
.. _STANAG 4609: http://www.gwg.nga.mil/misb/docs/nato_docs/STANAG_4609_Ed3.pdf
.. _MPEG-2 Transport Streams (TS) (MPEG-TS): https://en.wikipedia.org/wiki/MPEG_transport_stream
.. _MISB ST: http://www.gwg.nga.mil/misb/st_pubs.html
.. _FFMpeg: https://www.ffmpeg.org/
.. _GStreamer: https://gstreamer.freedesktop.org/


Why?
----
Not many opensource options available.

Features
--------
- Parses KLV metadata streams.
- Supports `MISB ST`_ 0601 UAS Datalink Local Set.
- Supports `MISB ST`_ 0102 Security Metadata Local Set.
- Built for Python 3.5, 3.6.
- Requires no external Python dependencies.

.. _MISB ST: http://www.gwg.nga.mil/misb/st_pubs.html

Quick Start
-----------
Try these commands in your GNU/Linux terminal.

First:

.. code-block:: console

    $ pip3 install klvdata
    
    $ wget https://raw.githubusercontent.com/paretech/klvdata/master/data/DynamicConstantMISMMSPacketData.bin

    $ cat << EOF > klvdata_test.py
    #!/usr/bin/env python3
    import sys, klvdata;
    for packet in klvdata.StreamParser(sys.stdin.buffer.read()): packet.structure()
    EOF


And then:

.. code-block:: console

    $ python3 ./klvdata_test.py < DynamicConstantMISMMSPacketData.bin

        <class 'klvdata.misb0601.UASLocalMetadataSet'>
            <class 'klvdata.misb0601.PrecisionTimeStamp'>
            <class 'klvdata.misb0601.MissionID'>
            <class 'klvdata.misb0601.PlatformHeadingAngle'>
            <class 'klvdata.misb0601.PlatformPitchAngle'>
            <class 'klvdata.misb0601.PlatformRollAngle'>
            <class 'klvdata.misb0601.PlatformDesignation'>
            <class 'klvdata.misb0601.ImageSourceSensor'>
            <class 'klvdata.misb0601.ImageCoordinateSystem'>
            <class 'klvdata.misb0601.SensorLatitude'>
            <class 'klvdata.misb0601.SensorLongitude'>
            <class 'klvdata.misb0601.SensorTrueAltitude'>
            <class 'klvdata.misb0601.SensorHorizontalFieldOfView'>
            <class 'klvdata.misb0601.SensorVerticalFieldOfView'>
            <class 'klvdata.misb0601.SensorRelativeAzimuthAngle'>
            <class 'klvdata.misb0601.SensorRelativeElevationAngle'>
            <class 'klvdata.misb0601.SensorRelativeRollAngle'>
            <class 'klvdata.misb0601.SlantRange'>
            <class 'klvdata.misb0601.TargetWidth'>
            <class 'klvdata.misb0601.FrameCenterLatitude'>
            <class 'klvdata.misb0601.FrameCenterLongitude'>
            <class 'klvdata.misb0601.FrameCenterElevation'>
            <class 'klvdata.misb0102.SecurityLocalMetadataSet'>
                <class 'klvdata.misb0102.SecurityClassification'>
                <class 'klvdata.misb0102.UnknownElement'>
                <class 'klvdata.misb0102.UnknownElement'>
                <class 'klvdata.misb0102.UnknownElement'>
                <class 'klvdata.misb0102.UnknownElement'>
                <class 'klvdata.misb0102.UnknownElement'>
            <class 'klvdata.misb0601.UASLSVersionNumber'>
            <class 'klvdata.misb0601.UnknownElement'>
            <class 'klvdata.misb0601.Checksum'>

If you have FFmpeg installed and want to try it on real video from a drone with embedded KLV metadata (~97 MB Download):

.. code-block:: console

    $ wget http://samples.ffmpeg.org/MPEG2/mpegts-klv/Day%20Flight.mpg
    $ ffmpeg -i Day\ Flight.mpg -map data-re -codec copy -f data - | python3 ./klvdata_test.py

        <class 'klvdata.misb0601.UASLocalMetadataSet'>
            <class 'klvdata.misb0601.PrecisionTimeStamp'>
            <class 'klvdata.misb0601.UASLSVersionNumber'>
            <class 'klvdata.misb0601.PlatformHeadingAngle'>
            <class 'klvdata.misb0601.PlatformPitchAngle'>
            <class 'klvdata.misb0601.PlatformRollAngle'>
            <class 'klvdata.misb0601.ImageSourceSensor'>
            <class 'klvdata.misb0601.ImageCoordinateSystem'>
            <class 'klvdata.misb0601.SensorLatitude'>
            <class 'klvdata.misb0601.SensorLongitude'>
            <class 'klvdata.misb0601.SensorTrueAltitude'>
            <class 'klvdata.misb0601.SensorHorizontalFieldOfView'>
            <class 'klvdata.misb0601.SensorVerticalFieldOfView'>
            <class 'klvdata.misb0601.SensorRelativeAzimuthAngle'>
            <class 'klvdata.misb0601.SensorRelativeElevationAngle'>
            <class 'klvdata.misb0601.SensorRelativeRollAngle'>
            <class 'klvdata.misb0601.SlantRange'>
            <class 'klvdata.misb0601.TargetWidth'>
            <class 'klvdata.misb0601.FrameCenterLatitude'>
            <class 'klvdata.misb0601.FrameCenterLongitude'>
            <class 'klvdata.misb0601.FrameCenterElevation'>
            <class 'klvdata.misb0601.TargetLocationLatitude'>
            <class 'klvdata.misb0601.TargetLocationLongitude'>
            <class 'klvdata.misb0601.TargetLocationElevation'>
            <class 'klvdata.misb0601.PlatformGroundSpeed'>
            <class 'klvdata.misb0601.GroundRange'>
            <class 'klvdata.misb0601.Checksum'>

            [...]

Documentation
-------------
Documentation is available at https://paretech.github.io/klvdata.

Contributing
------------
Contributions are welcome! See `Contributing <CONTRIBUTING.md>`_ for details.

Contributors List:
------------------
- `Fran Raga <https://github.com/All4Gis>`_

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/paretech/klvdata/",
    "name": "klv-parser",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": null,
    "keywords": "STANAG 4609, MISB, KLV, Metadata, Video",
    "author": "Pazshp",
    "author_email": "pazshp@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/50/17/e2ccfa1ec613f1289411fd469196d7b1b3e4ce485f7d5b8fd3ab8a9537cc/klv_parser-0.0.3.tar.gz",
    "platform": null,
    "description": "klv_parser\n==========\n.. image:: https://travis-ci.org/paretech/klvdata.svg?branch=master\n    :target: https://travis-ci.org/paretech/klvdata\n\n.. image:: https://coveralls.io/repos/github/paretech/klvdata/badge.svg?branch=master\n    :target: https://coveralls.io/github/paretech/klvdata?branch=master\n\n.. image:: https://img.shields.io/pypi/v/klvdata.svg\n        :target: https://pypi.org/project/klvdata/\n\nWhat?\n-----\nKlvdata is a Python library for parsing and constructing Key Length Value (KLV_) formatted binary streams. Common uses of the library would be parsing and displaying `MISB ST`_ 0601 Unmanned Air System (UAS) metadata from `STANAG 4609`_ compliant `MPEG-2 Transport Streams (TS) (MPEG-TS)`_. Note that klvdata alone cannot de-mux KLV data from an MPEG-2 TS, but programs like FFmpeg_ and GStreamer_ can be used with klvdata in the workflow to perform the function.\n\n.. _KLV: https://en.wikipedia.org/wiki/KLV\n.. _STANAG 4609: http://www.gwg.nga.mil/misb/docs/nato_docs/STANAG_4609_Ed3.pdf\n.. _MPEG-2 Transport Streams (TS) (MPEG-TS): https://en.wikipedia.org/wiki/MPEG_transport_stream\n.. _MISB ST: http://www.gwg.nga.mil/misb/st_pubs.html\n.. _FFMpeg: https://www.ffmpeg.org/\n.. _GStreamer: https://gstreamer.freedesktop.org/\n\n\nWhy?\n----\nNot many opensource options available.\n\nFeatures\n--------\n- Parses KLV metadata streams.\n- Supports `MISB ST`_ 0601 UAS Datalink Local Set.\n- Supports `MISB ST`_ 0102 Security Metadata Local Set.\n- Built for Python 3.5, 3.6.\n- Requires no external Python dependencies.\n\n.. _MISB ST: http://www.gwg.nga.mil/misb/st_pubs.html\n\nQuick Start\n-----------\nTry these commands in your GNU/Linux terminal.\n\nFirst:\n\n.. code-block:: console\n\n    $ pip3 install klvdata\n    \n    $ wget https://raw.githubusercontent.com/paretech/klvdata/master/data/DynamicConstantMISMMSPacketData.bin\n\n    $ cat << EOF > klvdata_test.py\n    #!/usr/bin/env python3\n    import sys, klvdata;\n    for packet in klvdata.StreamParser(sys.stdin.buffer.read()): packet.structure()\n    EOF\n\n\nAnd then:\n\n.. code-block:: console\n\n    $ python3 ./klvdata_test.py < DynamicConstantMISMMSPacketData.bin\n\n        <class 'klvdata.misb0601.UASLocalMetadataSet'>\n            <class 'klvdata.misb0601.PrecisionTimeStamp'>\n            <class 'klvdata.misb0601.MissionID'>\n            <class 'klvdata.misb0601.PlatformHeadingAngle'>\n            <class 'klvdata.misb0601.PlatformPitchAngle'>\n            <class 'klvdata.misb0601.PlatformRollAngle'>\n            <class 'klvdata.misb0601.PlatformDesignation'>\n            <class 'klvdata.misb0601.ImageSourceSensor'>\n            <class 'klvdata.misb0601.ImageCoordinateSystem'>\n            <class 'klvdata.misb0601.SensorLatitude'>\n            <class 'klvdata.misb0601.SensorLongitude'>\n            <class 'klvdata.misb0601.SensorTrueAltitude'>\n            <class 'klvdata.misb0601.SensorHorizontalFieldOfView'>\n            <class 'klvdata.misb0601.SensorVerticalFieldOfView'>\n            <class 'klvdata.misb0601.SensorRelativeAzimuthAngle'>\n            <class 'klvdata.misb0601.SensorRelativeElevationAngle'>\n            <class 'klvdata.misb0601.SensorRelativeRollAngle'>\n            <class 'klvdata.misb0601.SlantRange'>\n            <class 'klvdata.misb0601.TargetWidth'>\n            <class 'klvdata.misb0601.FrameCenterLatitude'>\n            <class 'klvdata.misb0601.FrameCenterLongitude'>\n            <class 'klvdata.misb0601.FrameCenterElevation'>\n            <class 'klvdata.misb0102.SecurityLocalMetadataSet'>\n                <class 'klvdata.misb0102.SecurityClassification'>\n                <class 'klvdata.misb0102.UnknownElement'>\n                <class 'klvdata.misb0102.UnknownElement'>\n                <class 'klvdata.misb0102.UnknownElement'>\n                <class 'klvdata.misb0102.UnknownElement'>\n                <class 'klvdata.misb0102.UnknownElement'>\n            <class 'klvdata.misb0601.UASLSVersionNumber'>\n            <class 'klvdata.misb0601.UnknownElement'>\n            <class 'klvdata.misb0601.Checksum'>\n\nIf you have FFmpeg installed and want to try it on real video from a drone with embedded KLV metadata (~97 MB Download):\n\n.. code-block:: console\n\n    $ wget http://samples.ffmpeg.org/MPEG2/mpegts-klv/Day%20Flight.mpg\n    $ ffmpeg -i Day\\ Flight.mpg -map data-re -codec copy -f data - | python3 ./klvdata_test.py\n\n        <class 'klvdata.misb0601.UASLocalMetadataSet'>\n            <class 'klvdata.misb0601.PrecisionTimeStamp'>\n            <class 'klvdata.misb0601.UASLSVersionNumber'>\n            <class 'klvdata.misb0601.PlatformHeadingAngle'>\n            <class 'klvdata.misb0601.PlatformPitchAngle'>\n            <class 'klvdata.misb0601.PlatformRollAngle'>\n            <class 'klvdata.misb0601.ImageSourceSensor'>\n            <class 'klvdata.misb0601.ImageCoordinateSystem'>\n            <class 'klvdata.misb0601.SensorLatitude'>\n            <class 'klvdata.misb0601.SensorLongitude'>\n            <class 'klvdata.misb0601.SensorTrueAltitude'>\n            <class 'klvdata.misb0601.SensorHorizontalFieldOfView'>\n            <class 'klvdata.misb0601.SensorVerticalFieldOfView'>\n            <class 'klvdata.misb0601.SensorRelativeAzimuthAngle'>\n            <class 'klvdata.misb0601.SensorRelativeElevationAngle'>\n            <class 'klvdata.misb0601.SensorRelativeRollAngle'>\n            <class 'klvdata.misb0601.SlantRange'>\n            <class 'klvdata.misb0601.TargetWidth'>\n            <class 'klvdata.misb0601.FrameCenterLatitude'>\n            <class 'klvdata.misb0601.FrameCenterLongitude'>\n            <class 'klvdata.misb0601.FrameCenterElevation'>\n            <class 'klvdata.misb0601.TargetLocationLatitude'>\n            <class 'klvdata.misb0601.TargetLocationLongitude'>\n            <class 'klvdata.misb0601.TargetLocationElevation'>\n            <class 'klvdata.misb0601.PlatformGroundSpeed'>\n            <class 'klvdata.misb0601.GroundRange'>\n            <class 'klvdata.misb0601.Checksum'>\n\n            [...]\n\nDocumentation\n-------------\nDocumentation is available at https://paretech.github.io/klvdata.\n\nContributing\n------------\nContributions are welcome! See `Contributing <CONTRIBUTING.md>`_ for details.\n\nContributors List:\n------------------\n- `Fran Raga <https://github.com/All4Gis>`_\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python library for parsing MISB/STANAG 4609 Key Length Value (KLV) metadata.",
    "version": "0.0.3",
    "project_urls": {
        "Homepage": "https://github.com/paretech/klvdata/"
    },
    "split_keywords": [
        "stanag 4609",
        " misb",
        " klv",
        " metadata",
        " video"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "18ad2b0a872cce051ceef60714b8355fcea16ce534503b9c18e9da032b9a4765",
                "md5": "dfcfb41c79ca082924c387cd570e8dcc",
                "sha256": "20e66d978b51070726f85c977cec287640d3bdbeed68983d3146af23c43513a0"
            },
            "downloads": -1,
            "filename": "klv_parser-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dfcfb41c79ca082924c387cd570e8dcc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5",
            "size": 30684,
            "upload_time": "2024-09-27T15:44:07",
            "upload_time_iso_8601": "2024-09-27T15:44:07.840384Z",
            "url": "https://files.pythonhosted.org/packages/18/ad/2b0a872cce051ceef60714b8355fcea16ce534503b9c18e9da032b9a4765/klv_parser-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5017e2ccfa1ec613f1289411fd469196d7b1b3e4ce485f7d5b8fd3ab8a9537cc",
                "md5": "defbfe8ff9fd1fe75082824c5a69c556",
                "sha256": "7e4ad715a4d695d0d6606c52b5283cb29313511649e17371f34c45189834275b"
            },
            "downloads": -1,
            "filename": "klv_parser-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "defbfe8ff9fd1fe75082824c5a69c556",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 32819,
            "upload_time": "2024-09-27T15:44:09",
            "upload_time_iso_8601": "2024-09-27T15:44:09.444770Z",
            "url": "https://files.pythonhosted.org/packages/50/17/e2ccfa1ec613f1289411fd469196d7b1b3e4ce485f7d5b8fd3ab8a9537cc/klv_parser-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-27 15:44:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "paretech",
    "github_project": "klvdata",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "lcname": "klv-parser"
}
        
Elapsed time: 0.60094s