I am streaming(live chat) with FFmpeg using the following parameters.
ffmpeg -f dshow -rtbufsize 100M -i video="device":audio="device" \
-c:v libx264 -crf 30 -preset ultrafast -tune zerolatency \
-c:a aac -f mpegts udp://127.0.0.1:1234
Unexpectedly, when CRF is lowered from 30 to 20, step-by-step. The stream quality decreases dramatically. When the CRF is about 20, sudden changes in the picture (like a head movement), seems to make the image green, gray or very distorted. I tried using CRF 30, and the problems seems to be gone. Why is this happening ?
I don't think it is a bandwidth issue given that I am on localhost. Also I didn't change anything based on I-frames.
Edit: I checked the file sizes given CRF 20 and CRF 30 on libx265.
10 Second video.
CRF 20: 1.7M
CRF 30: 350kb
Is 1.7M really bad for a 10 second stream that localhost or any other live streaming sevice can't handle ?