I need a Python, PHP C++ script/program that does the following, preferable utilizing GStreamer:
1. Create an RTSP server and stream on port 554 ie. rtsp://localhost:554/stream0
2. The framerate (FPS) for the RTSP feed should be adjustable through an argument passed to the script default to 10 fps if none is provided.
3. I will save jpg images in a directory (directory path to be supplied as an argument to the script), this directory/images should be read continuously always displaying the second last image* and served on the RTSP feed** at the selected fps.
4. Program must run on a Linux OS (Ubuntu)
Project budget $50 or below
* Reason we want the second last image (sorted by creation time) is to not serve an image where the file is still being created in the directory.
** If there are no "new" image files the last valid image should be served on the RTSP feed until a new file is created.