roboflow / roboflow/inference

Slow Inference Pipeline with M3U8 Format

Open
#1,160 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
2.5k
Forks
319
Avg merge
1d 14h
Merged PRs (30d)
133

Description

Search before asking
  • I have searched the Inference issues and found no similar feature requests.
Question

Hi,

Introduction
While working with the inference pipeline, I had a significant performance problem when processing M3U8 (HTTP Live Streaming) format files. Unlike MP4 files which process smoothly, M3U8 inputs seem to cause skipping of frames in the pipeline. Could this be investigated? It's needed for all live-streaming services and I would really like to use it for my workflow as well.

I am not testing live, so I have a video (which plays as a livestream at 25 fps in m3u8 format) and when I manually use openCV to look at the frames and process them everything works and looks fine. When I use the inference pipeline, it starts skipping a lot of the frames. I also tried different max_fps (from 1 to 100), but the problem stays.

Question
How can I make sure that none of the frames from my m3u8 stream are skipped using the inference pipeline?

My code is the following:

self.pipeline = InferencePipeline.init_with_workflow(
            api_key=self.api_key,
            workspace_name=self.workspace_name,
            workflow_id=self.workflow_id,
            video_reference=video_url,
            max_fps=100,
            on_prediction=self.process_frame
        )
       
self.pipeline.start()
self.pipeline.join()

Any help would be appreciated!

With kind regards,
Emma

Additional

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the frame-skipping behavior through InferencePipeline.init_with_workflow using the reported M3U8 video_reference and different max_fps values, then compare it with the author's direct OpenCV processing. Trace how the pipeline handles M3U8 input and define done as processing the stream without unexplained frame loss.

Written by the indexing model from the issue text.

Assessment

Tech stack
opencv, python
Domain
computer-vision, performance, stream-processing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.