I have an Apache 2.2.22 webserver running on Raspbian (RasPi Debian). I have .mp4 files in a folder that I can stream flawlessly to my web browser locally or over the internet.
My Playstation 4, however, won't take a link to a file and stream it; It needs an HTML player to stream the video. I don't want to create a player for every video. I can't make a player where you type the video name and hit play, because the names are too long and there are too many of them.
I don't know any way to get passed this without having to create an HTML page for every video, or at least an HTML page that includes every video.
EDIT:
I noticed when I viewed the source of a video in Google Chrome, this came up:
<html>
<head>
<meta name="viewport" content="width=device-width">
<style type="text/css">
</style>
</head>
<body>
<video controls="" autoplay="" name="media">
<source src="http://10.0.0.21/media/blahblahblah.mp4" type="video/mp4">
</video>
</body>
</html>
Is there a way to force the Playstation (or any browser?) to use this? Instead of the browser (google chrome) automatically applying this HTML to the MP4 video?
The Playstation 4 will play a
HTML5video if it's in the correct format, as you noticed above.The specs for
MP4are:In addition you'll have to make sure the
moov atomis at the start of the file to be able to start the playback immediatelyWith Apache you can do redirects. Eg.
http://example.com/play/video_idcan be redirected to a scripted page that uses the video ID to generate a HTML5 player on the fly.If you want to avoid creating a script (eg:
PHP) that generates theHTMLpage dynamically based on theMP4files in a directory the alternative is to use an open-source media server.An example is the Plex Media Server. It has a Linux version and there are articles on how to stream to PS4. There's also RasPlex and OSMC and others if you fail to install Plex on Raspberry Pi.
As a bonus you get a nice interface.