media-source

Load large video file in HTML

梦想的初衷 提交于 2021-01-27 12:47:10
问题 Here is my problem : I want to play a large video file (3.6Gb) stored in a S3 bucket, but it seems the file is too big and the page crash after 30sec of loading. This is my code to play the video : var video = document.getElementById("video"); const mediaSource = new MediaSource(); video.src = URL.createObjectURL(mediaSource); mediaSource.addEventListener('sourceopen', sourceOpen, { once: true }); function sourceOpen() { URL.revokeObjectURL(video.src); const sourceBuffer = mediaSource

Stream HLS on safari using MediaSource api

半腔热情 提交于 2020-12-09 23:25:45
问题 I want to stream HLS fragments using media source extension. I have tried the same using mpeg-dash fragments (generated using MP4Box) and media source extension. var mediaSource = new window.MediaSource(); mediaSource.addEventListener('sourceopen', _onSourceOpen); $('video').attr('src', URL.createObjectURL(self.mediaSource)); function _onSourceOpen() { sourceBuffer = mediaSource.addSourceBuffer('video/mp4; codecs="avc1.64000d,mp4a.40.2"'); } function _onFragmentDataLoad(data) { sourceBuffer

Stream HLS on safari using MediaSource api

旧城冷巷雨未停 提交于 2020-12-09 23:08:14
问题 I want to stream HLS fragments using media source extension. I have tried the same using mpeg-dash fragments (generated using MP4Box) and media source extension. var mediaSource = new window.MediaSource(); mediaSource.addEventListener('sourceopen', _onSourceOpen); $('video').attr('src', URL.createObjectURL(self.mediaSource)); function _onSourceOpen() { sourceBuffer = mediaSource.addSourceBuffer('video/mp4; codecs="avc1.64000d,mp4a.40.2"'); } function _onFragmentDataLoad(data) { sourceBuffer

MediaSourceExtension fMP4 streaming playback fail

烂漫一生 提交于 2020-12-07 05:11:49
问题 Following this link, I just change the webm format to fMP4 as below. But it doesn't work. The original test.webm file works fine. for webm, the config as below: //source: http://html5-demos.appspot.com/static/test.webm var FILE = "test.webm" var codec = 'video/webm; codecs="vorbis,vp8"'; for fMP4, change the config as below: //source http://yt-dash-mse-test.commondatastorage.googleapis.com/media/car-20120827-85.mp4 var FILE = "car-20120827-85.mp4"; var codec = 'video/mp4; codecs="mp4a,avc"';

MediaSourceExtension fMP4 streaming playback fail

孤街浪徒 提交于 2020-12-07 05:11:13
问题 Following this link, I just change the webm format to fMP4 as below. But it doesn't work. The original test.webm file works fine. for webm, the config as below: //source: http://html5-demos.appspot.com/static/test.webm var FILE = "test.webm" var codec = 'video/webm; codecs="vorbis,vp8"'; for fMP4, change the config as below: //source http://yt-dash-mse-test.commondatastorage.googleapis.com/media/car-20120827-85.mp4 var FILE = "car-20120827-85.mp4"; var codec = 'video/mp4; codecs="mp4a,avc"';

MediaSourceExtension fMP4 streaming playback fail

南笙酒味 提交于 2020-12-07 05:07:02
问题 Following this link, I just change the webm format to fMP4 as below. But it doesn't work. The original test.webm file works fine. for webm, the config as below: //source: http://html5-demos.appspot.com/static/test.webm var FILE = "test.webm" var codec = 'video/webm; codecs="vorbis,vp8"'; for fMP4, change the config as below: //source http://yt-dash-mse-test.commondatastorage.googleapis.com/media/car-20120827-85.mp4 var FILE = "car-20120827-85.mp4"; var codec = 'video/mp4; codecs="mp4a,avc"';

MediaSourceExtension fMP4 streaming playback fail

六月ゝ 毕业季﹏ 提交于 2020-12-07 05:05:58
问题 Following this link, I just change the webm format to fMP4 as below. But it doesn't work. The original test.webm file works fine. for webm, the config as below: //source: http://html5-demos.appspot.com/static/test.webm var FILE = "test.webm" var codec = 'video/webm; codecs="vorbis,vp8"'; for fMP4, change the config as below: //source http://yt-dash-mse-test.commondatastorage.googleapis.com/media/car-20120827-85.mp4 var FILE = "car-20120827-85.mp4"; var codec = 'video/mp4; codecs="mp4a,avc"';

audio/mp4; codecs=“mp4a.40.2” not playing in Chrome and Firefox

喜你入骨 提交于 2020-11-25 04:08:30
问题 It seems I want to convert audios, which I want to stream on my website, to audio/mp4; codecs="mp4a.40.2" . Using ffmpeg-cli-wrapper, I am converting my uploaded audio files with this command here: ffmpeg -i /tmp/input.any -acodec aac -b:a 256000 /tmp/output.aac On the client I am creating a SourceBuffer like this: this.sourceBuffer = this.mediaSource.addSourceBuffer('audio/mp4; codecs="mp4a.40.2"'); The errors are: Chrome: NotSupportedError: Failed to load because no supported source was

audio/mp4; codecs=“mp4a.40.2” not playing in Chrome and Firefox

放肆的年华 提交于 2020-11-25 04:08:26
问题 It seems I want to convert audios, which I want to stream on my website, to audio/mp4; codecs="mp4a.40.2" . Using ffmpeg-cli-wrapper, I am converting my uploaded audio files with this command here: ffmpeg -i /tmp/input.any -acodec aac -b:a 256000 /tmp/output.aac On the client I am creating a SourceBuffer like this: this.sourceBuffer = this.mediaSource.addSourceBuffer('audio/mp4; codecs="mp4a.40.2"'); The errors are: Chrome: NotSupportedError: Failed to load because no supported source was