Movie preview project architecture help

This is a discussion on Movie preview project architecture help within the C# Programming forums, part of the General Programming Boards category; Hi I need to make a program that shows a list of movies and let the user preview them. The ...

  1. #1
    Registered User kroiz's Avatar
    Join Date
    Jun 2007
    Posts
    116

    Question Movie preview project architecture help

    Hi
    I need to make a program that shows a list of movies and let the user preview them.

    The way I thought to approach this, is to store the movie list in a mysql db - there will be several fields of information about each movie (artist,year,genre) and a BLOB field to hold the actual video.

    what do you think about this approach?
    would it be better if I store the files on the file system and just reference them from the database?

    Another problem is what should/could I use to play the movies?
    I could get the data stream from the BLOB and save it to file and then execute media player with the name of that file, but that seem wrong for several reasons: first I would rather have the movie play from a widget integrated in my app window, secondly I am afraid the whole process of saving to a file and then reading again will hinder the app experience unbearable.

    I am a long time C++ programmer with very little experience with C#.
    Thanks.

  2. #2
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,655
    would it be better if I store the files on the file system and just reference them from the database?
    Just wanted to say that this is the way to go for any file, but *particularly* such a large format as video. The filesystem *is* a database of its own right, it doesn't need to have its function as such usurped.

  3. #3
    Registered User kroiz's Avatar
    Join Date
    Jun 2007
    Posts
    116
    The reason I wanted the video files to be in the database is because if I have them else where then for every add, deletion and modifying of one of the files I also need to update the database.
    the video files sizes I think would be around 10 MiBs.

    I read somewhere that the all BLOBs are loaded to memory (in mysql) by the database and that there is usually three copies of it in memory. is that true?

  4. #4
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Yes, that is a possibility with mySQL. You may want to look into Postgre instead of using mySQL for this project.

  5. #5
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Quote Originally Posted by kroiz View Post
    The reason I wanted the video files to be in the database is because if I have them else where then for every add, deletion and modifying of one of the files I also need to update the database.
    As opposed to having to update the database for every add, deletion and modifying of one of the blobs?

    I read somewhere that the all BLOBs are loaded to memory (in mysql) by the database and that there is usually three copies of it in memory. is that true?
    The MySQL network protocol indeed requires that blobs are transmitted as part of the row response. This means that when the db client requests a row with a blob in it, the database has to load the blob into memory, making for one copy. The client library collects the blob into its own buffer, making a second copy. Since many drivers (like the old PHP driver) wrap the C MySQL client library, they often have to transfer the blob to yet another, language-compatible buffer (MySQL manages the one it puts the data into), resulting in a third copy.
    This is a limitation of the network protocol. You can't get lower than one copy for the server and one for the client.
    Another problem is that the default value for the largest possible packet size is 1 MiB. You'd have to change this option in order to transmit blobs larger than that.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  6. #6
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,059

  7. #7
    Registered User kroiz's Avatar
    Join Date
    Jun 2007
    Posts
    116
    Quote Originally Posted by BobS0327 View Post
    Thanks BobS0327, that is an interesting project.
    I will consider using it.

  8. #8
    Registered User kroiz's Avatar
    Join Date
    Jun 2007
    Posts
    116
    Any takers about the other aspect in my question?

    What control should I use the show the movie?
    I understand that in .Net WindowsForms there is no control for video. I found such a control in WPF but it is only for windows vista.

    Another option is to just execute MediaPlayer as an external process but then every time the user will want to preview a video, a new instance of MediaPlayer will be opened and I am not sure It can be made to auto-close so eventually there will be like a million MediaPlayer instances open.

    I also found VideoLan interface for .Net. Anyone tried that? I think it might be good for my problems. by I did not find much info about it online, I guess I will just have to try it.

  9. #9
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Well, you could probably whip up something using DirectShow pretty easily, but I don't know about the status of this technology. I heard it's deprecated.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem Displaying a Struct
    By rockstarpirate in forum C++ Programming
    Replies: 16
    Last Post: 05-05-2008, 10:05 AM
  2. Game Independent Anti-cheat Project Needs Programmers
    By GIA Project Lea in forum Projects and Job Recruitment
    Replies: 3
    Last Post: 09-15-2005, 08:41 PM
  3. Summer Project Preview
    By Jeremy G in forum Game Programming
    Replies: 22
    Last Post: 06-14-2004, 03:50 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21