How to Run Video Analytics for Manufacturing

A blister pack is missing a tablet, cartons back up on a conveyor, or a worker steps into a forklift lane. A camera can capture each of these events, and computer vision can help identify them. You can run video analytics for manufacturing using existing IP cameras, provided they support a compatible video stream and capture enough detail for the task.
With video analytics, you can turn that footage into inspection results, production counts, and alerts that your team can act on. With Roboflow Workflows, you can connect computer vision models, object tracking, and rules to build an application for your production line. Deploy it near your cameras with Roboflow Deployment Manager (opens in a new tab), or process live video on managed cloud GPUs with Roboflow Cloud Streaming (opens in a new tab).
In this guide, we’ll explore how manufacturers use video analytics for safety, quality control, and production monitoring. We’ll cover how to connect cameras to Roboflow, choose between edge and cloud processing, and validate results against real factory conditions. Start with one camera and one measurable task, such as counting cartons leaving a packing station, then expand as you verify performance.
What Is Video Analytics in Manufacturing?
Manufacturing video analytics uses computer vision to analyze footage from cameras installed around a plant. Conventional CCTV systems record or display video for operators to review. Video analytics processes the footage to identify specific objects and activities, producing data that can be used without manually reviewing every recording.
As a product moves along a conveyor, the camera can capture it in several video frames before it leaves the camera's view. With tracking, the system can recognize that these detections belong to the same product and count it only once.
The accuracy of these results depends on camera coverage and the objects the model has been trained to recognize. The factory also decides what happens when the system detects a problem, such as sending an alert to an operator or saving the result for later review.
Video Analytics for Manufacturing Safety
In a manufacturing plant, forklifts often move near areas where workers walk between production stations. Video analytics can help safety teams monitor situations such as:
- A worker enters the forklift lane. A Time in Zone (opens in a new tab) block measures how long each tracked worker stays inside a zone drawn over the lane. The Workflow can then send an alert or save an image for the safety team to review.
- A worker is seen without a helmet or high-visibility vest in an area where wearing that safety equipment is required.

Cameras can miss activity when machinery or stacked materials block their view. They can also raise false alerts. For example, a worker may be wearing a helmet, but if the camera cannot see it clearly, the system may report that the worker is missing safety equipment. Safety teams should review the footage before treating an alert as a confirmed violation.
Before using the system during regular shifts, safety teams should test it with footage recorded under different working conditions. They should check how often the system misses real safety issues and how often it raises false alerts. If the system keeps missing safety issues or sending false alerts despite having a clear camera view, the model may need to be retrained using more footage from the plant.
Video Analytics for Manufacturing Quality Control
In a factory packaging medicine tablets, a camera can inspect each blister pack as it moves along the production line. A computer vision model checks whether every pocket in the pack contains a tablet. If a tablet is missing, the pack is marked for inspection.
Cracked tablets require a different check. A Dynamic Crop (opens in a new tab) block cuts each detected tablet out of the frame, and a classification model labels each crop as cracked or intact. The classification model needs to be trained on examples of this damage, including cracks that are difficult to see at first glance.
Camera position and lighting affect both checks. The camera needs a clear view of the tablets, with enough detail to detect any damage. Even when the tablets are visible through the packaging, reflections from the plastic can hide cracks. Manufacturers should test the model using footage from their production line to see how well it performs under actual working conditions.

The system can also track a defective blister pack as it moves along the conveyor, helping operators identify which pack needs to be removed for inspection.
Manufacturers should test their quality control system for two types of errors:
| Error type | What happens | Why it matters |
|---|---|---|
| False reject | A good product is marked as defective. | It leads to unnecessary inspections or rework. |
| Missed defect | A defective product passes inspection. | It may reach the customer and require a return. |
Manufacturers should measure both errors and decide which one could cause more serious problems. For medicine packaging, missed defects need particular attention because faulty products could reach patients.
Video Analytics for Production Workflow Monitoring
In a factory where cartons move along a conveyor, a camera can help measure how many products leave the packing station. A computer vision model detects the cartons, while a ByteTrack Tracker (opens in a new tab) block gives each one an ID as it moves through the video.
A Line Counter (opens in a new tab) block uses a counting line drawn across the conveyor in the video. When a tracked carton crosses this line in the correct direction, the block adds one to the count. Manufacturers can use these results to calculate how many cartons pass each minute and see when production slows down.
Operators can also use the footage to spot problems on the production line, such as:
- Product buildup: Cartons begin to form a long line where two conveyors meet. This could mean the next conveyor is moving too slowly or has stopped.
- Idle stations: Cartons stop moving through a workstation during an active production run.
To find out whether a conveyor stopped for planned maintenance or because of a machine problem, operators may need to check equipment records or speak with staff.
Manufacturers can compare the recorded counts with their production reports. If the numbers do not match, they can review the footage for possible counting errors. For example, the system might count two cartons moving close together as one.
What Do You Need to Run Manufacturing Video Analytics?
Before building a Roboflow Workflow, check that the camera footage is suitable for the task and that the computer running the Workflow can process it.
| Requirement | What to check |
|---|---|
| Camera or sample video | Use a recorded video or an RTSP camera stream that shows the production line clearly. For live cameras, make sure the computer running the Workflow can connect to the stream. |
| Image quality | Products or defects should be clearly visible, with enough image detail and lighting to detect them. Check for motion blur and poor exposure. |
| Computer vision model | Search Roboflow Universe for a model that detects the target objects. If no suitable model is available, collect and label images of your products and train a custom model in Roboflow. |
| Processing hardware | Run the Workflow on your own hardware or use a Roboflow cloud deployment. Test the chosen setup to check whether it can process video at the required speed. |
| Success criteria | Compare the Workflow's results with a manual count or inspection of the same footage. |
The public model used in the carton-counting example is a starting point. For production use, choose a model that has been tested on footage from the actual factory line.
How to Run Video Analytics for Manufacturing with Roboflow
Many manufacturing plants already have IP cameras installed around their production lines. Cameras that support RTSP (Real-Time Streaming Protocol) can provide a live video stream to an application over the network. This means manufacturers can reuse existing cameras if they provide a clear view of the area being monitored.
Roboflow Inference (opens in a new tab) can take frames from the video stream and pass them to a Roboflow Workflow through its image input. A Workflow is built by connecting blocks, with each block performing a specific task.
Inside the Workflow, an object detection model can identify workers or products in the video. Tracking can be added when the system needs to follow movement across frames. Other blocks apply rules to the predictions and decide which observations should be reported.

For example, a safety Workflow can be configured to report when a worker enters a restricted area. A production Workflow may return the number of products counted, while a quality Workflow can provide inspection results. The output depends on the blocks and rules used in each Workflow.
Once the Workflow produces its results, manufacturers can use them in different ways:
- Live dashboards: Display the latest results on a monitoring screen so staff can check activity across the plant.
- Event records: The Roboflow Vision Events (opens in a new tab) block sends images, predictions, and event details to Roboflow, creating a record of what happened during each shift that can be searched and filtered in the Roboflow dashboard.
- Other factory systems: A configured integration, such as a Webhook Sink (opens in a new tab), can send selected results to another application for further processing.

Count Cartons with Roboflow Workflows
For this example, I used the boxes-on-a-conveyer-belt/8 model (opens in a new tab) from Roboflow Universe (opens in a new tab) to detect cartons moving along a conveyor. The model is configured to detect the box class.

The detections pass to a ByteTrack Tracker block, which assigns each carton an ID as it moves through the video. A Line Counter block uses a vertical line from (720, 180) to (720, 650) to count cartons crossing the line. The line is positioned for the sample video and needs to be adjusted for other camera views.

Visualization blocks draw the counting line, bounding boxes, and tracking IDs on the frames. A Text Display block shows the current count. The Workflow returns the annotated frame as output_image and the number of cartons counted as count_in.
Run the Workflow on Video
Use Roboflow Deployment Manager (opens in a new tab) to run the carton-counting Workflow on a factory camera and monitor the deployment from your Roboflow dashboard. RFDM is available on Enterprise plans.
- Connect an edge device. Open Deployments, add a device, and follow the setup instructions for your device type. Make sure the device can access the camera on the factory network.
- Add a stream. Open the device and click Add Stream. Select RTSP Stream and enter the camera’s RTSP URL. To test recorded footage, select RTSP Simulator and upload your video.
- Select the carton-counting Workflow. Choose Continuous mode to process the video continuously, then create the stream.
- Check the results. Once the stream is running, review frames and logs from the dashboard. Adjust the counting line to match the camera view and compare the automated count with a manual count.
For live video processed on managed cloud GPUs, use Roboflow Cloud Streaming (opens in a new tab).
Optional: Run the Workflow Locally with Python
You can also run the Workflow from a Python application using Roboflow Inference. The example below processes a recorded video or RTSP stream, displays the annotated frames, and prints the carton count.
First, install the required packages:
pip install inference opencv-pythonThen run the following Python script:
import os
import cv2
from inference import InferencePipeline
def on_prediction(result, video_frame):
annotated = result.get("output_image")
if annotated is not None:
cv2.imshow(
"Carton Counting",
annotated.numpy_image
)
cv2.waitKey(1)
print("Count:", result.get("count_in"))
pipeline = InferencePipeline.init_with_workflow(
api_key=os.environ["ROBOFLOW_API_KEY"],
workspace_name="YOUR_WORKSPACE_ID",
workflow_id="YOUR_WORKFLOW_ID",
video_reference="YOUR_VIDEO_PATH_OR_RTSP_URL",
on_prediction=on_prediction,
)
pipeline.start()
pipeline.join()
cv2.destroyAllWindows()Before running the script, set ROBOFLOW_API_KEY as an environment variable. To find the Workspace ID and Workflow ID, click Use in the workflow editor. The panel displays a code example containing both identifiers. Copy those values into YOUR_WORKSPACE_ID and YOUR_WORKFLOW_ID in the Python script.
For a recorded video, replace YOUR_VIDEO_PATH_OR_RTSP_URL with the path to the video file. For a live camera, enter its RTSP URL instead. To monitor different products, select a suitable model in the Workflow's Object Detection Model block. Also adjust the counting line to match the camera view.
Carton Counting Test Results
I tested the Workflow on a 10-second video with five cartons. The automated count matched the manual count.
In a second test, the model missed a carton when two boxes moved close together.
I lowered the confidence threshold from 0.3 to 0.25 and ran the video again. The Roboflow preview then counted all seven cartons.
| Test | Manual count | Automated count | Counting errors |
|---|---|---|---|
| Five-carton video | 5 | 5 | 0 |
| Seven-carton video (before correction) | 7 | 6 | 1 |
| Seven-carton video (after correction) | 7 | 7 | 0 |
All tests used model boxes-on-a-conveyer-belt/8, and ran on an Intel Core i5-10500H CPU. It processed 241 frames from a 10-second video in 17.47 seconds, averaging 13.80 processed FPS.
Lowering the confidence threshold might help the model detect more cartons, although it can also increase false detections. If the model continues to miss cartons that are close together, retraining it with more images of these cases could improve its accuracy.
The finished carton-counting Workflow can be forked and configured with a different video source or detection model.
Edge and Cloud Video Analytics with Roboflow
Roboflow supports video analytics on the factory floor and in the cloud. The right deployment depends on how quickly you need results, your available network bandwidth, and how you want to manage the application.
Run Factory Cameras with Roboflow Deployment Manager
Roboflow Deployment Manager (opens in a new tab) (RFDM) gives enterprise teams one place to configure camera streams, deploy Workflows, and monitor edge devices across production lines and sites.
Your Workflow runs on supported hardware near the cameras, keeping model inference local. From the Roboflow dashboard, you can check stream status, inspect logs, and manage deployments remotely. Teams can start with RFDM for applications such as counting cartons throughout a shift or inspecting products before they reach the next station.
Run Analytics on Roboflow’s Cloud Infrastructure
Roboflow Cloud Streaming (opens in a new tab) runs Workflows on live cameras using managed cloud GPUs. For local RTSP cameras, the Roboflow Video Connector runs on a computer on the camera network and sends video to Roboflow for processing.
For individual image checks, use the Serverless Cloud API (opens in a new tab). It runs models and Workflows on infrastructure that scales automatically. For example, an application can submit an image when a packaging inspection is triggered.
If your application needs dedicated cloud resources, Dedicated Deployments (opens in a new tab) provide private servers managed by Roboflow.
Match Your Requirements to a Roboflow Deployment
| Factor | Edge deployment with RFDM | Roboflow cloud deployment |
|---|---|---|
| Response time | Run inference near the camera to avoid an internet round trip for each prediction. Validate processing speed on the selected device. | Use Cloud Streaming for live video or Serverless Cloud API for image requests. Measure network and processing time against your application’s requirements. |
| Internet connection | Connectivity supports setup, remote management, and monitoring. Sites without internet access need a deployment prepared for offline operation. | Cloud processing requires a connection to Roboflow. Choose this approach where connectivity supports the required upload rate and response time. |
| Bandwidth | Process video locally and configure which results or events are sent to other systems. | Use Cloud Streaming for continuous video, or Serverless Cloud API when the application only needs individual image checks. |
| Hardware and management | Supported edge hardware provides the compute; RFDM centralizes deployment configuration, stream management, and monitoring. | Roboflow manages the inference infrastructure. Local RTSP cameras use a Video Connector on the camera network to send video to the cloud. |
You can also combine these approaches. A packaging line might run inspections locally through RFDM and send selected results to a central reporting system. Start with the requirements of one camera and one task, then measure accuracy, processing speed, and connectivity before expanding.
Conclusion and Next Steps
With video analytics, manufacturers can use camera footage to identify visible problems and measure production activity. Accurate results depend on clear camera views and testing the system under real factory conditions.
Start with one camera and one measurable task, such as counting cartons crossing a line. Fork the carton-counting Workflow, adjust it for your camera view, and compare its results with a manual count. When you’re ready to connect a live camera, use Roboflow Deployment Manager to deploy and monitor the application on supported edge hardware, or choose Cloud Streaming to run it on Roboflow’s managed cloud infrastructure. Validate performance across normal production conditions, then expand to the next line.
Further reading: