This airplay server is a containerized version of the tcp-forwarder example from the java-airplay-server-examples repo.
The following commands use the podman container tool. If using docker, you may need to modify the Containerfiles.
NOTE: Before building image, you may wish to change the name of the airplay
server by changing QuackPlay
to something else in the Containerfile line that
uses the sed
command.
The multistage Containerfile is recommended due to its smaller size. Build the image with
podman build -t airserver:1.0 . -f Containerfile.multi
To run container, use
podman run --rm --network host --name airserver -d airserver:1.0
To stop container, use
podman stop airserver
After starting the container, connect to the TCP stream by using either of the following commands.
# Run this (seems to be faster than ffplay)
gst-launch-1.0 -v tcpclientsrc port=5002 ! h264parse ! avdec_h264 ! autovideosink
# or this
ffplay -f h264 -codec:v h264 -i tcp://localhost:5002 -v debug
Recently, on my Manjaro box, the first command has not been working due to the error WARNING: erroneous pipeline: no element "avdec_h264"
. Instead, I use the modified command
gst-launch-1.0 -v tcpclientsrc port=5002 ! h264parse ! vah264dec ! autovideosink
- Cannot reconnect to stream after disconnecting (upstream bug).
- https://spring.io/guides/gs/spring-boot-docker/#scratch
- https://www.cloudreach.com/en/resources/blog/ct-dockerizer-java/
- https://docs.docker.com/engine/reference/builder/#expose
- https://stackoverflow.com/questions/59999424/spring-boot-gradle-project-in-docker-with-continuous-build
- https://docs.docker.com/network/network-tutorial-host/