Skip to content

How to parse xml files

Mirco Dilly edited this page May 21, 2021 · 1 revision

Parsing XML-Datlog with RDPlot

Basic Structure

XML (Extensible Markup Language; .xml) formatted files are widely used for storing hierarchical data structures. These files are structured by using so called tags <Tag> ... </Tag>. Every file represents one data point (with mutliple entries). Each data entry is described by a Key specification, some Value and the corresponding Unit (optional). An example file is given below:

<?xml version="1.0" encoding="utf-8"?>
<Logfile>
    <KeyX>
        <Value> valueX </Value>
        <Unit> unitX </Unit>
    </KeyX>
    <KeyY>
        <Value> valueY </Value>
        <Unit> unitY </Unit>
    </KeyY>
    <KeyZ>
        <Value> valueZ </Value>
        <Unit> unitZ </Unit>
    </KeyZ>
</Logfile>

Parsing XML-Datlog files

If the xml-formatted file complies with the specifications, RDPlot will automatically recognize the file format and parse it. All data entries (QP, Sequence Name, ...) are contained inside the file, except for the configuration value. The configuration config is determined by the name of the directory, which contains the xml-datlogs. For example, the following directory tree holds the results, which should be parsed by RDPlot:

Results
├── VTM-3.2-Base
│       └── RaceHorsesL_832x480_QP22.xml
│       └── RaceHorsesL_832x480_QP27.xml
│       └── RaceHorsesL_832x480_QP32.xml
│       └── RaceHorsesL_832x480_QP37.xml
└── VTM-3.2-Test
        └── RaceHorsesL_832x480_QP22.xml
        └── RaceHorsesL_832x480_QP27.xml
        └── RaceHorsesL_832x480_QP32.xml
        └── RaceHorsesL_832x480_QP37.xml

Here, the names of the directories VTM-3.2-Base and VTM-3.2-Test would also specify the according values for the config variables. RDPlot will parse the tree above and display the tree view of the input files in the Sequences-Section, which can be found on the left side of the Plot-Area. The tree view will look like this:

XML-Datlog
└── RaceHorsesL_832x480_30fps_10bit_420pf.yuv
    ├── VTM-3.2-Base
    │   └── 22
    │   └── 27
    │   └── 32
    │   └── 37
    └── VTM-3.2-Test
        └── 22
        └── 27
        └── 32
        └── 37

Key Specification

In xml-datlog files, the keys and unit specifiers are not case sensitive (camel case is used for readability). The key specifiers below are only examples. You could also use different specifiers, which fit to your simulation data.

Key Unit Description
Codec - Codec class
SeqName - Name of the video sequence
Rate kbps, Mbps  bitrate in kbit/sec, mbit/sec
PsnrY dB Luma PSNR in db for full bitstream
PsnrU dB Chroma U PSNR in db for full bitstream
PsnrV dB Chrome V PSNR in db for full bitstream
EncDecMatch - Binary value indicating consistency between the encoder raw video output and the decoder raw video output
Pixels  - Number of pixels per line in raw video file
Lines  - Number of lines per line in raw video file
Frq - Frame rate of output video
NumFrms - Number of decoded frames
InBitDepth - Bit depth of raw input video
OutBitDepth - Bit depth of raw output video
QP - Quantization parameter for simulation
EncTime sec,msec encoder runtime in seconds, milliseconds
DecTime sec,msec decoder runtime in seconds,milliseconds
Machine - Name of the machine, the simulation has been performed on
Directory - Absolute path to simulation directory