I am developing a website in ASP.NET 3.5 which involves a large number of videos. I am using XML to save the links of the files. Currently, I am facing space issues due to large number of videos. Please suggest how to overcome the problem.
If the number of videos is very large, you will need to move to a more effective storage mechanism than a simple XML file. I'd suggest a database engine (Firebird would likely be suitable for your needs).
Larger hard drive or place them on something like You Tube and embed the videos. Not much choice unless you can use a different comprssion codec and reduce the quality which would in turn reduce the size.
Related
I am working in ASP.NET MVC. I want to add videos in my view. I have read article on Working With Videos in ASP.NET
But i want a generic way to play all type of videos in my web page. This article, although good, but confuses me that how to identify file format and then use related type of Web Helper. There are hundreds of video file formats, how to play all of them, by a single strategy. Mentioned article only describes three formats. Please guide me in this regard.
Your issue is less ASP.NET MVC and more general video playback accross multiple devices in different formats.
Your best option would be to use something like FlowPlayer, which allows you to add a player using either Flash or HTML5/JS (depending on the browser's feature set)
I think to say you want to play all types of videos is the wrong way to start. First of all I would think about what video types you want to support. This can be restricted by things such as the encoded videos available, file size, browser support.
Once you have decided on this you can look in to finding the most suitable player for the job.
I am creating a whiteboard application using flex. I want to add a document sharing functionality to the application i.e, the user can upload the documents which will be loaded into the whiteboard and users can annotate over the document.
I googled a lot but still not sure where to start how to start. I only got the idea that the document can be converted to series of images on the server side and can be loaded in to flex app.
Can the experts help me get started with this. I am planning to use java for the server side.
Thanks all.
I'm not sure about uploading files to whiteboard itself. I think it's better to use loader and put your whiteboard on top of it.
What about software to convert documents. I'm not server side programmer, but I can share programs that we are using to convert documents:
Now we are using Print2Flash for almost all documents, but planning to give a chance for iSpring to convert Powerpoint presentations.
Both are live projects, getting improvements often enough and can convert documents to swf files. Personally I like the way Print2Flash provides ability to customize resulting swf with your own patterns and gives great flexibility to interract with it. As I know, nowadays iSpring added AS3 API to converted files, which is huge enhancement, but it's kinda expensive.
And don't forget about OpenOffice. It has not that good converter, but at least it is free. We've used it before, but gave preference to Print2Flash.
Hope my answer will give you a place to start.
Cheers.
i have an old cms (classic asp) where for every image that the editor is upload i save 3 images (small,big and original).
the size of the images are pre defined in the db (for each modul difrent size).
now in the new CMS (asp.net) that i build i think to save just the original and create images on demand with the right size?
did it's ok? i will get better flexibility but maybe it will be slower?
Machines are super fast today, but that doesn't mean you shouldn't "help" them do their work :) Resizing images on deman is resource intensive. Think about situation where you have hundred concurent request that are resizing same image.
I think you should combine both solution. Use temporary cache for let's say, last hundred image requests. Optimization of this kind of solution depends primary on site traffic, so you should keep cache size as configuration option.
I have an ASHX handler that I am using to display images that are stored in a database. I display the images as thumbnails and then full size if the user mouses over them.
How can I combine the images at runtime to produce CSS sprites for use in this situation?
If it can be done does anyone have suggestions on where to start?
UPATE
It seems like most people are saying this is not a good situation to use sprites in. I'm new to the sprite concept so please bear with me.
If I am going to be loading 30 thumbnails on a page from my database everytime why would it not make sense to pass them from the server to the client as one large image instead of passing 30 individual images? Wouldn't this be faster? Isn't this the purpose of CSS Sprites?
As far as the browser is concerned, an HTTP resource is an HTTP resource and it is irrelevant if the server produced it by reading a file from a hard disk, taking data out of a database, or spewing the content of a random number generator through an algorithm that would output valid PNG data.
You just need to generate your images from the data as normal.
That said, since the images are content, CSS would be an inappropriate tool to include them in the document. You should use an <img> element.
You have a couple options.
Your handler can combine the images on the fly that it gets from the database and send the whole thing down to the browser.
OR (and I like this one better)
You create the merged image at the time the images are uploaded to your site.
The second is better as the conversion only has to happen once and therefore means that you only have to spend those resources once. It does mean you are essentially storing 2 copies of the image, but that's fine.
UPDATE
I believe I misinterpreted what you were trying to do. I thought you were trying to combine the thumbnail with the full blown image. Instead, you appear to be really asking how to combine all of the thumbnail images.
In that case, it's even more of a bad idea. As David Dorward stated CSS is used to control layout. You're talking about content. However, the semantic issue aside, in the event you want to make tweaks to the layout your going to have to modify your code which creates the sprites to begin with. What if you decide to do 35 images? Or, change that to do 18?
By going the sprite route your pretty well screwed by being forced to modify code for any layout change which is NOT good style.
To cover that last question: wouldn't it be faster? Probably not. Under this scenario you would have to create the sprite on the fly, which introduces server overhead, which slows everything down. At most it might be a wash in the delivery time. At worst, you incur a large server and development performance negative impact.
Check out http://www.RequestReduce.com. It not only creates the sprite file automatically, but it does it on the fly through an HttpModule along with merging and minifying all CSS. It lso optimizes the sprite image using quantization and lossless compression and it handles the serving of the generated files using ETags and Expires headers to ensure optimal browser caching. The setup is trivial involving just a simple web.config change. See my blog post about its adoption by the Microsoft Visual Studio and MSDN Samples gallery.
I completely agree with David. Just a quick note regarding David's last point: That's only if the images are content. However, if they were part of the layout, then CSS would be appropriate.
That said, with this use case, sprites aren't a good choice. One of the purposes of thumbnails is to cut down loading time, which a sprite would make worse for a gallery. A better pattern might be using a lightbox or something similar with two images rather than one, with the larger being requested on demand.
Sprites are not a good solution here.
To answer your update, sprites are ideal for many small images, where the overhead of a new HTTP request outweighs the few bytes being sent for a small png or gif (e.g. 16x16 icons, etc). For larger images the time of the HTTP request becomes less important overall as the download time increases.
Packing images into a sprite also means that they will execute one longer request and other requests will have to queue behind it. If the important thing is to get the thumbnails showing quickly, then make sure those get loaded first before starting to load any larger views of the same images.
Any larger files that don't display at the initial page load should be late-loaded (window.onload) or lazy-loaded (as needed by click or hover actions).
If this is a question that shouldn't be on SO, please let me know.
Has anyone tried the website:
http://csssprites.org/
To autogenerate and use CSS Sprites? What are your thoughts? I'm thinking about implementing (constantly looking for new ways to improve performance)
Yes, sprites speed up a site because
less HTTP requests
avoid small overhead every image has
They make sense for icons etc
Downsides are
More difficult to change one icon
Can't cache control individual icons
I used CSS Sprites to create my first sprite, but I tend to chop them together myself now as I personally find it easier to create strips-of-sprites (i.e. long and thin) rather than big square sprites as its easier to update them if you understand the convention used to create them.
If you are using .net, check out http://www.RequestReduce.com. It not only creates the sprite file automatically, but it does it on the fly through an HttpModule along with merging and minifying all CSS. It lso optimizes the sprite image using quantization and lossless compression and it handles the serving of the generated files using ETags and Expires headers to ensure optimal browser caching. The setup is trivial involving just a simple web.config change. See my blog post about its adoption by the Microsoft Visual Studio and MSDN Samples gallery.