Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

So I have a Wii U now and tested Youtube Live streaming... and it worked flawlessly. Wow, I thought, I have to find out what kind of codec, container format, protocol, etc is used, but I kinda failed at that task.

I tried using Chrome to access the Youtube Live version but before a <video> tag that would give me this kind of information in it's source parameter could even appear in the DOM, it told me that the browser doesn't support any of the available video formats. I tried the same using different browsers (Opera, FF, IE9). Deactivating Flash, thus forcing the html5 player to kick in. I always got the same message.

Wow, so the HTML5 streaming, so far, only works on my Wii U... And probably the IOS devices, but I don't have one of those.

Okay, so basically what I would like to know: How do they realize the <video> live streaming? What container format, codecs, etc is used? I can't really access that info with my knowledge.

And any tips on how to replicate said format. I am not trying to broadcast something to the whole world - I'm rather trying to just broadcast something to my Wii U, anything otherwise wouldn't make much sense at this stage. I basically only need anything that accepts a DirectShow input on Windows.

share|improve this question
    
YouTube Live Streaming for the desktop still uses Flash-based streaming, not HTML5. Probably like Adobe's Flash streaming, which also uses "normal" Flash for desktop and HTTP Live Streaming for iOS (which is Apple-specific). About the Wii U, no idea, there doesn't seem to be any specification on what it does. –  slhck Dec 1 '12 at 6:34
    
@slhck which is the crazy part. I tried researching for hours yesterday without any real success. I just found out about Apple's live streaming and that mp4 can't be live streamed without modification. The only thing I know about Wii U's browser is that it supports only h.264 in the mp4 container... Though this brought me an idea. I'm going to surf to the site with Safari and Flash disabled. Since it's an Apple product maybe it works... And if it does, maybe I can prove that it's Apple's HTTP Live Streaming what I am actually after. –  sinni800 Dec 1 '12 at 12:12
    
No dice, it doesn't work. Even when I installed quicktime (which is another 36 Megabytes just to make this browser support <video> with h.264) it didn't work. So yeah, I think it's really the Apple Http Live Streaming technique that's sitting behind there. And it seems to only work on iDevices - and probably Wii U... See, this is the trouble with videos through html5. It's beautifully enclosed with standards... until some part isn't standardized and it just goes all over the place. And people think that html5 is the death for flash. Not in it's current state. –  sinni800 Dec 1 '12 at 12:25
    
Using VLC and an elaborate command line (pastebin.com/x5fqPrK5) I actually got to reproduce the whole Apple HLS thing... And it didn't work on my Wii U. Awesome. Now I don't know what I can do. –  sinni800 Dec 1 '12 at 15:40
    
* It did work, I used it to publish to a local Microsoft IIS. I found out that you need to set the mime types or IIS won't touch those files... Now that I answered my question in a different way... I don't really know if this question is answerable anymore. But I really think this is what Youtube does since (I tested) it works on iDevices too. –  sinni800 Dec 2 '12 at 12:28
show 2 more comments

1 Answer

Youtube actually uses the HLS "Http Live Streaming" method that Apple invented and is trying to standardize.

I replicated that method using a elaborate command line for VLC and a HTTP web server and it worked on the Wii U.

Here's the command line:

"c:\program files (x86)\videolan\vlc\vlc" -I rc dshow:// vdev="XSplitBroadcaster" adev="XSplitBroadcaster" size="1280x720" --sout=#transcode{width=1280,height=720,fps=25,vcodec=h264,vb=256,venc=x264{aud,profile=baseline,level=30,keyint=30,ref=1},acodec=mp3,ab=96,channels=2}:std{access=livehttp{seglen=10,delsegs=true,numsegs=5,index=C:\inetpub\wwwroot\stream\stream.m3u8,index-url=http://dennis/stream/stream-########.ts},mux=ts{use-key-frames},dst=C:\inetpub\wwwroot\stream\stream-########.ts}

Here, for a quick set up, is html code that accesses this stream:

<!doctype html>
<html>
<head></head>
<body>
<video width="320" height="240" controls="controls">
    <source src="/stream/stream.m3u8" type="application/x-mpegURL" />
</video>
</body>

</html>

Whoever uses this, you will have to change all the variables in there. It uses "chunk files" which it puts onto the web server's wwwroot which can then be streamed by an iDevice or a Wii U.

I personally think that this would have it's best place on a ramdisk because the data rapidly changes and there isn't a lot of data around at one time.

share|improve this answer
1  
Are sure about youtube using HLS, because I can play HTML5 Youtube-videos in my google chrome but the HLS teststream provided by apple does not (devimages.apple.com/iphone/samples/bipbopall.html), so I think youtube is using another method, I read something about XHR, but I am not there yet. –  Kevkong Jan 17 '13 at 14:17
    
Very, very strange... Now I'm confused again :D –  sinni800 Jan 17 '13 at 17:02
    
Yea same here, searched yesterday about 4 hours and did not find out how youtube is streaming html5 videos to make them playable in chrome. But I really would like to know, cause I want to accomplish the same thing, stream videos to html5 tag. There is still the possibility, that youtube is using several methods and changing them depending on the used browser. –  Kevkong Jan 18 '13 at 10:51
    
I tried looking through the JS, actually, but it was very, very tedious to do that. I couldn't find anything out in this minified code. Since I didn't find a browser on Windows which could actually do it, I couldn't use the browsers dev tools to find out what kind of file is loaded in the <video> container (since the vidoe container was not loaded since the JS determined it was not supported!) I determined that it would be the Apple HLS by exclusion... But it seems that I oversaw another method... –  sinni800 Jan 19 '13 at 13:12
1  
Wait, wait, wait... @Kevkong... Try somethign else, play a html LIVE video in chrome with html5 enabled. You will either end up with Flash, or when Flash is disabled, Youtube will say that it's not compatible with this browser. Normal videos play fine, since they are h.264/webm. So don't try this with NORMAL videos, do it with LIVE videos at youtube.com/live –  sinni800 Jan 20 '13 at 11:46
show 4 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.