| Sometimes, you may face your FFmpeg not loading internet resources as planned. In my case, I found the case, FFmpeg can't load redirected internet object such as ts or m3u8. The below script will help you to check what kind of issues are happening in the system, so you can fix its root cause. #!/bin/bash
echo "=============================================="
echo " Checking FFmpeg URL Redirection Restrictions"
echo "=============================================="
# 1. Check iptables rules for HTTP/HTTPS blocking
echo -e "\n[+] Checking iptables rules..."
if sudo iptables -L -v -n | grep -E "REJECT|DROP" | grep -E "80|443"; then
echo "⚠️ iptables is blocking HTTP/HTTPS traffic!"
else
echo "✅ No HTTP/HTTPS blocks in iptables."
fi
# 2. Check firewalld rules
echo -e "\n[+] Checking firewalld rules..."
if sudo firewall-cmd --list-all | grep -E "block|reject"; then
echo "⚠️ firewalld is blocking some traffic!"
else
echo "✅ No blocking rules in firewalld."
fi
# 3. Check /etc/hosts for blocked domains
echo -e "\n[+] Checking /etc/hosts for blocked domains..."
if grep -E "0.0.0.0|127.0.0.1" /etc/hosts | grep -v "localhost"; then
echo "⚠️ Some domains might be blocked in /etc/hosts!"
else
echo "✅ No domain blocking in /etc/hosts."
fi
# 4. Check sysctl for ICMP redirects
echo -e "\n[+] Checking sysctl ICMP redirect settings..."
if sysctl -a 2>/dev/null | grep "accept_redirects" | grep "= 0"; then
echo "⚠️ ICMP redirects are disabled!"
else
echo "✅ ICMP redirects are enabled."
fi
# 5. Check SELinux status
echo -e "\n[+] Checking SELinux status..."
selinux_status=$(getenforce)
if [ "$selinux_status" == "Enforcing" ]; then
echo "⚠️ SELinux is Enforcing. It might restrict FFmpeg!"
else
echo "✅ SELinux is not enforcing."
fi
# 6. Check dnsmasq blocking
echo -e "\n[+] Checking dnsmasq for blocked domains..."
if [ -f /etc/dnsmasq.conf ]; then
if grep "address=" /etc/dnsmasq.conf; then
echo "⚠️ Some domains are blocked via dnsmasq!"
else
echo "✅ No domain blocking in dnsmasq."
fi
else
echo "✅ dnsmasq is not configured."
fi
# 7. Test FFmpeg URL redirection
echo -e "\n[+] Testing FFmpeg URL redirection..."
ffmpeg_output=$(ffmpeg -v debug -i "http://redirecting-site.com/video.mp4" 2>&1)
if echo "$ffmpeg_output" | grep -q "301 Moved Permanently\|302 Found"; then
echo "✅ FFmpeg can follow redirects."
else
echo "⚠️ FFmpeg redirection might be blocked!"
fi
echo -e "\n✅ Scan Completed!"
You should change redirecting-site.com/video.mp4 to your target URL. The above script is tested on CentOS 7. You can save it as ffmpeg_check_internet_restrictions.sh: sh ffmpeg_check_internet_restrictions.sh |