"""Decode the retained synthetic capture and refresh its packet; no network."""

from pathlib import Path
import subprocess
import sys

from media import import_capture

PROJECT = Path(__file__).resolve().parents[1]


def main():
    destination = PROJECT / 'public/transfer/moss'
    if destination.exists():
        raise SystemExit('Example frames already exist. Use a fresh extracted project for a reproducible preparation.')
    import_capture(PROJECT / 'examples/transfer/source-capture.webm', destination, [0, 0, 1920, 1080], 'native-recording')
    subprocess.run([sys.executable, str(PROJECT / 'examples/transfer/make-packet.py')], check=True)
    print('Prepared synthetic packet and decoded capture frames. Real-production gates remain untested.')


if __name__ == '__main__':
    main()
