How to play video file?

This is a discussion on How to play video file? within the C Programming forums, part of the General Programming Boards category; Hi, I am new to programming and I need some help making a simple C program to play a video ...

  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

  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, 05:27 PM
  2. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 01: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, 11: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

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