from typing import OrderedDict


def get_chunks_stats(chunks):
    """Iterates over chunks and collects info about main features, such
    as:
    - labels
    - classes
    - tracks

    Args:
        chunks (list): Tupls of chunks with video data

    Returns:
        OrderedDict: Statistics of chunks
    """
    stats = OrderedDict()
    classes = OrderedDict()
    counted_tracks = []
    labels = []
    chunk_classes = []

    for chunk in chunks:
        if chunk['track'] not in counted_tracks:
            stats['tracks_in_script_total'] = stats.setdefault('tracks_in_script_total', 0) + 1
            counted_tracks.append(chunk['track'])
        if chunk['label'] not in labels:
            labels.append(chunk['label'])
        if chunk['class'] not in chunk_classes:
            chunk_classes.append(chunk['class'])
        classes[chunk['class']] = classes.setdefault(chunk['class'], 0) + 1

    stats['labels'] = labels
    stats['classes'] = classes
    stats['tracks_used'] = counted_tracks
    return stats