-
-
Save sandikodev/da724d8c1063f86d053096dacf0e4dcf to your computer and use it in GitHub Desktop.
using ffmpeg to stream videos, gifs, the webcam or the screen to matelight
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Stream a video | |
| ffmpeg -re -i video.avi -vf "scale=40:ih*40/iw, crop=40:16" -f rawvideo -vcodec rawvideo -pix_fmt rgb24 - > /dev/udp/matelight.cbrp3.c-base.org/1337 | |
| # Loop a gif | |
| ffmpeg -re -ignore_loop 0 -i image.gif -vf "scale=40:ih*40/iw, crop=40:16" -f rawvideo -vcodec rawvideo -pix_fmt rgb24 - > /dev/udp/matelight.cbrp3.c-base.org/1337 | |
| # Stream webcam | |
| # Mac | |
| ffmpeg -re -f avfoundation -r 30 -s 1280x720 -i "0" -vf "scale=40:ih*40/iw, crop=40:16, pp=autolevels:f, eq=1.5" -f rawvideo -vcodec rawvideo -pix_fmt rgb24 - > /dev/udp/matelight.cbrp3.c-base.org/1337 | |
| # Stream screen center (for e.g. YouTube videos) | |
| # Mac retina | |
| ffmpeg -re -f avfoundation -r 25 -i "1" -vf "crop=1200:480, scale=40:16, eq=1.5" -f rawvideo -vcodec rawvideo -pix_fmt rgb24 - > /dev/udp/matelight.cbrp3.c-base.org/1337 | |
| # Mac normal | |
| ffmpeg -re -f avfoundation -r 25 -i "1" -vf "crop=600:240, scale=40:16, eq=1.5" -f rawvideo -vcodec rawvideo -pix_fmt rgb24 - > /dev/udp/matelight.cbrp3.c-base.org/1337 | |
| # prepare video for matelight ... | |
| ffmpeg -r 25 -i video.mp4 -vf "scale=40:ih*40/iw, crop=40:16" -an -vcodec libx264 -crf 18 -preset veryslow video.mov | |
| # ... and play it | |
| ffmpeg -re -i video.mov -f rawvideo -vcodec rawvideo -pix_fmt rgb24 - > /dev/udp/matelight.cbrp3.c-base.org/1337 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment