This script is an attempt for building FFMPEG and OBS studio on a Raspberry Pi 4 after much of googling and duck duck going. That scripts grabs some stuff and other scripts that I tried without success.
If you're interested on this topic I suggest you to read this interesting thread, OBS Raspberry Pi Build Instructions. It includes a lot of comments with suggestions to solve most of the problems you'll found (also unsolved mine!).
Maybe this script will not work on a future or next week, so do feel free to open an issue to warning me.
Additionally you can read some information for running OBS Studio on a headless raspy using cygwin:
https://www.lanoiadimuu.it/2013/04/raspberry-pi-x11-forwarding-with-cygwin/
https://desertbot.io/blog/headless-raspberry-pi-4-lite-remote-desktop-upgrade
Finally, if you're editing this script under dos environment, you'll get this error related to EOL.
sed -i -e 's/\r$//' scriptname.sh