views:

260

answers:

3

Hello,

I am a final year computer engineering student. As my final year project, I have decided to create a multimedia encoder for linux, possibly cross platform.

My question is: How can I create a GUI for ffmpeg (i.e. how can I pass command line arguments from the GUI)?

I am trying to use QT for cross platform development.

A: 

The Red Hat folks use Python and pyGTK to write their CLI GUI's.

Blog posting: http://www.oreillynet.com/onlamp/blog/2008/02/red%5Fhats%5Femerging%5Ftechnology%5Fg.html

S.Lott
Well, I dont know python.But I can go 4 java, Qt(c++) etc.U can suggest me other tools also for this purpose.
varunmagical
Python would be much easier than Java to wrap a C program with. It's very easy to learn - the syntax was originally based on a teaching language. You would probably spend less time learning Python than dicking about with JNI to interface ffmpeg into your application ;-}
ConcernedOfTunbridgeWells
+1  A: 

Tcl/Tk was designed to embed scripting into C programs and is probably the easiest of any language to do this with. It has several mechanisms for doing this embedding. The API makes it very easy to retrofit it to command-line C programs using argv as it has calls for converting native Tcl data structures to and from char**. It also has GUI toolkit called Tk that is somewhat basic but very easy to use and substantially more flexible than you might think.

In your case, the two mechanisms you would probably use in Tcl are the embedding where you just call main with the arguments passed from your Tcl program. The other is to fork the process with appropriate command line args and wait for it to complete. Both are fairly easy to accomplish with Tcl.

I'm not aware of any QT bindings for Tcl but it is very portable and Tk can be themed thesedays so it doesn't look like a 1990 vintage Motif app.

Se this posting for a more in-depth discussion of the topic.

ConcernedOfTunbridgeWells
I like the tcl/tk solution, there is no easier way to write a cross platform GUI. Also, tcl is perhaps easier than most other languages to spawn a process and get its output. There's an example of how to do exactly that here: http://stackoverflow.com/questions/166231/tcl-tk-examples
Bryan Oakley
I do too. The OP's question sounds like just the sort of application Tcl/Tk was designed for. Funnily enough, my team used C and Tcl/Tk for our final year software engineering project. It had a central engine in C with a UI wrapper in Tcl/Tk. Worked a treat.
ConcernedOfTunbridgeWells
+2  A: 

Do you want to call ffmpeg from within your application? If so, look at QProcess. You can even capture the stdout and stderr streams from the ffmpeg process and use that information to (for example) drive a progress bar or display errors.

If you actually want to embed one GUI application inside another, that's a lot harder, especially to do in a platform independent manner.

Thomi