Playing an MOV/MP4 locally in FireFox - firefox

This isn't clever nor fun but I'm stuck. A client of mine requires the need for a download of a presentation web site where videos can be embedded. Since OGG is a pretty obscure format for clients I ask them to upload MPEG4 encoded videos as either .mov, .mp4 or .m4v. These can be played using the HTML <video> or for browsers that don't support MPEG4 I use a Flash player (since that can play them).
This is fine for online and it works well.
When we go to download the presentation, the <video> element works fine in browsers that support MPEG4 video, even if they're local.
So we then come on to FireFox; this doesn't support MPEG4. Nor can I get Flash to locally play a video (because of security issues, unless we get them to go through the security settings but that isn't very nice).
So we resorted to using the good ol' <embed> tag but this is very buggy with FireFox. It works fine on a server, it even allows me to have custom controls, but locally the videos don't play.
I've had some Googling around and it seems like a security issue but want to get a definite answer. Does anyone know why it's not playing locally? The URL is fine and the file exists. I notice that it's common amongst version 4+ so could it be a codec issue? Is there another way I can get FireFox to play MPEG4s locally?

Related

Stream a website to a mp4 (rendering html to a mp4)

I am trying to composite a website (which contains JavaScript and as a result is updating regularly) with a video feed. My goal is to do it on virtual hosted Linux server (my plan is to use Ubuntu, but I am flexible) - I am not interested in solutions utilizing OBS or the like as my solution would be headless.
The problem I am facing is how to output the website to a video stream from a command line.
The site I want to capture is https://vscore.ch/home and I would like to render it in a way that I can feed it to ffmpeg where I can composite it with the live game video that is being delivered via RTMP.
You may want to use this puppeteer plugin and stream those screenshots, or parse them into a video and stream that.

Application that Streams Videos from Local Cache - in Browser?

I've built a webapp to host low-res proxies of our teams video files. The webapp is primarily for tagging and searching video. Additionally, I'd like to be able to play a random playlist of clips on TVs around the office. I've implemented this by "Casting Tab" to a Chromecast, and it works fine.
However, now I'm running up against the bandwidth limitations of my host. Latency and everything is fine, but to run a single TV's 2.5Mbps stream 8hrs a day for 23 days a month comes to about 207 GB/month, 20% of my alotted 1TB monthly transfer.
How can i build something that will "cache" these clips client-side, so that it doesnt re-download them unnecessarily? There are about 1000 clips. I'd prefer to keep it connected to my webapp via browser or some API endpoint so the RAND() stream of clips is constantly updated as people add to it.
Note: I asked a related question yesterday, and it seemed to fix my specific issue, but it doesn't seem to have worked at scale, so I'm broadening the approach a bit. Browser Caching of images and videos served via php query strings
Shaka Player has built-in support for offline playback, along with a pretty good API for listing offline assets, and removing them again.
This would require that you have your videos in MPEG-DASH format. Luckily Google also has a tool available for that. Shaka Packager can take your mp4's and package them for MPEG-DASH, provided the MP4's follow some simple requirements.
You could probably build something yourself using similar mechanisms to the Shaka Player, but it seems much easier to use Shaka for doing it.

ffmpeg streaming video website -- converting on the fly vs. hosting multiple formats

The setup: A website that streams uploaded videos using ffmpeg on the backend. Different video formats are served based on the needs of the client-device.
My understanding is that some websites keep the same video in multiple formats, while others convert the non-HTML5 video (say) into HTML5 video on the fly if the client-device calls for HTML5 video.
Why do one over the other?
Most websites/hosting platforms will keep the same video in multiple HTML5 video compatible formats (mp4 and webm as of today) for on demand delivery. Processing video on the fly requires CPU/GPU and that can cause penalty on the server load if too many people watch videos at the same time. Upstream transocding + storage/CDN is often less expensive and better for scalability.
Live video streaming is another story because you can get MPEG2 (or else) input and this often needs to be converted on the fly to multiple H264/AAC renditions either with ffmpeg or adds on like Wowza Media Server Transcoder.
EDIT:
why do sites still host Flash and non-Flash (i.e. HTML5) versions of videos?
Most do not and you do not need to. They use MP4 files to be delivered on both Flash and HTML5. You can find FLV or F4V (Adobe flavor of MP4) but they are either legacy, ads oriented, or flash only environment files (FLV can be used to store cue points for example to trigger animation at certain point of a video). Youtube for say mostly used MP4 files but you will find they deliver both flv and 3gp files (mobile) as well.
HTML5 is universal and can play on any client. Flash is restricted to PCs. By now they should have dumped Flash.
You can find on SO or Google articles describing the pros and cons of Flash vs. HTML5. Momentum on the market today is HTML5 first with a flash fallback.
HTML5 video is "only" available in 80% of current browsers. You would understand why major players like Youtube or Brightcove just won't let go of the remaining 20% audience.
Vimeo has made the switch for an HTML5 video first strategy.
Flash still holds some grounds HTML5 video has not yet covered (or is only beginning to):
DRM
Ads: you can understand now why Youtube and others have not made the HTML5 video first switch just yet.
Adaptive streaming (required for better user experience with video): though MPEG DASH is coming fast and HLS will work on Apple devices (and some others), browser adoption is still narrow for HTML5 video. Flash has well established RTMP and HDS support.
No need for cross browser tweaking: HTML5 video can be inconsistent across browser/version (events not firing as expected, prefix vendor required ...). Flash on the other hand only needs one type of video file format and will work as expected in any browser with the flash plugin installed.
Cost for technology switch: in the long run you will save money with HTML5 video (no license to pay for if you want to develop HTML5 video - web developers can do HTML5 video development and they can be less expensive than Flash expert). Short term moving to an HTML5 video first strategy is asking for major updates of a technology - hence cost.
Flash does not play on iOS and Android - that is a clear win for HTML5 video and a major drawback for Flash.
One growing caveat at the moment about flash is it being a plugin. That throws security and performance concerns. For example Microsoft has announced they will drop support for Silverlight in the coming years and is moving towards HTML5 video. Java (client side) is getting blocked more an more.
Not a good day to be a web plugin nowdays ...

Play a video online mode and cache it locally for playing in offline?

We have developed an application which is able to download an play the video in offline mode.But as the size of the video is much larger it is not possible for us to make the user wait for long to get video downloaded and play.So we would like to implement progressive download while playing the video but would also like to save the video locally for playing it locally too. Is there any way or any possibility of caching the video in offline mode ? Also can we implement any functionality where in a part of video played or buffered is saved locally and played in offline mode. Also can we make the buffering start or resume from the point where it was stopped when user is online ? Any Suggestions would be helpful.
Thanks.
I think you would need to download the video using FileTransfer.download() independently of playing it. Then you could cache the video on the filesystem and play it offline if the user wanted to watch it again.

Real-time audio record/playback from a Ruby web app

I am wondering if anyone has success with audio record (from microphone on the users browser) and playback from a web based app (Ruby/RoR)?
What I have found so far - I could write a flex/flash app which will record the audio and then have a server side like Red5 or so to receive and convert. This sounds more involved and I also saw different types of hosting issues etc people are having - so I am thinking there may be better/easier solutions out there!! I looked at html5/web-kit too but seems to only works on chrome and is limited to text fields etc.
In my app, i want to record users voice, save it on a aws/s3 as mp3 or similar file format and play it back to user within the app based on users input/choice. While flash based solution is workable for now, non-flash based solution will be preferred as it will support more devices (you know devices I am referring)..
The only options for web based record are Flash, Silverlight or Java. None of these will work on an iPhone or iPad - You will need a native app for that.
You don't need to use Red5 for Flash recording - you can record direct to memory, optionally encode (or zip), and then upload the the data. You might be better doing mp3 encoding server-side using ffmpeg or SoX before moving the file to s3.
There is a way using HTML5 and a server. Just record a video.
Convert the video to audio, then use the audio as you wish.
This implementation takes audio from a video and runs
ffmpeg to extract the audio:
http://goo.gl/A0bya
This is in PHP, but it should not be too
hard to create a Ruby version. Easy peasy.

Resources