Delivering HD Video

Comments

JHendrix wrote on 2/3/2012, 9:58 AM
yes i currently stream from a normal web host using JW and it is not that bad. the other supposed advantage to S3 is CDN so (supposedly) users around the world have better playback.

regarding rtmp, i have been talking with JW and they said:

--

if you are using rtmpE it will be more secure and get around download/leech programs but at the end of the day people will try to use screen recorders like FRAPS to just download your content.

--

so still good to know moderate protection can be had via rtmpe. more research required though
JHendrix wrote on 2/7/2012, 5:36 AM
"this should play on most any browser/device & adjust the quality of playback based upon the user's bandwidth"

i would like to have a player like youtube where the user can switch :

1. small player, large player, full screen

2. quality - 240p-720p
amendegw wrote on 2/7/2012, 6:01 AM
Here's the JW Player javascript I use to play the video above. Note, there are 4 different videos that are automatically selected based upon the user's bandwidth. I use MediaInfo to determine what the bitrate of each video stream (which gets hardcoded into the javascript). Furthermore, if the browser does not support flash, it tries HTML5, if that's not supported, it just downloads the video.

Also, notice that I took a somewhat different tack than you suggest. My javascript resizes the player based upon the size of the user's browser window. I should be a fairly simple change to base this upon the user's bandwidth. (btw: it also uses jQuery and a utility called "simplemodal" to create the lightbox effect).

        function playIt(divID, vid, width, height) {
var pct = .70;
var aspect = width / height;
var w;
var h;
//Four Videos at four different framesizes and bitrates
// These will be used for bitrate switching
var vid720 = vid + "720.mp4";
var vid480 = vid + "480.mp4";
var vid360 = vid + "360.mp4";
var vid240 = vid + "240.mp4";
//Logic to size the player based upon the browser size
if ($(window).width() / $(window).height() > aspect) {
h = Math.round($(window).height() * pct);
w = Math.round($(window).height() * pct * aspect);
// alert("h=" + h + "\r\n" + "w=" + w + "\r\n" + "Ratio =" + w / h);
}
else {
w = Math.round($(window).width() * pct);
h = Math.round($(window).width() * pct / aspect);
// alert("h=" + h + "\r\n" + "w=" + w + "\r\n" + "ratio =" + w / h);
}
//Don't make the Player larger than the source footage
if (h > height) {
h = height;
w = width;
}

jwplayer('container').setup({
//'file': vid,
// Use MediaInfo to get the bitrates for each video file
'levels': [
{ bitrate: 1416, file: vid720 },
{ bitrate: 735, file: vid480 },
{ bitrate: 483, file: vid360 },
{ bitrate: 267, file: vid240 }
],
'height': h,
'width': w,
// The following will configure JW Player to
// Play Flash, if not supported then
// Play HTML5, if not supported then
// Download the file
'modes': [
{ 'type': 'flash',
'src': 'JWPlayer/player.swf'
},
{ 'type': 'html5',
'config': {
'provider': 'video'
}
},
{ 'type': 'download', config: {
'provider': 'video'
}
}],
'events': {
'onComplete': function () {
$.modal.close();
}
}
});
$(divID).modal({
opacity: 80,
overlayCss: { backgroundColor: "#342826" },
containerCss: { height: h, width: w },
onClose: function () {
$.modal.close();
}
});

jwplayer('container').play();
}

...Jerry

Edit: Is this code ready for primetime? I dunno. I pretty much quit testing and debugging because I didn't have the cadre of devices/browsers that are needed to test every scenario.

System Model:     Alienware M18 R1
System:           Windows 11 Pro
Processor:        13th Gen Intel(R) Core(TM) i9-13980HX, 2200 Mhz, 24 Core(s), 32 Logical Processor(s)

Installed Memory: 64.0 GB
Display Adapter:  NVIDIA GeForce RTX 4090 Laptop GPU (16GB), Nvidia Studio Driver 566.14 Nov 2024
Overclock Off

Display:          1920x1200 240 hertz
Storage (8TB Total):
    OS Drive:       NVMe KIOXIA 4096GB
        Data Drive:     NVMe Samsung SSD 990 PRO 4TB
        Data Drive:     Glyph Blackbox Pro 14TB

Vegas Pro 22 Build 239

Cameras:
Canon R5 Mark II
Canon R3
Sony A9