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
gefragt vor 3 Jahren405 Aufrufe
2 Antworten
0

fixed

viennt
beantwortet vor 3 Jahren
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
beantwortet vor 7 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen