Cannot get to 30fps when livestream with ffmpeg + xvfb

0

I'm using this ffmpeg command on my dedicated server and it works fine, video sent at 30fps

ffmpeg -framerate 30 -s 854x480 -draw_mouse 0 -f x11grab -i :1009.0+nomouse -f pulse -i default -c:v libx264 -g 60 -r 30 -bufsize 2M -b:v 10M -vbsf h264_mp4toannexb -pix_fmt yuv420p -crf 18 -preset veryfast -c:a aac -af aresample=async=1 -b:a 128k -bsf:a aac_adtstoasc -metadata comment=3a89016c-fb96-45eb-978b-1e5debade01d -f flv "rtmp://....."

Now, I'm trying to move my code to aws ec2. The same command I only got 20-25 fps and it made my livestream get lag. Check screenshot here : https://i.imgur.com/7kbw4Jd.png

I checked top command and CPU still fine. Check : https://i.imgur.com/gacMkED.png

I have no idea why the ffmpeg command can't get to 30fps. Please help. Thanks

Edited by: viennt on Apr 27, 2021 7:27 PM

viennt
preguntada hace 3 años405 visualizaciones
2 Respuestas
0

fixed

viennt
respondido hace 3 años
0

For anyone revisiting this problem i would recommend on EC2, to try AWS G4dn or G5g instances. And enable hardware acceleration with FFmpeg. We are doing it ourselves and results are amazing. I wrote a simple step-by-step guide for people like me trying to bring the best out of FFmpeg with limited budget. https://mirzabilal.com/how-to-install-ffmpeg-with-harware-accelaration-on-aws

profile picture
Mirza
respondido hace 7 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas