Playing Raw H264 video in HTML - html

Does anyone know of a way to play .h264 in it's raw format in HTML? Tried using the tags, but it says video / mime type not supported.
Annoyingly, I'm not able to convert the files into different format (long story..). Tried the normal google routes, but no luck.

Related

RTMP to Browser

I'm looking for a dead-simple way to convert an RTMP stream (from an IP camera) into something I can use in the browser. Ideally this server would read from the rtmp:// URL of my camera, re-encode the stream, and then server the stream in a format I can use in a <video> tag on a web page.
However, my understanding is that HTML5 and the <video> tag does not support live streaming. Therefore, I'm left using HLS or DASH. My understanding is that HLS is supported by almost all devices (I only care about the Chrome browser on both my Linux desktop, and my Android device).
So what is the easiest way to convert from a rtmp:// stream to HLS? I've tried using the nginx-rtmp-module (https://github.com/ut0mt8/nginx-rtmp-module), but after re-compiling Nginx, I cannot get the configuration file to work correctly. I also run into the problem that my rtmp:// URL doesn't seem to fit the "standard" pattern of rtmp://localhost/$app/$name I see in most of the documentation. Mine looks like: rtmp://192.168.1.103:1935/flash/1:YWRtaW46YWRtaW4= where the last part is a the username and password (admin/admin) encoded in Base64.
Ultimately, I have multiple cameras, and I'm looking to make a simple page where I can display them all. What's the easiest way to go about this on Linux?
For those who might be searching for something similar, I was able to use ZoneMinder. It configures a server that does exactly what I want: convert an RTSP stream to something that can be displayed in the browser via an img tag. You can figure out the URL for the image source by simply inspecting the element in the browser.
The code for the ZoneMinder server is on GitHub: https://github.com/ZoneMinder/zoneminder It would be nice if one could easily extract just the server that translates RTSP into the image data, but the easiest way to get up-and-going was to simply configure the whole service.
My suggestion would be to use https://github.com/aler9/rtsp-simple-server. It fulfills your requirement of being “dead simple” and can convert from RTMP to HLS in about 2 to 10 lines of YAML config.

audiocalls.wav could not be decoded

I am trying to play a wav file using html 5 audio player but it shows file could not be decoded.
Anyone please let me know what is wrong with this wav file so it is unable to play in html5 audio player.
I am working on a call recording system that records these kind of wav files and now I am integrating html 5 audio player to play in system.
If file does not support in html 5 audio player then please let me know any alternative option to play file in system.
Below is url to download wav file
http://sipprintdemo.com/callrecording3/download.php?file=../../../sipprintcalls/2016/05/17/15/20160517_152047_XRT.wav
It is difficult to say why it is not decoding without seeing your code. What browser are you using in order to test? .wav files do work with HTML audio but not all browsers support that file type. I know that IE for example does not support it.
Another option would be to convert the files to .mp3 format that is support by all browsers. A quick google search should yield a converter service for you.

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.

Convert YouTube M4a DASH to regular M4a with Hex Editor

Using various browser extensions allows download of YouTube content as audio M4a format.
However, according to this post
https://superuser.com/questions/837067/convert-youtube-dash-audio-youtube-dl-to-m4a-aac-dl/837076#837076
the M4a codec is DASH, which is not widely recognized / built-in (yet) to players such as VLC.
Reading into the meaning of container, the above post seems to suggest that if one could change bytes 8 to 11 from DASH to MP4 then the file would immediately be playable..?
I tried this with a hex editor, but the file was not rendered playable in VLC.
Am I missing something basic (for example, deleting byte 11 - I made it 00?), or is there a lot more to it?
PS - I was able to convert the file using Foobar2000 1.37beta and the MP3 convert ability, but a hex editor would be faster for my purposes.

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.