I want to pass in incoming stream to another server (from RTMP to SRT) and keep using the same streamkey using the following command:
ffmpeg -fflags +genpts -listen 1 -re -i rtmp://0.0.0.0/publish/live/STREAMKEY -acodec copy -vcodec copy -strict -2 -y -f mpegts srt://1.1.1.1:30000?streamid=publish/live/STREAMKEY
If I hard-code the streamkeys it works perfectly. The problem here is that the streamkey should be variable/wildcard. So basically this should work with any streamkey instead of hard-coding the stream key into the command. The incoming RTMP stream key should then be used to stream to the SRT server.
So I guess the steps to check would be:
- Is it possible to use wildcard naming in the command for the input RTMP stream?
- Is it possible to use that wildcard as a variable which is used in the forwarding to the SRT server part of the command?
Combining both would be the goal but not sure if even just one of these steps is possible.
Thanks in advance for any hints.