Is there a command for video bitrate in html5? - html

I am using "document.querySelector('video').playbackRate=1" as a console input in the edge browser, for setting the playbackspeed on the fly. Is there a similar command to use for customizing the bitrate of that video stream?

No. The bitrate of a video is a result of how source video was encoded. In order to change bitrate, you have to either have multiple source videos that are each encoded at a different bitrate (like Youtube does it) or have the ability to change the encoding on the fly in response to network congestion (like a live stream).

Related

How to use flash player to encode and push a live stream to media server?

I have a media server (Wowza) that I am pushing a live RTMP stream to and playing it (in several protocols HLS/RTMP) back in the browser with Flowplayer.
Currently I am encoding the stream with OBS but I would like to also give my users an option to encode from within the browser with Flash.
Do I need to learn ActionScript and write my own SWF to access the camera/mic and push the stream?
Is there a commercial SWF file with parameters I can pass in (such as the RTMP stream URL etc)?
You can use flash to send Video from webcam to Wowza. Video will encoded by Flash
use webrtc send video to Wowza. Video will encoded by Web Browser
I have used https://github.com/theintencity/flash-videoio. It not bad.
Please note - Latest browser not enable flash by default

How to stream mkv file using html/javascript?

Is there any way to stream mkv files on webpage using javascript/html or any other technologies? I found many questions about this, but I really want to know the answer - is this possible in any way? Maybe ajax, javascript, php, html? Maybe some external libraries? Anything?
I was wondering how youtube works. Is there possible to upload mkv file? Is so, how that videos are streaming to end user?
I know that browser doesn't support mkv natively, but maybe is some way to forcing html to do that?
Any help will be appreciated.
YouTube most probably works using the DASH protocol format. On the server side, the source audio and source video are separately divided into segments of different bitrate/quality. A manifest keeps an index of all possible segments values and their location. This allows to switch quality during playback in the player.
On the client side, the DASH (should be the same with the other main technology: HLS) manifest is used by the player to locate the segments to load in order to feed the content in two separate SourceBuffer, one for audio and one for video and both are being played synchronously together in the MediaSource. For an example player that handles this, see the Shaka Player developed by Google.
Conclusion, there is no need to use a container like mkv but each channel (video, audio) needs to point to a browser supported codec encoded segments.
You don't need anything special for streaming pre-recorded media files. A normal HTTP/1.1 or HTTP/2 server will work just fine. The browser is generally capable of seeking into the file using range requests.
Matroska (MKV) is a container format, and it actually is widely supported because it's basically the same as WebM. WebM is a subset of Matroska... the key differences being that there are suggested codecs for use. (Matroska itself supports almost anything.)
Your audio and video tracks in the file can use a variety of codecs... the key is to use codecs compatible with browsers. Opus for audio and VP8 for video will take you far.
From there, simply reference your video file in a <video> tag.

How does Chrome decide how much video to buffer for HTML5 MP4?

I have an MP4 video that is variable bitrate, so the average bitrate doesn't necessarily stay consistent throughout the entire file. Because my video is a capture of a computer screen, some parts of the video are very low bitrate because nothing is happening, and other parts are a much higher bitrate because there's a lot of activity on the screen.
How does Chrome decide how much video to buffer for progressive download HTTP(S) videos? I'm running into a problem where Chrome tends to buffer too little, so playback stutters.
If there's no way of convincing Chrome to download a certain time of video (and I don't want to just preload the entire thing), can I author the MP4 some special way to solve the problem? I'm using FFmpeg and MP4Box. Maybe it's up to the HTTP server?
If you want more control over the playback of the video, you should definitely check out MediaSourceExtensions. They define a whole model for video playback, defining sourceBuffers where you can put video data, etc.
Beware it is not a simple to use API still, and the information on how to use it is very fragmented.
In your case, if you go the MSE route, you can either keep using h264 (which is probably the codec your mp4 is wrapping) or switch to webm.
In case of going the MP4, h264 route, you'll need to generate a fragmented MP4 (fMP4) and write some JavaScript to control the way you work with the MP4 fragments (segments in MSE parlance).
MP4Box has support for the -dash protocol, which will segment an MP4 in a way that is suitable for consumption via MSE. FFmpeg also has support for generating fragmented MP4.

Transmitting rtsp video over webpage with JPEG compression (Eg: http://windofdubai.com/winds/webcam)

I would like to embed .rtsp video on a webpage with jpeg compression. Users can view the live stream without using any plugin. Live Example : http://windofdubai.com/winds/webcam. Anyone can help please.
are you sure this is an rtsp feed, when I look at the source to this page it looks more like mjpeg, most camera's support mjpeg and many also support rtsp. Sometimes you can have both feeds concurrently from the cameras.

Is it possible to use HTML5 to display an MPEG Transport Stream video?

I have several MPEG2 Transport Stream videos with KLV metadata embedded in them. I would like to display the videos in a web browser. Is it possible to use the HTML5 <video> tag to play a video of this type in a web browser?
If I use a converter to pull the video out of the MPEG-TS container and create an MPEG4 file encoded with H.264, then I can get the video to show up in a browser. But is there any possible way I could display these videos without having to convert them into a different format? I need to keep the KLV data around so I can do other stuff with it.
The actual video codec support is still up to the browser, but some support MPEG2-TS natively as a transport, and if they don't you can do software demuxing using hls.js. Reading KLV is an unresolved issue but you "should" (per that issue) be able to access the raw binary stream and parse out the values yourself -- not trivial, as such, but doable.
There is no browser that support mpeg2.
You can use service like: vid.ly and have all the formats you need.