Why Does My Video Show Green, Black, or Flickering Screens? A Complete Troubleshooting Guide
This article explains the common video screen artifacts—flower screen, flashing, green screen, and black screen—covers the end‑to‑end RTC video pipeline, and provides a step‑by‑step method to locate and diagnose the root cause across sending, server, and receiving stages.
Problem Identification
Video anomalies such as stutter, blur, missing frames, and especially screen artifacts (flower screen, flashing, green screen, black screen) are frequent and tricky issues for multimedia engineers. This guide outlines a systematic approach to pinpoint the stage where the first artifact appears and then drill down through each layer.
RTC Video Pipeline Overview
The typical RTC video flow consists of three parts: sender, server, and receiver. The diagram below illustrates the overall process.
Receiver Side Process
Player flow : RTMP – protocol decode – decode – post‑process – render.
MP4/FLV flow : demux – decode – post‑process – render.
If the remote side displays incorrectly, check in order: receiver → sender → server. If the local side is abnormal, check: sender → subsequent stages.
Key Receiver Stages
WebRTC receiver flow : RTP jitter buffer – decode – post‑process – render.
Network issues : bandwidth limits on embedded devices, packet loss, or poor network conditions can cause severe packet loss and result in screen artifacts.
Decoding issues : hardware decoders may fail due to vendor‑specific quirks; YUV format mismatches (e.g., YUV420p vs. NV12) can produce color errors. Dumping YUV data after decode helps identify memory alignment or format problems.
Post‑processing : image format conversion, OpenGL memory alignment, GPU multithread synchronization.
Rendering : color bias, OpenGL alignment errors, or dirty‑frame rendering caused by unsynchronized GPU data.
Sender Side Process
Capture stage : hardware camera anomalies (especially USB cameras) or raw format conversion (e.g., MJPEG to I420) can introduce errors.
Callback stage : external processing (beauty filters, etc.) may cause black or flashing screens if OpenGL fails.
Pre‑processing stage : image format conversion and GPU texture rendering may be faulty.
Encoding stage : dump H.264 stream to check for encoding‑related problems.
Local preview stage : similar risks as pre‑processing.
Sending stage : UDP packet loss, queue overflow under weak network, burst I‑frame transmission.
Dump stage : YUV dump size/format mismatches can produce green borders or other artifacts.
Server Forwarding
Cascade layer : transcoding between cascade levels may introduce errors.
Buffer layer : queue overflow can cause issues.
When the sender is verified normal, observe server forwarding: SRS, Alibaba CDN, and Tencent CDN each have distinct symptoms that help isolate problems.
Root‑Cause Analysis
After locating the problematic stage, analyze specific reasons:
Lost reference frames : Missing I‑frames or P‑frames in H.264 leads to decoding failures and screen artifacts. The safest strategy is to drop an entire GOP when a reference frame is lost.
Decoding not started from a key frame : Players must wait for the first key frame before feeding data to the decoder.
Video size change : Switching between portrait and landscape streams without resetting the decoder causes artifacts.
Hardware encode/decode compatibility : Some Android devices have buggy hardware codecs, 16‑byte alignment issues, or multi‑slice incompatibilities.
Incorrect image format/size handling : Mismatched capture format (e.g., NV21 vs. I420) or failure to update dimensions after camera switches leads to color distortion or screen tearing.
YUV ↔ RGB conversion errors : Improper conversion matrices produce color shifts, green edges, or visible patches.
Rendering dirty data : Partial frames rendered due to unsynchronized GPU data cause tearing or half‑old, half‑new images.
YUV stride alignment : Reading YUV data with width instead of stride creates green borders or misaligned colors.
Flashing screen causes : Frequent buffering with placeholder images, inconsistent composition during stream mixing, or GPU double‑buffer misuse.
Black screen causes : Camera permission denial, initial low‑exposure frames, encoder failure, missing canvas, decoder errors (missing SPS/PPS, incomplete frames), or OpenGL misconfiguration (viewport, projection matrix, depth buffer, shader errors, wrong texture format, FBO issues, context sharing).
Summary
Screen artifacts are a common pain point for audio‑video developers. Efficiently locating and analyzing the root cause across the entire media pipeline dramatically improves troubleshooting speed. By methodically examining each stage—capture, encoding, transmission, server forwarding, decoding, post‑processing, and rendering—engineers can identify the underlying issue and apply the appropriate fix.
NetEase Smart Enterprise Tech+
Get cutting-edge insights from NetEase's CTO, access the most valuable tech knowledge, and learn NetEase's latest best practices. NetEase Smart Enterprise Tech+ helps you grow from a thinker into a tech expert.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
