Hey guys,
I’m just having an issue with streaming videos in mp4 format to Safari. Just for example, I add a video like this to my page:
<video controls preload="auto" >
<source type="video/mp4" src="http://192.168.178.34:1337/files/videos/565cdde12106f69712f41a6a">
</video>
It’s not working on my Mac and iPhone 6s. When I use Google Chrome, everything works fine. Here are my ffmpeg settings:
var norm = new ffmpeg()
.input(originalFile.name)
.withVideoCodec('libx264')
.withAudioCodec('libfaac')
.toFormat('mp4')
.audioBitrate('128k')
.videoBitrate("1000k")
.size("?x720");
I also use Sails.js to stream the videos from my GridFS collection to the user, so my response only looks like this:
//Express / Sails.js response
res.set('Content-Type', 'video/mp4');
var readstream = gfs.createReadStream(options);
readstream.pipe(res);
I know that Safari has some “special Apple issues” on that topic, but at the moment I don’t know, if I only forgot to set a special header, or my ffmpeg file format is wrong. I only get “Failed to load resource”.