File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Restful Video Web services using EJB3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Restful Video Web services using EJB3" Watch "Restful Video Web services using EJB3" New topic
Author

Restful Video Web services using EJB3

Geetha Ram
Greenhorn

Joined: Mar 20, 2008
Posts: 6
HI,

I am thinking to create restful video web services using EJB3 where I would provide developers the following APIs for example
I. User
1. User registration/account delete.
2. User login/logout
3. Profile's change [REST]
4. video bookmark(favorite) add/delete/(description)update
group videos(folder) add/delete/move[REST]
5. Video add/delete [use II.1]
Tag add/update/delete
6. subscribe other users, add/delete[REST]
7. message board(like facebook wall) approve/delete[REST]

II. Video
1. upload (from local file/internet/webcam?/camcorder?)
2. rate
3. comments
4. public sharing link
5. Embeded HTML code
6. Review

III. RSS (according to popularity by compare review times)

I have bunch of videos( I dont have them right now. But I would collect some soon).

My question before I start off with this project is " Is it possible to do a Restful Video Web service without knowing any compression or encoding technologies". Or in other words, Video files usually take lot of space, so in my project , if I am using cache like Ehcache on the webtier, can this webservice be able to fit in/use EHcache(or any cache at all)


FYI: this Project would be having web-tier(JSP,RESTFUL webservices,EHCache), Middle-tier/Persistent-tier(EJB3) and backend(MYSQL)


I appreciate any help on this and any other tips related to project.

Thanks,
Geetha
[ March 21, 2008: Message edited by: Geetha Ram ]
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3716
    
    5

Originally posted by Jo ljo:
Is it possible to do a Restful Video Web service without knowing any compression or encoding technologies


If you don't have to do any of the encoding yourself, ie, your using 3rd party libraries for the actual conversion. I'd like to say more, but your post a tad general. Are there more specific questions about this project you had in mind?


My Blog: Down Home Country Coding with Scott Selikoff
Geetha Ram
Greenhorn

Joined: Mar 20, 2008
Posts: 6
Thanks Scott,

My question is when a user uploads video using HTTP POST method, is it required to compress the video before storing it in the data base.(or are the videos already in compressed mode when a user uploads them).

We will be using EHCache also in our web -tier as a second-level cache that caches sessionfactory objects.so, I am just wondering if the videos are not compressed the EHCACHE may runt out of space, because video files usually take lot of space.

If the video files are required to be compressed, which technology could be used to compress them in EJB.

There is one more question
The question is: should the video files be stored in filesystem and their urls stored in Databases, or should the BLOB of the video file be stored in databases.

I searched all the posts in Java Ranch for this. I found good articles. but, there are equal no. of pros and cons for each method. Like, 1)if file system corrupts we still have files in DB when stored as BLOB. 2)If the backup of the Database also doesnt work, then we still have files on filesystem, or different applications can directly use those files instead of going through the database calls when we store just the urls of video files in the Database.

SO, I am confused which way is better to store the video files.

I hope you got my point. I appreciate your response to this.

Thanks,
Geetha
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3716
    
    5

Videos don't compress well in the conventional terminology so there's not much point to shrinking them before putting them in a database. Putting them in a database is not a great idea either given their size, so you're idea of using URLs is the better one to me.

The only thing you could do is convert the video coming in, but that requires a lot of processing power, a fair amount of licensing tools, and a great deal of patience. For example, if you upload a 50 meg 1024x768 movie to YouTube, what you get out is a tiny flash movie 320x240 (or similar). Setting up something yourself is hard simply because the number of Video/Audio formats you would have to account for is vast.
Geetha Ram
Greenhorn

Joined: Mar 20, 2008
Posts: 6
thanks for your input Scott.

Even I think its good to store the video files in a file system and then store the URLs in database.

I want to do what youtube does regarding converting video formats. But, in my project to start with I am not thinking to allow any kind of formats except flash/.flv. So, do I still need to bother about any converting or any other issues, or can I just treat the files as normal data and work on other aspects of project.

Thanks,
Geetha
[ March 25, 2008: Message edited by: Geetha Ram ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Restful Video Web services using EJB3