How to Stream Video Over RTMPT Using FFmpeg

Streaming video over RTMPT (Real-Time Messaging Protocol Tunneled) allows you to bypass strict firewalls and proxies by wrapping RTMP media data inside standard HTTP requests. This article provides a quick and direct guide on how to configure and execute an FFmpeg command to stream live video using the RTMPT protocol.

Prerequisites

To stream over RTMPT, your FFmpeg build must be compiled with librtmp support, as FFmpeg’s native RTMP implementation does not natively support tunneling. You can verify this by running ffmpeg -protocols in your terminal and ensuring rtmpt is listed under the supported output protocols.

The FFmpeg RTMPT Command

To stream a video file to an RTMPT server, use the following command structure:

ffmpeg -re -i input.mp4 -c:v libx264 -preset veryfast -maxrate 3000k -bufsize 6000k -pix_fmt yuv420p -g 50 -c:a aac -b:a 128k -f flv rtmpt://your-server-ip:80/live/stream_key

Command Breakdown