1# libcast 2 3libcast is an open source implementation of the Cast protocol supporting Cast 4applications and streaming to Cast-compatible devices. 5 6## Using the standalone implementations 7 8To run the standalone sender and receivers together, first you need to install 9the following dependencies: FFMPEG, LibVPX, LibOpus, LibSDL2, LibAOM as well as 10their headers (frequently in a separate -dev package). Currently, it is advised 11that most Linux users compile LibAOM from source, using the instructions at 12https://aomedia.googlesource.com/aom/. Older versions found in many package 13management systems have blocking performance issues, causing AV1 encoding to be 14completely unusable. From here, you just need a video to use with the 15cast_sender, as the cast_receiver can generate a self-signed certificate and 16private key for each session. You can also generate your own RSA private key and 17either create or have the receiver automatically create a self signed 18certificate with that key. If the receiver generates a root certificate, it will 19print out the location of that certificate to stdout. 20 21Note that we assume that the private key is a PEM-encoded RSA private key, 22and the certificate is X509 PEM-encoded. The certificate must also have 23the CA bit set in the basic constraints. The easiest way to test with a key 24and certificate is to use ones generated by the cast_receiver standalone 25application. 26 27## Developer certificate generation and use 28 29The easiest way to generate a private key and certificate is to just run 30the cast_receiver with `-g`, and both should be written out to files: 31 32``` 33 $ /path/to/out/Default/cast_receiver -g 34 [INFO:../../cast/receiver/channel/static_credentials.cc(161):T0] Generated new private key for session: ./generated_root_cast_receiver.key 35 [INFO:../../cast/receiver/channel/static_credentials.cc(169):T0] Generated new root certificate for session: ./generated_root_cast_receiver.crt 36``` 37 38These generated credentials can be passed in to start a session, e.g. 39``` 40./out/Default/cast_receiver -d generated_root_cast_receiver.crt -p generated_root_cast_receiver.key lo0 41``` 42 43And then passed to the cast sender to connect and start a streaming session: 44``` 45 $ ./out/Default/cast_sender -d generated_root_cast_receiver.crt lo0 ~/video-1080-mp4.mp4 46``` 47 48When running on Mac OS X, also pass the `-x` flag to the cast receiver to 49disable DNS-SD/mDNS, since Open Screen does not currently integrate with 50Bonjour. 51 52When connecting to a receiver that's not running on the loopback interface 53(typically `lo` or `lo0`), pass the `-r <receiver IP endpoint>` flag to the 54`cast_sender` binary. 55