kibook / pmms

Synchronized media player for FiveM and RedM
136 stars 57 forks source link

Stream a .mp4 file? #55

Open Natedawg63 opened 2 years ago

Natedawg63 commented 2 years ago

Is there a way to stream a .mp4 video file to a screen in our server? I remember using a different script that used RTP I believe that I could stream from my VLC player. Wasn't sure I could do that with PMMS or not? TYVM

kibook commented 2 years ago

It's mostly going to come down to what MediaElement.js supports, but did you try an HTTP stream with VLC?

Natedawg63 commented 2 years ago

Yes, I have tried streaming it as a HTTP stream, but I get confused on what I need to copy/paste into the player to get it to actually stream to the screen. If I copy the stream address and paste it in Chrome - I get a video player and it plays sound from the file, but I do not get any video. When I paste the same address into the player in the server, it just ends up timing out and never plays anything.

Natedawg63 commented 2 years ago

I am trying to stream a .mp4 - so not sure if it is the .mp4 format or what.

kibook commented 2 years ago

MP4 is more than one format, two ".mp4" files may use totally different video and audio codecs from each other, so it could be related to that. I think VLC typically offers the option to re-encode the stream to another format, though, so check what encoding you are using in that.

Znarf221 commented 1 year ago

@kibook I want to stream a video file (.mp4) on our server. Do I have to Just Paste the VLC Stream Link, that is locally streaming on my PC, in PMMS, and it will work?

kibook commented 1 year ago

@kibook I want to stream a video file (.mp4) on our server. Do I have to Just Paste the VLC Stream Link, that is locally streaming on my PC, in PMMS, and it will work?

There's a lot of caveats to this. In theory it could work, but if you want other people to see it, you need to make sure they can access the stream from your PC remotely, too. As in, they should be able to open the stream URL with VLC or another media player on their own PCs. If they can't access it, then they won't be able to see it with pmms either. You may have to forward a port on your router and add an exception to any firewall in place to allow people to connect to your stream from over the internet.

You also don't specify what type of streaming you're using, and what video and audio codecs the stream uses. Not all of the types that VLC can do are supported by MediaElement.js.

There's probably an easier option, though. You can place the .mp4 file in the http/media folder inside the pmms resource folder. Then the file can be played by entering the name in the URL field. So if you placed a file named video.mp4 in that folder, you can enter video.mp4 in the URL field in pmms to play it. Alternatively, you can use the full URL, which will be: http://<your server IP>:<your server port>/pmms/media/video.mp4, where <your server IP> and <your server port> are the IP address and port of your FiveM server.