skip to Main Content

I tried to stream an mp3 file to a Telegram RTMP live using the following command:

ffmpeg -re -i 1.mp3 -c copy -f mp3 rtmps://dc4-1.rtmp.t.me/s/145158:AtyF3rrME2nHEkqGA

But I couldn’t hear any sound in the stream.

2

Answers


  1. You should specify the codecs explicitly.

    The following is the simplest working command:

    ffmpeg -i your_input -c:v libx264 -c:a aac -f flv rtmps://dcx-y.rtmp.t.me/s/YOUR_KEY
    

    Here is a more advanced example from @tgbeta:

    ffmpeg -stream_loop -1 -re -i your_input -c:v libx264 -preset veryfast -b:v 3500k -maxrate 3500k -bufsize 7000k -pix_fmt yuv420p -g 50 -c:a aac -b:a 160k -ac 2 -ar 44100 -f flv rtmps://dcx-y.rtmp.t.me/s/YOUR_KEY
    
    Login or Signup to reply.
  2. Change -f mp3 by -f flv.

    Example:

    ffmpeg -re -i 1.mp3 -c:a copy -f flv rtmps://dc4-1.rtmp.t.me/s/145158:AtyF3rrME2nHEkqGA
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search