Thread: How to play video file?

  1. #1
    Registered User
    Join Date
    Nov 2004
    Posts
    3

    Unhappy How to play video file?

    Hi,
    I am new to programming and I need some help making a simple C program to play a video file.

    Basically, all I need the program to do is to
    1) open a video file (.avi, .mov, .mpg, whatever) located on the hard drive
    2) play that video file in some standard player (Windows Media Player, Quicktime, etc)

    I am confused about whether I should be using fopen? system()? or something else?

    Any help is greatly appreciated.
    Thanks!

  2. #2
    vae victus! skorman00's Avatar
    Join Date
    Nov 2003
    Posts
    594
    A program to play a video system will not be simple, unless all your program does is open another program, like the two you mentioned. More than likely, you would be better off not using any of the c functions (fopen and such) directly, but an API instead.

  3. #3
    Registered User
    Join Date
    Nov 2004
    Posts
    3

    more advice...

    thanks for the reply.

    actually I was able to use system() to open a normal file in Mplayer and that worked fine for now, however, I anticipate that I will need more functionality and ability to play with the video files in the future so would like to use something more flexible (e.g. some kind of API, as you mentioned).

    I am thinking of using the QuickTime API. is this a good one to use? could you recommend a better one?

    thanks

    ps. i can run either on linux or windows OS

  4. #4
    vae victus! skorman00's Avatar
    Join Date
    Nov 2003
    Posts
    594
    I haven't used the QuickTime API so I wouldn't be able to say yay or nay. I have only used DirectShow in order to use an opening video to some games I've worked on. DirectShow is cake if you're familiar with DirectX or any COM based API.

  5. #5
    Registered User caroundw5h's Avatar
    Join Date
    Oct 2003
    Posts
    751
    Warning: Opinions subject to change without notice

    The C Library Reference Guide
    Understand the fundamentals
    Then have some more fun

  6. #6
    Registered User
    Join Date
    Nov 2004
    Posts
    3

    Thanks

    Thanks, I am going to use SDL with the SMPEG libraries, seems like it should do the job

    Cheers!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Newbie homework help
    By fossage in forum C Programming
    Replies: 3
    Last Post: 04-30-2009, 04:27 PM
  2. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  3. Replies: 3
    Last Post: 03-04-2005, 02:46 PM
  4. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 10:12 PM
  5. Hmm....help me take a look at this: File Encryptor
    By heljy in forum C Programming
    Replies: 3
    Last Post: 03-23-2002, 10:57 AM