Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utilities for video streaming #503

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open

utilities for video streaming #503

wants to merge 23 commits into from

Conversation

deigen
Copy link
Contributor

@deigen deigen commented Feb 3, 2025

pyav-based and streaming-related utilities and changes for the following:

  • stream_utils.py with
    • classes to interface with streams of byte chunks using file-like objects read()
    • readahead iterator (apply next() ahead of yield using single bg thread)
    • parallel map (apply function to next n of a stream at a time, yield in order)
  • video_utils.py with
    • stream and decode from rtsp url
    • decode downloaded video (todo item to check for streamability with head bytes)
    • stream from byte chunks, incoming in grpc stream or streaming url download
    • container conversion, e.g. from mp4 to mpegts, to upload videos in a streamable container so they can be processed immediately (mp4 requires downloading the entire file first before decoding, since some info is at the end; mpegts can stream using the same encodings as the original file, though there are some details around exactly matching timestamps)
  • streaming url downloading
  • in StreamModelOutputs run ensure_urls_downloaded as stream comes in, do not play stream to end
  • make ensure_urls_downloaded() optional with flag, move into model
  • made getting model_info params in predict calls thread-safe

@deigen deigen marked this pull request as ready for review February 6, 2025 00:12
Copy link

github-actions bot commented Feb 6, 2025

Code Coverage

Package Line Rate Health
clarifai 43%
clarifai.cli 67%
clarifai.client 71%
clarifai.client.auth 74%
clarifai.constants 100%
clarifai.datasets 100%
clarifai.datasets.export 80%
clarifai.datasets.upload 75%
clarifai.datasets.upload.loaders 37%
clarifai.models 100%
clarifai.modules 0%
clarifai.rag 72%
clarifai.runners 13%
clarifai.runners.models 58%
clarifai.runners.utils 61%
clarifai.schema 100%
clarifai.urls 80%
clarifai.utils 77%
clarifai.utils.evaluation 67%
clarifai.workflows 94%
Summary 67% (4570 / 6773)

Minimum allowed line rate is 50%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant