Testing & Validation
Methods to verify your input streams are working correctly.
Table of contents
- Overview
- Quick Verification
- Detailed Testing Procedures
- Automated Testing
- Validation Checklist
- Performance Testing
- Troubleshooting Test Failures
- Continuous Monitoring
- Related Documentation
Overview
Testing input streams before connecting them to transcoders ensures smooth operation and helps identify issues early.
Always test input streams in a staging environment before production deployment.
Quick Verification
Method 1: VLC Player (Easiest)
VLC is the simplest way to verify your input stream is working:
Steps:
- Open VLC Media Player
- Select Media → Open Network Stream (or press
Ctrl+N) - Enter your Source URL
- Click Play
Expected Result:
- Video plays smoothly without interruptions
- Audio is synchronized with video
- Quality is as expected from encoder
UDP Example:
udp://@239.1.1.1:5000
RTMP Example:
rtmp://encoder.example.com:1935/live/stream-key
Method 2: ffprobe (Detailed Info)
ffprobe provides detailed technical information about your stream:
Command:
ffprobe -v error -show_format -show_streams udp://@239.1.1.1:5000
Expected Output:
Input #0, mpegts, from 'udp://@239.1.1.1:5000':
Duration: N/A, start: 12345.678, bitrate: 8192 kb/s
Stream #0:0[0x100]: Video: h264, yuv420p, 1920x1080, 29.97 fps
Stream #0:1[0x101]: Audio: aac, 48000 Hz, stereo, 128 kb/s
What to Check:
- ✅ Video codec (should be h264 or hevc)
- ✅ Resolution (e.g., 1920x1080)
- ✅ Frame rate (e.g., 29.97 fps or 25 fps)
- ✅ Audio codec (should be aac)
- ✅ Audio sample rate (typically 48000 Hz)
- ✅ Bitrate is reasonable
Method 3: ffplay (Visual Test)
ffplay provides playback with minimal latency for testing:
Command:
ffplay udp://@239.1.1.1:5000
Keyboard Controls:
Q- QuitF- Toggle fullscreenPorSpace- PauseM- Mute audio
Detailed Testing Procedures
UDP Multicast Testing
Step 1: Verify Network Connectivity
Check multicast routing:
ip route show | grep multicast
Expected output:
224.0.0.0/4 dev eth0 scope link
Step 2: Monitor Network Traffic
Capture multicast packets:
sudo tcpdump -i eth0 host 239.1.1.1 and port 5000 -c 100
What to look for:
- Packets are arriving
- No excessive packet loss
- Consistent packet sizes
Step 3: Check Stream Properties
Get detailed stream information:
ffprobe -v error -show_streams udp://@239.1.1.1:5000
Step 4: Test Playback
Play stream:
ffplay -fflags nobuffer udp://@239.1.1.1:5000
RTMP Testing
Step 1: Verify Server Reachability
Test TCP connection:
telnet encoder.example.com 1935
Expected:
Trying encoder.example.com...
Connected to encoder.example.com.
Press Ctrl+] then type quit to exit.
Step 2: Test Stream Availability
Check if stream is live:
ffprobe rtmp://encoder.example.com:1935/live/stream-key
Step 3: Test Playback
Play RTMP stream:
ffplay rtmp://encoder.example.com:1935/live/stream-key
Automated Testing
Stream Health Check Script
Create a simple health check script:
#!/bin/bash
# stream-check.sh
STREAM_URL="$1"
TIMEOUT=10
echo "Testing stream: $STREAM_URL"
# Test with ffprobe
if timeout $TIMEOUT ffprobe -v error -show_streams "$STREAM_URL" > /dev/null 2>&1; then
echo "✅ Stream is accessible"
# Get stream details
ffprobe -v error -show_entries stream=codec_type,width,height,codec_name "$STREAM_URL"
else
echo "❌ Stream is not accessible"
exit 1
fi
Usage:
chmod +x stream-check.sh
./stream-check.sh "udp://@239.1.1.1:5000"
Validation Checklist
Before marking an input stream as production-ready, verify:
Video Validation
- Video codec is H.264 or HEVC
- Resolution matches expected (e.g., 1920x1080)
- Frame rate is consistent (29.97 fps or 25 fps)
- Bitrate is appropriate for content (5-15 Mbps for HD)
- No visible artifacts or corruption
- Color space is correct
- Aspect ratio is correct
Audio Validation
- Audio codec is AAC or MPEG Audio
- Sample rate is 48000 Hz (or 44100 Hz)
- Audio channels are correct (stereo or multi-channel)
- Audio bitrate is appropriate (128-256 kbps)
- Audio is synchronized with video
- No audio dropouts or glitches
- Volume levels are appropriate
Network Validation
- Stream is consistently accessible
- No packet loss or minimal loss (< 0.1%)
- Latency is acceptable
- Bandwidth is sufficient
- Firewall allows traffic
- No network routing issues
Configuration Validation
- Content ID is unique
- Content ID is case-consistent
- Source URL is correct
- Server assignment is appropriate
- Documentation is complete
Performance Testing
Measure Stream Bitrate
Using ffprobe:
ffprobe -v error -select_streams v:0 -show_entries \
stream=bit_rate -of default=nokey=1:noprint_wrappers=1 \
udp://@239.1.1.1:5000
Check Packet Loss
Monitor with tcpdump:
sudo tcpdump -i eth0 host 239.1.1.1 -c 1000 | \
awk '{print $1}' | uniq -c
Measure Latency
Test end-to-end latency:
- Display timecode on encoder output
- Play stream with VLC or ffplay
- Compare displayed timecode with reference
- Calculate latency difference
Troubleshooting Test Failures
VLC Cannot Play Stream
Possible Causes:
- Stream URL is incorrect
- Network connectivity issue
- Encoder not transmitting
- Firewall blocking traffic
Solutions:
- Verify URL format is correct
- Test network connectivity with ping/telnet
- Check encoder status and output
- Review firewall rules
ffprobe Shows No Streams
Possible Causes:
- Stream not available at that moment
- Wrong URL or port
- Codec not supported
- Network routing issue
Solutions:
- Verify encoder is streaming
- Check URL and port are correct
- Test with different tool (VLC)
- Check network configuration
Playback Stutters or Buffers
Possible Causes:
- Insufficient bandwidth
- Packet loss on network
- Encoder output unstable
- Server resource constraints
Solutions:
- Check available bandwidth
- Monitor packet loss with tcpdump
- Verify encoder settings and stability
- Check server CPU and network utilization
Continuous Monitoring
Set Up Monitoring
For production streams, implement continuous monitoring:
Monitor script example:
#!/bin/bash
# monitor-stream.sh
STREAM_URL="$1"
INTERVAL=60 # Check every 60 seconds
while true; do
if timeout 10 ffprobe -v error "$STREAM_URL" > /dev/null 2>&1; then
echo "[$(date)] ✅ Stream OK"
else
echo "[$(date)] ❌ Stream FAILED"
# Alert logic here (email, SMS, etc.)
fi
sleep $INTERVAL
done
Related Documentation
- Configuration Guide - Set up input streams
- Protocol Support - UDP and RTMP details
- Best Practices - Optimization tips
- Troubleshooting - Common issues