AnimeSuki Forums

Register Forum Rules FAQ Members List Social Groups Search Today's Posts Mark Forums Read

Go Back   AnimeSuki Forum > General > General Chat

Reply
 
Thread Tools
Old 2008-03-24, 16:36   Link #1
Eviltape
Senior Member
 
 
Join Date: Oct 2007
Location: Florida, USA
Youtube offers H264 & Stereo AAC

Thanks to the headscratchers at Videohelp making this thread, we now know that Youtube now offers a higher quality version of most videos - even ones uploaded years ago! Apparently Youtube keeps the original video, and encodes the said video into 300-400kbps H264 & 96-128kbps AAC-LC in an MP4.

Example. (and shameless plug)
http://www.youtube.com/watch?v=m4bIkjgXjzo



(clickable)
...and after appending "&fmt=18" to the URL making http://www.youtube.com/watch?v=m4bIkjgXjzo&fmt=18


(also clickable)

OH, THE STEREO AAC AND H264 QUALITY! Ignore the fact that the Baldr Force background is pixelated; it was originally in the upload. (oh the detailed artifacts! ) Concentrate on the interface such as the score and onscreen text.

This is the Greasemonkey script that contains the "Switch to higher quality" and download link as shown in the screenshot.
Code:
// ==UserScript==
// @name           YouTube H.264
// @namespace      http://manuelseeger.de
// @description    Inserts links to alternative, higher quality streams of Youtube videos
// @include        http://*youtube.com/watch?*
// ==/UserScript==
(function() {

// whoever posted this base64 gif first - thanks, it's so useful!
var aLoader = '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'+
            'YwSRlycNcWskCkApIyEAOwAAAAAAAAAAAA==';

function gid(s) {
    return document.getElementById(s);
}
function getAddressVariable(address, variable) {
    return address.toString().split(variable+"=")[1].split("&")[0];
}

var temp = document.createElement('p');
temp.setAttribute('id', 'ms.de-temp');
temp.setAttribute('style', 'display:none;');
document.body.appendChild(temp);

var player = gid('movie_player');
var l = getAddressVariable(player.getAttribute('flashvars'), 'l');
var t = getAddressVariable(player.getAttribute('flashvars'), 't');
var video_id = getAddressVariable(player.getAttribute('flashvars'), 'video_id');

var flVideo = "http://"+location.hostname+"/get_video?video_id="+video_id+"&t="+t+'&l='+l+'&fmt=18';

//
// try to fetch the HD H.264 video: If found, inject link
//
var actionArea = gid('actionsAreaDiv');
var myArea = document.createElement('div');
myArea.setAttribute('id', 'ms.de-search');
myArea.setAttribute('style', 'margin:1em;');
myArea.innerHTML = '<p style="font-weight:900;"><img style="vertical-align:middle;" src="data:image/gif;base64,'+aLoader+'"/> Searching for HQ video, may take a while ...</p>';

actionArea.insertBefore(myArea, actionArea.firstChild);

scriptArea = document.createElement("div");
scriptArea.setAttribute('id', 'ms.de-panel');

//
// can't use GM_XMLHttprequest here. Seems like it automatically 
// resolves 30X headers, which I need to read to determine whether 
// there is a high quality version available. 
// Thus, the detour over the embedded Javascript. 
//
// The idea to use embedded JS to request stuff came from someone on the 
// forum. So, unknown someone I can't find, thanks!
//
scriptArea.innerHTML = 
'<script type="text/javascript">'+
"function gid(s) {"+
"    return document.getElementById(s);"+
"}"+
"function request(url) {"+
"    var httpRequest;"+
"    httpRequest = new XMLHttpRequest();"+
"    httpRequest.onreadystatechange = function() { handleStreamResponse(httpRequest); };"+
"    httpRequest.open('HEAD', url, true);"+
"    httpRequest.send('');"+

"}"+
"function handleStreamResponse(httpRequest) {"+
"    try {"+
"    if (httpRequest.readyState == 4) {"+
"            var hqVideo = httpRequest.getResponseHeader('Location') ;"+
"            var a = document.createElement('a');"+
"            switch (parseInt(httpRequest.status)) {"+
"                case 303:"+
"                case 302:"+
"                    gid('ms.de-temp').innerHTML = hqVideo; "+
"                    a.setAttribute('href', '#');"+
"                    a.setAttribute('id', 'ms.de-link');"+
"                    a.setAttribute('rel', 'nofollow');"+
"                    a.innerHTML = 'HQ Video Stream';"+
"                    a.setAttribute('style', 'font-weight:900;font-size:medium;');\n"+
"                    a.addEventListener('click', function() { "+
"                        gid('playerDiv').innerHTML = '<embed ' + "+
"                        ' width=\"480\" '+ "+
"                        ' height=\"395\" '+ "+
"                        ' flashvars=\"sourceid=yw&video_id="+video_id+"&l="+l+"&t="+t+"&ap=%26fmt=18\" ' + "+
"                        ' allowfullscreen=\"true\" '+ "+
"                        ' quality=\"high\" '+ "+
"                        ' bgcolor=\"#FFFFFF\" '+ "+
"                        ' name=\"movie_player\" '+ "+
"                        ' id=\"movie_player\" '+ "+
"                        ' src=\"/player2.swf\" '+ "+
"                        ' type=\"application/x-shockwave-flash\"/>'; "+
"                    }, false); "+

"                    gid('ms.de-search').innerHTML = '<strong>Switch to higher quality: </strong> ';"+
"                    gid('ms.de-search').appendChild(a);"+
"                    if (hqVideo.indexOf('cache.googlevideo.com') == -1) {"+
"                        var a2 = document.createElement('a');"+
"                        a2.setAttribute('href', hqVideo);"+
"                        a2.setAttribute('style', 'margin-left:1em;');"+
"                        a2.innerHTML = '<strong>[Download]</strong>';"+
"                        gid('ms.de-search').appendChild(a2);"+
"                    }"+
"                    break;"+
"                case 500:"+
"                case 415:"+
"                case 404:"+
"                default: "+
"                    gid('ms.de-search').innerHTML = '<strong>Sorry, no HQ version found :-(</strong> ';"+
"            }"+        
"        "+
"    }"+
"    } catch (e) {"+
"        alert(e + hqVideo);"+
"    }"+
"}"+
"request('"+flVideo+"');"+
'</script>';
actionArea.appendChild(scriptArea);


// most.. dirty...
function timedCount(){
    var temp = gid('ms.de-temp');
    if (temp.textContent == '') {
        window.setTimeout(timedCount,10);
    } else {
        gmRequest(temp.textContent);
        temp.innerHTML = '';
        clearTimeout();
    }
}

//
// this is a failsave method that asynchronisly loads the headers
// of the final video file while the video link to hihger quality is
// already displayed. This request sometimmes takes up to 5 minutes,
// which is way it's done 'in the background'
// If it doesn't return 200 OK for the HQ video, the link to HQ is
// removed.
// 
function gmRequest(url) {
    //GM_log('Requesting '+url);
    GM_xmlhttpRequest({ // start of xmlHTTPRequest()
        method: 'HEAD',
        url: url,
        headers: {
            'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',
            'Accept': '*/*'
        },
        onload: function(responseDetails) {
            if (parseInt(responseDetails.status) != 200) {
                gid('ms.de-search').innerHTML = '<strong>Sorry, HQ seems broken :-(</strong> ';
            }
        }
    });// end of xmlHTTPRequest()
}
timedCount();
})();
The downsides are that the encoders have to let Youtube do the crappy standard video encoding for a bad first impression, the HQ video doesn't appear for a long while afterwards (at peak Euro + American hours for hours, at 10PM EST maybe 10 minutes), and the video doesn't appear on your channel until the fmt=18 video encodes.

Now that we in the HD upload community finally can say "Yay, now we don't have to hex edit the FLV length anymore or encode in FLV and 22.05khz MP3s!", discuss.
Eviltape is offline   Reply With Quote
Old 2008-03-27, 13:48   Link #2
oompa loompa
Senior Member
 
 
Join Date: Jun 2007
Location: 28 37', North ; 77 13', East
Age: 23
i guess.. most people would migrate to megavideo or veoh. frankly speaking the only thing i can think of that keeps (kept) youtube going was the fact that everyone knows about it, and the gigantic amount of videos it already had. but once people realized there were several better quality sites it makes sense that they would migrate. besides, youtubes had the same quality videos for long enough, its about damn time they did this
oompa loompa is offline   Reply With Quote
Old 2008-03-28, 08:52   Link #3
Rikimtasu
Dokan!
 
 
Join Date: Aug 2007
Location: Malaysia
Age: 23
Send a message via MSN to Rikimtasu
Quote:
Originally Posted by Eviltape View Post
Thanks to the headscratchers at Videohelp making this thread, we now know that Youtube now offers a higher quality version of most videos - even ones uploaded years ago! Apparently Youtube keeps the original video, and encodes the said video into 300-400kbps H264 & 96-128kbps AAC-LC in an MP4.

Example. (and shameless plug)
http://www.youtube.com/watch?v=m4bIkjgXjzo



(clickable)
...and after appending "&fmt=18" to the URL making http://www.youtube.com/watch?v=m4bIkjgXjzo&fmt=18


(also clickable)

OH, THE STEREO AAC AND H264 QUALITY! Ignore the fact that the Baldr Force background is pixelated; it was originally in the upload. (oh the detailed artifacts! ) Concentrate on the interface such as the score and onscreen text.

This is the Greasemonkey script that contains the "Switch to higher quality" and download link as shown in the screenshot.
Code:
// ==UserScript==
// @name           YouTube H.264
// @namespace      http://manuelseeger.de
// @description    Inserts links to alternative, higher quality streams of Youtube videos
// @include        http://*youtube.com/watch?*
// ==/UserScript==
(function() {

// whoever posted this base64 gif first - thanks, it's so useful!
var aLoader = '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'+
            'YwSRlycNcWskCkApIyEAOwAAAAAAAAAAAA==';

function gid(s) {
    return document.getElementById(s);
}
function getAddressVariable(address, variable) {
    return address.toString().split(variable+"=")[1].split("&")[0];
}

var temp = document.createElement('p');
temp.setAttribute('id', 'ms.de-temp');
temp.setAttribute('style', 'display:none;');
document.body.appendChild(temp);

var player = gid('movie_player');
var l = getAddressVariable(player.getAttribute('flashvars'), 'l');
var t = getAddressVariable(player.getAttribute('flashvars'), 't');
var video_id = getAddressVariable(player.getAttribute('flashvars'), 'video_id');

var flVideo = "http://"+location.hostname+"/get_video?video_id="+video_id+"&t="+t+'&l='+l+'&fmt=18';

//
// try to fetch the HD H.264 video: If found, inject link
//
var actionArea = gid('actionsAreaDiv');
var myArea = document.createElement('div');
myArea.setAttribute('id', 'ms.de-search');
myArea.setAttribute('style', 'margin:1em;');
myArea.innerHTML = '<p style="font-weight:900;"><img style="vertical-align:middle;" src="data:image/gif;base64,'+aLoader+'"/> Searching for HQ video, may take a while ...</p>';

actionArea.insertBefore(myArea, actionArea.firstChild);

scriptArea = document.createElement("div");
scriptArea.setAttribute('id', 'ms.de-panel');

//
// can't use GM_XMLHttprequest here. Seems like it automatically 
// resolves 30X headers, which I need to read to determine whether 
// there is a high quality version available. 
// Thus, the detour over the embedded Javascript. 
//
// The idea to use embedded JS to request stuff came from someone on the 
// forum. So, unknown someone I can't find, thanks!
//
scriptArea.innerHTML = 
'<script type="text/javascript">'+
"function gid(s) {"+
"    return document.getElementById(s);"+
"}"+
"function request(url) {"+
"    var httpRequest;"+
"    httpRequest = new XMLHttpRequest();"+
"    httpRequest.onreadystatechange = function() { handleStreamResponse(httpRequest); };"+
"    httpRequest.open('HEAD', url, true);"+
"    httpRequest.send('');"+

"}"+
"function handleStreamResponse(httpRequest) {"+
"    try {"+
"    if (httpRequest.readyState == 4) {"+
"            var hqVideo = httpRequest.getResponseHeader('Location') ;"+
"            var a = document.createElement('a');"+
"            switch (parseInt(httpRequest.status)) {"+
"                case 303:"+
"                case 302:"+
"                    gid('ms.de-temp').innerHTML = hqVideo; "+
"                    a.setAttribute('href', '#');"+
"                    a.setAttribute('id', 'ms.de-link');"+
"                    a.setAttribute('rel', 'nofollow');"+
"                    a.innerHTML = 'HQ Video Stream';"+
"                    a.setAttribute('style', 'font-weight:900;font-size:medium;');\n"+
"                    a.addEventListener('click', function() { "+
"                        gid('playerDiv').innerHTML = '<embed ' + "+
"                        ' width=\"480\" '+ "+
"                        ' height=\"395\" '+ "+
"                        ' flashvars=\"sourceid=yw&video_id="+video_id+"&l="+l+"&t="+t+"&ap=%26fmt=18\" ' + "+
"                        ' allowfullscreen=\"true\" '+ "+
"                        ' quality=\"high\" '+ "+
"                        ' bgcolor=\"#FFFFFF\" '+ "+
"                        ' name=\"movie_player\" '+ "+
"                        ' id=\"movie_player\" '+ "+
"                        ' src=\"/player2.swf\" '+ "+
"                        ' type=\"application/x-shockwave-flash\"/>'; "+
"                    }, false); "+

"                    gid('ms.de-search').innerHTML = '<strong>Switch to higher quality: </strong> ';"+
"                    gid('ms.de-search').appendChild(a);"+
"                    if (hqVideo.indexOf('cache.googlevideo.com') == -1) {"+
"                        var a2 = document.createElement('a');"+
"                        a2.setAttribute('href', hqVideo);"+
"                        a2.setAttribute('style', 'margin-left:1em;');"+
"                        a2.innerHTML = '<strong>[Download]</strong>';"+
"                        gid('ms.de-search').appendChild(a2);"+
"                    }"+
"                    break;"+
"                case 500:"+
"                case 415:"+
"                case 404:"+
"                default: "+
"                    gid('ms.de-search').innerHTML = '<strong>Sorry, no HQ version found :-(</strong> ';"+
"            }"+        
"        "+
"    }"+
"    } catch (e) {"+
"        alert(e + hqVideo);"+
"    }"+
"}"+
"request('"+flVideo+"');"+
'</script>';
actionArea.appendChild(scriptArea);


// most.. dirty...
function timedCount(){
    var temp = gid('ms.de-temp');
    if (temp.textContent == '') {
        window.setTimeout(timedCount,10);
    } else {
        gmRequest(temp.textContent);
        temp.innerHTML = '';
        clearTimeout();
    }
}

//
// this is a failsave method that asynchronisly loads the headers
// of the final video file while the video link to hihger quality is
// already displayed. This request sometimmes takes up to 5 minutes,
// which is way it's done 'in the background'
// If it doesn't return 200 OK for the HQ video, the link to HQ is
// removed.
// 
function gmRequest(url) {
    //GM_log('Requesting '+url);
    GM_xmlhttpRequest({ // start of xmlHTTPRequest()
        method: 'HEAD',
        url: url,
        headers: {
            'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',
            'Accept': '*/*'
        },
        onload: function(responseDetails) {
            if (parseInt(responseDetails.status) != 200) {
                gid('ms.de-search').innerHTML = '<strong>Sorry, HQ seems broken :-(</strong> ';
            }
        }
    });// end of xmlHTTPRequest()
}
timedCount();
})();
The downsides are that the encoders have to let Youtube do the crappy standard video encoding for a bad first impression, the HQ video doesn't appear for a long while afterwards (at peak Euro + American hours for hours, at 10PM EST maybe 10 minutes), and the video doesn't appear on your channel until the fmt=18 video encodes.

Now that we in the HD upload community finally can say "Yay, now we don't have to hex edit the FLV length anymore or encode in FLV and 22.05khz MP3s!", discuss.
Oh well.I was using that one,but:
http://userscripts.org/scripts/show/23864
This one is pretty much>that one,at least i think.
Quote:
The width of YouTube+ is 1580 pixels.
Hell yeah!
__________________
Rikimtasu is offline   Reply With Quote
Old 2008-03-28, 09:09   Link #4
technomo12
Wise Otaku Seeker
 
 
Join Date: Feb 2008
Location: Philippines
Age: 24
to be precise i still prefer Veoh than you tube on watching anime but for sheer randomness i stick to youtube
__________________
technomo12 is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 18:44.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
We use Silk.