<commit_before>"""
`libav* <http://www.ffmpeg.org/>`_ front-end used to:

- Read stored/archived media (e.g. `pcap <http://www.tcpdump.org/pcap.html>`_ed `rtp <https://tools.ietf.org/html/rfc3550>`_ packets).
- Reconstruct frames (e.g. depacketize a frame from its rtp packets).
- Synchronize reconstructed streams of frame data (e.g. audio and video).
- Mux frame stream(s) to a container (e.g. `mkv <http://www.matroska.org/>`_ file) using libav*.

Motivating use case was:

- depacketizing rtp payloads from `mjr <https://github.com/meetecho/janus-gateway>`_ files and 
- muxing them to an mkv file

which you can do e.g. like:

.. code:: python

    import marm
    
    v_pkts = marm.mjr.MJRRTPPacketReader(
        'path/to/video.mjr', 'rb',
        packet_type=marm.vp8.VP8RTPPacket,
    )
    v_width, v_height = marm.rtp.probe_video_dimensions(v_pkts)
    v_pkts.reset()
    v_frame_rate = marm.rtp.estimate_video_frame_rate(v_pkts, window=10)
    v_pkts.reset()
    v_frames = marm.VideoFrames(v_pkts)
    
    a_pkts = marm.mjr.MJRRTPPacketReader(
        'path/to/audio.mjr', 'rb',
        packet_type=marm.opus.OpusRTPPacket,
    )
    a_frames = marm.Frames(a_pkts)
    
    with open('path/to/muxed.mkv', 'wb') as mkv_fo:
        marm.frame.mux(
            mkv_fo,
            audio_profile={
                'encoder_name': 'libopus',
                'bit_rate': 96000,
                'sample_rate': 48000,
                'time_base': (1, 1000),
            },
            audio_packets=a_frames,
            video_profile={
                'encoder_name': 'libpvx',
                'pix_fmt': marm.VideoFrame.PIX_FMT_YUV420P,
                'width': v_width,
                'height': v_height,
                'frame_rate': v_frame_rate,
                'bit_rate': 4000000,
                'time_base': (1, 1000),
            },
            video_packets=v_frames,
        )

"""
__version__ = '0.2.6'

__all__ = [
    'Frame',
    'Frames',
    'AudioFrame',
    'VideoFrame',
    'VideoFrames',
    'FrameProxy',
    'FrameFilter',
    'frame',
    'rtp',
    'opus',
    'mjr',
    'pcap',
    'FFProbe',
    'FFMPEG',
]

# frames
from .frame import (<commit_msg>release v0.2.7<commit_after>"""
`libav* <http://www.ffmpeg.org/>`_ front-end used to:

- Read stored/archived media (e.g. `pcap <http://www.tcpdump.org/pcap.html>`_ed `rtp <https://tools.ietf.org/html/rfc3550>`_ packets).
- Reconstruct frames (e.g. depacketize a frame from its rtp packets).
- Synchronize reconstructed streams of frame data (e.g. audio and video).
- Mux frame stream(s) to a container (e.g. `mkv <http://www.matroska.org/>`_ file) using libav*.

Motivating use case was:

- depacketizing rtp payloads from `mjr <https://github.com/meetecho/janus-gateway>`_ files and 
- muxing them to an mkv file

which you can do e.g. like:

.. code:: python

    import marm
    
    v_pkts = marm.mjr.MJRRTPPacketReader(
        'path/to/video.mjr', 'rb',
        packet_type=marm.vp8.VP8RTPPacket,
    )
    v_width, v_height = marm.rtp.probe_video_dimensions(v_pkts)
    v_pkts.reset()
    v_frame_rate = marm.rtp.estimate_video_frame_rate(v_pkts, window=10)
    v_pkts.reset()
    v_frames = marm.VideoFrames(v_pkts)
    
    a_pkts = marm.mjr.MJRRTPPacketReader(
        'path/to/audio.mjr', 'rb',
        packet_type=marm.opus.OpusRTPPacket,
    )
    a_frames = marm.Frames(a_pkts)
    
    with open('path/to/muxed.mkv', 'wb') as mkv_fo:
        marm.frame.mux(
            mkv_fo,
            audio_profile={
                'encoder_name': 'libopus',
                'bit_rate': 96000,
                'sample_rate': 48000,
                'time_base': (1, 1000),
            },
            audio_packets=a_frames,
            video_profile={
                'encoder_name': 'libpvx',
                'pix_fmt': marm.VideoFrame.PIX_FMT_YUV420P,
                'width': v_width,
                'height': v_height,
                'frame_rate': v_frame_rate,
                'bit_rate': 4000000,
                'time_base': (1, 1000),
            },
            video_packets=v_frames,
        )

"""
__version__ = '0.2.7'

__all__ = [
    'Frame',
    'Frames',
    'AudioFrame',
    'VideoFrame',
    'VideoFrames',
    'FrameProxy',
    'FrameFilter',
    'frame',
    'rtp',
    'opus',
    'mjr',
    'pcap',
    'FFProbe',
    'FFMPEG',
]

# frames
from .frame import (
{'fraction_non_alphanumeric': 0.13884448504224708, 'fraction_numerical': 0.019410824389129937, 'mean_word_length': 2.1285714285714286, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 4, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2079996', 'n_tokens_mistral': 1733, 'n_tokens_neox': 1615, 'n_words': 307}