FFMPEG pushed RTMP stream not working on Android & iPhone

后端 未结 3 1520
温柔的废话
温柔的废话 2021-02-13 00:07

I have to make a semi-live-stream. I used Nginx-rtmp module and then pushed content to it via ffmpeg using:

ffmpeg -re -i content.mp4 -r 25 -f fvl \"rtmp://rtmp.         


        
3条回答
  •  鱼传尺愫
    2021-02-13 00:28

    First, I suggest you add more details about the file (ffprobe) so it could be compared with the server output.
    Alternatively, be more strict in your ffmpeg command and set a specific output.
    That's a command I use to push RTMP to YouTube:
    ffmpeg -i any_file.mp4 -strict experimental -acodec aac -ac 1 -ar 44100 -vcodec libx264 -pix_fmt yuv420p -g 30 -vb 512k -profile:v main -preset ultrafast -r 30 -f flv -s 854x480 rtmp://a.rtmp.youtube.com/live2/your-channel.stream_code

    With you last update, there already is a difference between ffmpeg output and the server's: ffmpeg creates a 25fps stream while ffprobe sees a 20fps stream.
    Is there a place in the server you set other output parameters? try setting the ffmpeg output accordingly.

    See if changing the ffmpeg output affects the server output, and try go with h264 main profile.

    Regarding the ffprobe error message, if your original file also contains 3 streams, perhaps the server doesn't like it so remove that 'Data' stream using map like this:
    ffmpeg -i content.mp4 -map 0:0 -map 0:2 ...

提交回复
热议问题