ffmpeg -re -i <your_input> -c:v libx264 -c:a aac -f flv <stream_url>/<stream_key>
-re
reads the input at native frame rate, doing this is recommended by FFmpeg.-c:v libx264
encodes the video of the output inlibx264
, the required video encoding by Telegram.-c:a aac
encodes the audio of the output inaac
, the required audio encoding by Telegram.-f flv
sets the format of the output toflv
, the required format by Telegram.
Just add -loop
to the input options!
ffmpeg -re -loop -i <your_input> -c:v libx264 -c:a aac -f flv <stream_url>/<stream_key>
You can use also
-c:v h264_nvenc
encoding for video (if you have nvidia gpu). Telegram allows h.264 codec for streams.