-
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!
-
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.
-
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
-
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.
-
-
Thanks
Thanks, I am going to use SDL with the SMPEG libraries, seems like it should do the job :)
Cheers!