Youtube slower on my site than on Youtube - performance

I have several YouTube videos embedded on my website. I'm using the Jquery youtubeplaylist.js to load and play the movies. I recently noticed that the videos on my website stall and stutter occasionally. If I watch the same videos directly through YouTube then the videos load quickly and play smoothly.
Could it be the youtubeplaylist script that is causing the slow down? Or, could it be the fact that I am loading the video in at a custom size?
Also, does YouTube give preference to the videos played directly on their site?

I've seen the same problem, but there are too many variables to know for sure. It's clear that the nocookie player that loads from youtube-nocookie loads much slower than the regular player. Google has likely devoted fewer resources to this version of the player, probably because it garners less revenue to make up for the cost of serving video. Using the regular player, things do appear to be slower at times outside of YouTube, but that could be purely coincidental.
Having shared hosting or not shouldn't matter, since as you note the video stream is directly between Google's servers and the user's browser.

Related

Application that Streams Videos from Local Cache - in Browser?

I've built a webapp to host low-res proxies of our teams video files. The webapp is primarily for tagging and searching video. Additionally, I'd like to be able to play a random playlist of clips on TVs around the office. I've implemented this by "Casting Tab" to a Chromecast, and it works fine.
However, now I'm running up against the bandwidth limitations of my host. Latency and everything is fine, but to run a single TV's 2.5Mbps stream 8hrs a day for 23 days a month comes to about 207 GB/month, 20% of my alotted 1TB monthly transfer.
How can i build something that will "cache" these clips client-side, so that it doesnt re-download them unnecessarily? There are about 1000 clips. I'd prefer to keep it connected to my webapp via browser or some API endpoint so the RAND() stream of clips is constantly updated as people add to it.
Note: I asked a related question yesterday, and it seemed to fix my specific issue, but it doesn't seem to have worked at scale, so I'm broadening the approach a bit. Browser Caching of images and videos served via php query strings
Shaka Player has built-in support for offline playback, along with a pretty good API for listing offline assets, and removing them again.
This would require that you have your videos in MPEG-DASH format. Luckily Google also has a tool available for that. Shaka Packager can take your mp4's and package them for MPEG-DASH, provided the MP4's follow some simple requirements.
You could probably build something yourself using similar mechanisms to the Shaka Player, but it seems much easier to use Shaka for doing it.

ffmpeg streaming video website -- converting on the fly vs. hosting multiple formats

The setup: A website that streams uploaded videos using ffmpeg on the backend. Different video formats are served based on the needs of the client-device.
My understanding is that some websites keep the same video in multiple formats, while others convert the non-HTML5 video (say) into HTML5 video on the fly if the client-device calls for HTML5 video.
Why do one over the other?
Most websites/hosting platforms will keep the same video in multiple HTML5 video compatible formats (mp4 and webm as of today) for on demand delivery. Processing video on the fly requires CPU/GPU and that can cause penalty on the server load if too many people watch videos at the same time. Upstream transocding + storage/CDN is often less expensive and better for scalability.
Live video streaming is another story because you can get MPEG2 (or else) input and this often needs to be converted on the fly to multiple H264/AAC renditions either with ffmpeg or adds on like Wowza Media Server Transcoder.
EDIT:
why do sites still host Flash and non-Flash (i.e. HTML5) versions of videos?
Most do not and you do not need to. They use MP4 files to be delivered on both Flash and HTML5. You can find FLV or F4V (Adobe flavor of MP4) but they are either legacy, ads oriented, or flash only environment files (FLV can be used to store cue points for example to trigger animation at certain point of a video). Youtube for say mostly used MP4 files but you will find they deliver both flv and 3gp files (mobile) as well.
HTML5 is universal and can play on any client. Flash is restricted to PCs. By now they should have dumped Flash.
You can find on SO or Google articles describing the pros and cons of Flash vs. HTML5. Momentum on the market today is HTML5 first with a flash fallback.
HTML5 video is "only" available in 80% of current browsers. You would understand why major players like Youtube or Brightcove just won't let go of the remaining 20% audience.
Vimeo has made the switch for an HTML5 video first strategy.
Flash still holds some grounds HTML5 video has not yet covered (or is only beginning to):
DRM
Ads: you can understand now why Youtube and others have not made the HTML5 video first switch just yet.
Adaptive streaming (required for better user experience with video): though MPEG DASH is coming fast and HLS will work on Apple devices (and some others), browser adoption is still narrow for HTML5 video. Flash has well established RTMP and HDS support.
No need for cross browser tweaking: HTML5 video can be inconsistent across browser/version (events not firing as expected, prefix vendor required ...). Flash on the other hand only needs one type of video file format and will work as expected in any browser with the flash plugin installed.
Cost for technology switch: in the long run you will save money with HTML5 video (no license to pay for if you want to develop HTML5 video - web developers can do HTML5 video development and they can be less expensive than Flash expert). Short term moving to an HTML5 video first strategy is asking for major updates of a technology - hence cost.
Flash does not play on iOS and Android - that is a clear win for HTML5 video and a major drawback for Flash.
One growing caveat at the moment about flash is it being a plugin. That throws security and performance concerns. For example Microsoft has announced they will drop support for Silverlight in the coming years and is moving towards HTML5 video. Java (client side) is getting blocked more an more.
Not a good day to be a web plugin nowdays ...

Native (non-webview) streaming from YouTube?

I see a lot of applications in the Mac App store, such as MiniTube and CloudPlay, which appear to stream high quality video directly from YouTube, without using any sort of embedded player.
However, I don't see any means of doing this through the documented API. Is their scraping (e.g. http://gitorious.org/minitube/minitube/blobs/master/src/video.cpp) illegal/against the TOS, or merely undocumented and unsupported? Is there a better way of doing it?
(In particular, the so-called "chromeless" iframe player actually has a significant amount of chrome/user interaction, which is more suitable for a website than for a native application.)
EDIT: I suppose my question is primarily for the official YouTube developer support: is scraping the page for the stream against the TOS? If it is, why are these apps allowed to remain on the app store, and if it isn't, what is the best way of doing so?
Never tried this, but according to this discussion here it's against the TOS to access the native streams. They also mention that you are free to access the rstp streams made for mobile devices through the api.
So I think scraping the page is the only way to get the higher quality videos without using an embedded player in your application. If you're okay with lower quality then use the rstp way.
Another discussion about the same subject.
Any scraping would violate YouTube's TOS. There are no undocumented APIs available either. For iOS the best provide option is to use the YouTube iframe embed, but that will be within a webview. For Android, YouTube is building a library to do playback without a webview. Here's a video of the announcement http://www.youtube.com/watch?v=3WFsx-u-q3Y&feature=player_embedded. It's not launched yet, but I know they've been working very hard on it and it should be available soon.

How can I proxy a video stream from an AXIS web camera?

I'm developing a web system that (among other things) will be streaming video content to a limited number of users. There won't be more than 20 users at any one time, and they may be viewing videos from up to three cameras. However there are some restrictions on the setup of the network the clients have which are making this an absolute pain, and I'm stuck on ideas.
The cameras will be directly accessible from the web server running the software. The software server will be directly accessible to web users. However the cameras will not be able to be accessed by web users at all. So simply throwing up a flash player pointing to the url of the camera feeds isn't going to work. I need to present the video stream through the website in a cross-browser compatible manner, probably through a flash player like flowplayer, but flash is by no means a necessity.
So what are my options here? Any help would be greatly appreciated.
The web software is an ASP.NET/C# website running on a Windows server. I'd prefer not to run another program on the server, but in the (likely) case that I do, the software needs to be able to run as a service so that it can run after a server restart with no user interaction. Also, free and/or cheap options would be prefreable.
The cameras are along the line of the AXIS 214 (there are others but they're similar AXIS cameras) and outputs MJPEG and MPEG4 streams at 640x480.
So I found a cheap windows application called WebcamXP: http://www.webcamxp.com/home.aspx
It suits my purposes almost perfectly. It captures the AXIS camera's stream with no problem, and re-streams it (in MJPEG from what I can tell). It also includes a small flash front-end with no controls, which may be a drawback for some, but perfect for my needs. You can just grab the embed code from WebcamXP and drop it into the website. Nice and simple.

Hosting recommendations for technical screencasts

I am asking this question on SO because a similar question was asked here and migrated to SuperUser, but the answers it got there were more about screen sharing than hosting screencasts. I'm hoping that some of you have faced (and solved) this issue before...
My team is putting together a bunch of technical screencasts, and we are currently hosting them ourselves. We would much prefer to host them externally, to take advantage of a bigger pipe, geographically distributed data centers, and better uptime.
The screencasts are typically less than 10 minutes.
Is there a programmer-centric screencast hosting solution? Would you recommend YouTube? Vimeo? Something else?
Since Jon's answer two years ago, there have been a few additions to the screencast market:
Screencast.com, by TechSmith. The makers of Snagit, Camtasia, and Jing have a place where you can host your Screencasts at any resolution. It's not as straightforward as Screenr, but it provides you many options to upload your videos. You can upload by file or directly from Snagit 11, Jing (Free), or Camtasia.
YouTube and Vimeo (Pro) continue to be good options if you're looking for a hosting platform and they now both support a large range of HD formats as well as supporting HTML5. The drawback (or benefit?) is that your video is going to be converted to their playback resolution(s) rather than your source resolution. Snagit 11 will even upload directly to YouTube now.
Screencast.com seems like a good option if your main concern is recording screencasts on the fly and getting them uploaded quickly.
YouTube and Vimeo are probably better choices if you want your videos to be visible to the widest possible audience.
While Vimeo is more of a professional site, YouTube offers HTML5 / H.264 video playback support for all videos, so they'll play on iPhone. Vimeo currently doesn't support that on user videos, and is planning on adding it as a pro feature in the future.
If you are really concerned about 1-to-1 pixel resolution in your screencast, Vimeo Pro is not the best choice. My files had an exact 1920 to 1080 resolution and I exported them from Screenflow in "lossless". It appeared very crisp on the Mac in Quicktime Player, but after uploading to Vimeo Pro, turning HD "on", I could not read the details.
Vimeo is quick, but they have a compression good for movie scenes, but bad for small computer screen fonts. I am trying screencast.com since they leave the file "as is".
Personally, I prefer to see videos on something like Vimeo rather than YouTube or a similar site. Vimeo has a certain air of professionalism about it while still be convenient and user-friendly. Also, you can put embedded videos on your support pages if you wish or simply link to the videos in FAQs or forums. It makes it very convenient. Again though, this is just MHO.
A popular modern option is Wistia. They are more expensive than say Vimeo, but they have excellent tools for collecting emails and for analyzing how well your videos are doing. Basically they are hosting combined with video marketing.
I decided to go with them for my indie-hacker screencasts site.

Resources