Is there any way to play .flv files using HTML/JavaScript? - javascript

my client is very keen on playing .flv files on his website. Is there any way at all to play them? Doesn't matter if it's a dirty/hacky way.
Other similar questions are outdated.

There's some open-source FLV players like flv.js.
Your FLV must contain H.264 video codec and MP3 / AAC audio (since those codecs are supported by HTML5/browser decoders).

Related

Supporting HEVC/H.265 videos in Electron

Chrome/Electron don't normally support H.265 videos. I want the user to be able to play .mov files recorded by Apple devices in my app. How can I do this?
Possible approaches:
Use ffmpeg to transcode to H.264 in real-time, which will be resource intensive (not ideal)
Use WebAssembly to render the video in a <canvas> tag (not ideal)
Fork and manually add H.265 codec support to Chrome/Electron like https://github.com/AAAhs/electron-hevc (overkill)
Use a native module that renders the video in a <canvas> or BrowserView
We ran into a similar problem on our project where users from the iOS app were sending video messages to browser users. In the end, the easiest solution to the problem was to record the video manually in the h264 codec. An example from the documentation:
https://developer.apple.com/documentation/avfoundation/cameras_and_media_capture/capturing_video_in_alternative_formats

Transcode RTSP for HTML5 Video tag in browser

I have an rtsp stream with MP4 video codec and G711 audio codec. I need to get it work without FlashPlugins.
Video stream in WEB is a frustrating thing.
Is there a possibilty to convert in browser with javascript my Mp4 video and G711 audio in a webm or a h264 codec on fly to use it as a stream for video html5 element or any player!
The problem is, flowplayer does not support rtsp stream, vlc does not work in chrome and flash does not support into android.
so there are many many problems to get it work.
So if there is a possbility to transocde the rtsp stream on the client perhapse there is a possibility to resolve this problems.
thx
Firstly - MP4 is not a video codec but a container. So the question is the RTSP server really streaming MP4 (which I doubt but it might) or maybe you have confused MP4 with H.264.
Chrome and Firefox both accept live video streams in the fragmented MP4 and WebM (which is irrelevant in this case) video containers. So if you really already have MP4 payload you can simply unpack it from the RTSP stream and forward to the browser. If you have H.264 you will have to perform muxing of the raw H.264 video stream into an MP4 container together with the audio (I am not sure if G711 is supported by browsers, I doubt it so audio might need to be transcoded). The free option is to setup FFmpeg to transcode rtsp to fragmented MP4 (there are lots of examples for this, just Google) or if you are looking for a commercial product our company has just released an video surveillance product that can offer HTML5 compatible live streaming from RTSP cameras. If you have any interest in the commercial product leave a comment.

createjs SoundJS plays mono sound instead of stereo

I use createjs.Sound to play short sound for my project. I wasn't able to use .mp3 format file and converted it to .ogg format. .ogg is playable, but sound is mono channel (I hear only in one side of headset). When I tried to play same file with VLC player, it sounds stereo channel (same file). I understood that have no problem with conversion of file and problem may be in configuration of SoundJS.
Can anyone advice how to configure SoundJS to play stereo channel audio?
There was a bug in a version of SoundJS - maybe it's because of that (depends on the version you are using...). Check the SoundJS-Github page for further information: https://github.com/CreateJS/SoundJS/issues/182
You can also try to change the pan property: http://www.createjs.com/docs/soundjs/classes/AbstractSoundInstance.html#property_pan

Playing Large MP4s on Webpage

I have several MP4 videos I want to play over my website, playing using CloudFront and the files are in S3. However, the files are LARGE! We're talking 35G in size. Naturally this will not work wrt standard playing.
I'm using something like this:
<video id="my_video" width="700" height="550" poster="images/bunny.jpg" loop>
<source id="src_mp4" src="largefile.mp4" type="video/mp4" />
</video>
What options do I have available to make this work so it looks like it's streaming? I have the files as MP4 and AVI.
I don't think that there's any way to make it "look" like it's streaming, nor do I think there is there anything to actually achieve streaming of media files through HTML5.
A few things you could do:
Reduce the picture/audio quality of the videos
Convert the videos to the Webm format and serve them if the browser can play them (codec detection might be buggy so you may not want to do this)
Make the user wait a certain amount of time (maybe 30 seconds) and pray that the video can play until the end without having to buffer.
If you don't want to do any of the above, this question may help.
You can provide HTTP adaptive bitrate streaming with DASH in HTML5. Have a look at dash.js and the player example which works great but browser support is still limited.
You can provide 35 GB mp4 URLs to an HTML5 video tag providing your web server hosting the mp4 files is properly configured but generally you will be advised to consider streaming rather than progressive download for large files. There are streaming servers out there (Wowza, Red5, IIS ...) that would do that but this could represent a cost and some commitments on your side as you will need to maintain a streaming server and a player (most likely a hybrid player Flash + HTML5 to get good browser coverage).
Also platforms like Vimeo or Youtube (or other online video platforms) may fit your requirements in some cases.

How to embed an m4v video file to my html webpage?

I am currently trying to embed the m4v videos in my html webpage.
using the following code
<video controls="" height="360" width="480">
<source src="path/to/my/m4v/video" type="video/mp4">
<source src="path/to/my/m4v/video" type="video/ogg">
</source></source></video>
its working perfectly in google chrome.and it demands for an ogv video for mozilla browser.as we cant get an ogv video from our client.Also I am using it in hero framework.
I also tried to use the iframe tag used by youtube embed code.that works with webkit browser(google chrome).
but not able to play in mozilla firefox browser.I need to play m4v video in cross browsers.Is there any way or any html tag I am missing here?I explored alot but couldn't find an efficient solution.
m4v format files are not supporting by browsers, these format need player support. these files directly cannot run in browser.
like chrome, firefox, ie...etc.
Because these file format belongs to iOS operating system, developed by apple.
Read the instructions given by below link Wikipedia.
http://en.wikipedia.org/wiki/M4V
M4V - Video Supporting Features
these are the possibilities to
upload m4v files in the you tube that link we can use.
need to convert in to mp4 format all files and use in server.
need to write any script that converts the m4v files to mp4 fomat from server side.
need any builder that directly converts that m4v to mp4 formats files but it may be payable it.
You will probably need some external plugin or servcice support for your codec (m4v) since is not supported by all the browsers out there.
For a list of supported cross-browser video and audio formats I suggest you to check this documentation by MDN
Media formats supported by the HTML audio and video elements
In just a few Words, the formats you need to be 99% bross-browser are:
H.264 and AAC in MP4
Theora and Vorbis in Ogg
VP8 and Vorbis in WebM
HTML5 Video is just a convention to play a certain video formats with a new element for which browsers will implement an own player. HTML5 won’t provide players or something like that.
You have to look for the codecs and contained supported by most browsers, which, if I remember well, are mostly Theora for Video and Vorbis for audio, in an OGG container.
Then I remember that Webkit browsers will support Matroska (MKV) containers using V8 as video codec and Vorbis for audio.
My recommendation: provide an OGG file with Theora and Vorbis as video and audio codecs respectively. Inside provide a fallback using an MKV file with V8 and Vorbis and then, if you can, inside an MPG video file using Mpeg2 and MP2 (couldn’t think on something better) as video and audio codecs, fallback. Then as the last fallback, a Flash player playing a FLV video file.
<video src="thevideo.ogg">
<video src="firstFallback.mkv">
<object type="video/mpeg" src="secondFallback.mpeg">
<object
type="application/x-shockwave-flash"
src="player.swf?etc...">
<p>Download the video etc...<br />
or use a more modern browser to watch online, etc...</p>
</object>
</object>
</video>
</video>
Etc... ;-)
With this configuration, most (if not all) browsers should be able to play your video, preferring the most supported (and most modern) format. “Fallbacking” until they find a Flash Player.
For hints on what formats to support: take a look at the HTML5 Video part in Wikipedia.
Important: In your code you are refering to an absolute filesystem path, which is totally not-accesible for a web visitor. Maybe in the src you meant /video/file2.m4v.
You can use HTML5 video tag.
or
jplayer.org
or https://github.com/html5-ninja/Bootstrap-video-player-jQuery-plugin/blob/master/index.html
view about url you got complete reference .
If you're not forced to use Quicktime, the Flash based JW Player NOT free
can do Quicktime encoded MV4 if the client has Flash 10 installed.
Hence tried using the JWPlayer from the official site of jwplayer.
Will have to purchase it to get a licence key.
Enables to play .m4v video on cross browsers.
Works perfectly.

Categories