October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
DocumentaryTube
Admit one · Blog

How to Monitor a 24/7 YouTube FFmpeg Stream with a Health Check Script

A reliable 24/7 stream monitor checks both local FFmpeg progress and YouTube’s feed and health status—while treating API failures and missing health data as unknown.
Opened Runtime6 min Written byDocumentaryTube Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use two independent checks: supervise FFmpeg on the host to confirm the encoder is alive and making progress, then query YouTube’s Live Streaming API to confirm it is receiving the feed and report its health. Neither check alone proves that viewers are getting a healthy stream. Keep API failures and unknown health separate from confirmed stream failures so a monitoring hiccup does not trigger an unnecessary restart.

What a useful health check needs to detect

A 24/7 stream has at least two failure domains: the FFmpeg process and the path from FFmpeg to YouTube. A process can still exist while stalled or disconnected; conversely, an API request can fail even when FFmpeg is sending video. Monitor these as separate signals and expose distinct results rather than reducing everything to one green or red value.

  • FFmpeg absent: the process has exited or cannot be found.
  • FFmpeg stalled: the process exists but its output or media progress has not advanced within your chosen window.
  • YouTube check unavailable: the API request failed, for example because of credentials, permissions, network trouble, or a temporary API error.
  • YouTube feed inactive or in error: the stream resource reports that YouTube is not receiving data or reports an error.
  • YouTube health bad or unknown: the health object reports configuration issues, or has no health data.
  • Healthy signals: local progress is current, YouTube reports an active feed, and the health and broadcast states are consistent with the intended stream.

This division helps you choose the right response: restart a failed encoder, inspect ingest or configuration problems, or repair monitoring access without treating an API outage as a video outage.

Understand YouTube’s stream and broadcast signals

The incoming feed: liveStream

YouTube’s liveStream resource describes the feed sent to YouTube. Its status.streamStatus field reports the ingestion state. YouTube documents these values:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
  • active: YouTube is receiving data via the stream.
  • created: the stream exists but has no valid CDN settings.
  • error: an error condition exists.
  • inactive: YouTube is not receiving the user’s stream.
  • ready: the stream has valid CDN settings.

ready is not the same as active: it indicates valid settings, not that data is currently arriving.

Health and configuration issues

The same resource’s status.healthStatus.status field reports good, ok, bad, or noData. YouTube defines good as no issues at warning severity or worse, ok as no error-severity issues, and bad as at least one error-severity issue. noData means YouTube’s backend has no health-status information; treat it as unknown, not as healthy.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Do not alert only on the summary label. Preserve configurationIssues[], including each issue’s type, severity, reason, and description, so an operator can see what needs attention. The object also includes lastUpdateTimeSeconds, a UNIX timestamp in seconds. Compare it with the current time and classify an old update as stale or unknown. The API documentation specifies the timestamp but no universal freshness threshold, so set one for your deployment.

The viewer-facing event: liveBroadcast

A liveBroadcast represents the event viewers see, not the incoming feed itself. Its lifecycle includes created, ready, liveStarting, live, complete, revoked, testStarting, and testing. The broadcast resource documentation describes these states. A broadcast can therefore be in a different state from the underlying stream; interpret both according to whether your channel is meant to be testing or live.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

YouTube requires the bound stream to have streamStatus=active before the broadcast can transition to testing or live. The transition method changes broadcast state and requires authorization. A monitor that only needs to report health should read status and alert, not change broadcast state automatically.

Build the local FFmpeg monitor

Run process supervision on the machine that launches FFmpeg, using its service manager or an equivalent watchdog. Capture the process exit status and logs, and track a progress signal tied to the actual FFmpeg invocation and media pipeline. Merely finding an FFmpeg process is insufficient: it might be blocked, disconnected, or producing unusable output.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2Ă— USB C male to USB A female adapters and 2Ă— USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
  1. Record process identity. Track the supervised service or process instance that runs the intended stream, rather than matching an overly broad process name that could belong to another FFmpeg job.
  2. Capture exit and restart events. Log when the process starts, exits, and is restarted, including its exit status and relevant FFmpeg log output.
  3. Track recent progress. Use an observable progress signal from the running invocation or media pipeline, then mark the local check stalled when that signal stops advancing for a deployment-specific interval.
  4. Report separate local states. Emit at least “absent,” “present but no recent progress,” and “progressing.” Do not label a progressing process as a healthy YouTube stream until the API check agrees.

The exact progress mechanism depends on how FFmpeg is launched, the host’s service manager, and the output path. The official YouTube API documentation does not prescribe an FFmpeg command, shell script, supervisor, or local progress threshold; validate implementation details against your host and FFmpeg build.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Query YouTube without confusing unknown with failure

Use authorized API access for the channel’s live resources. The broadcast list method can return the status part, filter by broadcastStatus (including active, all, completed, and upcoming), and use mine=true for the authenticated owner’s broadcasts. The method lists youtube.readonly as an accepted scope. The stream and broadcast resources answer different questions, so retrieve and inspect the relevant stream status as well as the broadcast state.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
  1. Authenticate for the channel. Ensure the account and authorization scope can read the intended live resources. A request error is a monitoring failure state, not proof the stream has stopped.
  2. Identify the intended stream and broadcast. Do not treat an unrelated active or upcoming broadcast as evidence about the 24/7 stream you mean to monitor.
  3. Read status fields. Preserve streamStatus, healthStatus.status, lastUpdateTimeSeconds, configuration issues, and the relevant broadcast lifecycle state.
  4. Apply explicit freshness and persistence rules. Decide how old a health update may be and how long a reported condition must persist before alerting. The API defines the fields, not your operational thresholds.
  5. Return structured output. Show stream state, health state, update age, issue details, broadcast state, and API-check result separately, with a timestamp for the check.

The list method documents permission and eligibility errors, including insufficient live permissions and live streaming not being enabled. Surface such errors as “API check failed” with the returned diagnostic; do not turn them into a claim that the stream is inactive.

Combine the checks into an alert and recovery policy

Keep detection and remediation separate. A local process exit is a reasonable condition for a service manager to restart FFmpeg, subject to a bounded retry policy. An API-reported inactive or error stream calls for examining FFmpeg logs and ingest connectivity. A bad health status should include the individual issue and severity. A noData result, stale health update, or failed API request should be reported as unknown or unavailable, not healthy.

Before enabling automatic recovery, define these choices for your stream. YouTube does not prescribe restart intervals, attempt limits, polling cadence, alert thresholds, or escalation rules.

  • Failure condition: specify which local and YouTube states count as confirmed failure, and which mean unknown.
  • Persistence window: require a condition to persist long enough to avoid reacting to a transient observation, while staying within your acceptable downtime.
  • Restart policy: set a retry interval or backoff and a maximum number of restarts within a defined period to prevent a restart loop.
  • Escalation: decide when to notify an operator, what information the alert includes, and when repeated failures require a human response.
  • Audit trail: retain check results, API errors, issue details, process exits, and restart events so an operator can distinguish cause from symptom.

Do not restart FFmpeg just because one API request failed. Credential expiry, authorization problems, temporary API errors, network faults, and an actual ingest failure need different handling. The monitoring result should make that distinction visible.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Or let it run in the cloud

If the goal is simply to keep uploaded documentary footage playing continuously on YouTube, StreamNeo is a cloud alternative: upload a recording or build a playlist, add your YouTube stream key once, and go live. Nothing has to stay on at home; videos stream as uploaded, up to 4K 60fps, at one flat price per slot. StreamNeo automatically recovers if YouTube drops the stream. The first day is free with no card. Monthly pricing is $9.99 per month. Learn about StreamNeo, or start the free first day.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Screening Room

  1. How to Migrate a 24/7 YouTube Stream to a New VPSAdmit one · BlogHow to Migrate a 24/7 YouTube Stream to a New VPSOpened04 OCT 2026Runtime6 min
  2. How to Run a YouTube Playlist on a Headless Linux Server—and Broadcast It LiveAdmit one · BlogHow to Run a YouTube Playlist on a Headless Linux Server-and Broadcast It LiveOpened04 OCT 2026Runtime6 min
  3. How to Make a 24/7 Indian Music YouTube Stream Restart After a Server RebootAdmit one · BlogHow to Make a 24/7 Indian Music YouTube Stream Restart After a Server RebootOpened04 OCT 2026Runtime6 min
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.