So I am new to Perl and web development but I was hoping to get some guidance on the following issue.
Server 1 is transcoding video for me and has an api endpoint for me to access. It will give me the file stream that I want to push to the web. So for the sake of the problem lets say that it is accessed at:
server1:123\video_stream
Server2 is my web server and I want to have a page that lets us access this video stream file
server2:80\web_stream
I have seen in php you can do readfile("server1:123\video_stream)
but the entire video_stream will be read into memory before being output to the page... or so I was told.
I have also seen in Perl that ffmpeg output can but routed through the open(DATA, $ffmpegProcess)
then printing the buffer read from this stream to the web_stream page...
This all assumes that the header information about the attributes of the video are correct.
Would it be as simple as making a curl request to Server 1 and returning that stream output like I can already with the ffmpeg output?
I am not looking for complete solution, just some direction on the best and most correct way to do this. Maybe php and Perl are not the right tools to handle this at all?