# Help ! Need some developer to Port a X11 App to Cocoa



## MADMACMAN (Mar 24, 2004)

Hello,
so i'm working a lot with Mpeg 2 Files and need help to port a Mpeg 2 editor from X11 to Cocoa. The App is could gopchop and the webside is here :http://sourceforge.net/projects/gopchop/
I'm not developer but i can design a nice Gui for it & help other way...
So if anyone can help me to get it run under OSX or at first get it run under X11 than plz mail me. I try'ed to compile it but for me it was the first time so i have no idea...but maybe for you it will be just 2 min becaus ya know how....
So if you also need a Mpeg 2 Editor or have time or be curious than plz contact me & help us to get a new OSX App.

Thx

Stefan


----------



## The Grimace (Mar 25, 2004)

I'm having problems compiling one of the components.  Gopchop relys on a module called XML:arser, which in turns relys upon an xml engine called expat.  Expat is included with XML:arser, and makefiles generate fine via configure, but when make is invoked gcc can't find "expat.h".  Which is kinda important =)  So I went to sourceforge and found the latest version of expat.  Which has the needed headed file.  Only there's still "issues".  I'll see what I can do, but I ain't an expert.  I have no real experience with make and the like, so it's a learn-as-you-go type of thing.  However, I am a saddistic b*st*rd, and actually like this kinda stuff.

I'll post again later with a progress report.

Although, it just occurred to me... I wonder if the fink project has ported expat or XML:arser... Think I'll check that first.

(tig)


----------



## Viro (Mar 25, 2004)

In fink, you'll want to install the package called xml-parser-pm. That's the Expat wrapper for Perl.

And you need to also install a package called mpeg2dec. This is available from fink.

Oh, and welcome to the forums


----------



## MADMACMAN (Mar 25, 2004)

Thx for the try,
yes in fink you can install the xml parser & mpeg2dec..i did it and it makes the configure fine after that i type make and it starts but at the end i got some error msg...hmm the same with make install...Is there a possibility in fink to compile the package ? i have no found an option how to add an App to the list...I mail'd also the Author and he replys that it sould compile with fink and run then fine...also try not only the last version ....the stable 1.0.0 version is maybe better...also to install via Fink is GTK-1.2...i all did it but with an error at the end....mabe i did something wrong...


----------



## Viro (Mar 25, 2004)

Under fink, you need to install the mpeg2dec-dev package. This is the package that includes the mpeg2dec/mpeg2.h header file that is complains about. From looking at the configure output of gopchop, it seems like you might need the gtk+, g77 packages as well.

Then in the directory where you unpacked gopchop, you need to do the command ./configure.

This isn't as easy as it sounds, as you need to pass it certain flags. The following is my configure command


> ./configure CXX="g++" CFLAGS="-I/sw/include -O2 -mcpu=7450" LDFLAGS=-L/sw/lib CXXFLAGS=$CFLAGS CPPFLAGS=$CXXFLAGS ACLOCAL_FLAGS="-I /sw/share/aclocal" PKG_CONFIG_PATH="/sw/lib/pkgconfig"



After this, you can do the following


> make
> sudo make install



Then you can run GOPchop, and it will run  I've got it up and running now.


----------



## MADMACMAN (Mar 25, 2004)

wow cool i try it now again...do ya think it will easy to port to cocoa ?
is it possible to make an xcode project from it so that it will be easya to compile & modify ? can someone help with that ? thx for help ::love::  ::angel::


----------



## Viro (Mar 25, 2004)

MADMACMAN said:
			
		

> wow cool i try it now again...do ya think it will easy to port to cocoa ?
> thx



No, I don't think it'll be easy to port to Cocoa. At least, I don't have the time to port it to Cocoa, plus since I use OroborOSX as an X11 window manager, I get pretty good integration with OS X (i.e. copy and paste support).

You could try if you wanted too, of course. That'll benefit everybody


----------



## MADMACMAN (Mar 25, 2004)

yes it run under x11 but i can't see the video ....how can you install mpeg2dec via fink...it shows me libmpeg 1.3.1 and thats installed any idea ?


----------



## Viro (Mar 25, 2004)

Well, you probably can't see the video because you didn't install mpeg2dec. You install mpeg2dec by doing the following command



> sudo fink install mpeg2dec-dev



You'll be asked to enter your password, and then fink proceeds to download all that you need.

Now, I've been using fink for a long time, so its possible that I've modified some things, and that's why mpeg2dec can be installed. If the above doesn't work for you, here what I suggest you do.

Edit /sw/etc/fink.conf.
In the line "Trees:" add "unstable/main unstable/crypto" (without the quotes)

Then proceed to do the following


> sudo fink selfupdate           #You should just use the default option, which is 1
> sudo fink update-all
> sudo fink install mpeg2dec-dev



That will update fink to the very latest version. That my version of fink, and I managed to install mpeg2dec with it. Beware, it may take some time to compile everything.


----------



## Viro (Mar 25, 2004)

Oh and XCode is *not* easier than the command line. IMHO, XCode is the biggest pile of junk that pretends to be an IDE. Its support for anything other than Objective-C and Cocoa is mediocre.


----------



## The Grimace (Mar 25, 2004)

Couldn't find the mpeg2dec/mpeg2.h with fink (or finkcommander), though.  I've had trouble lately with it getting the current pkg list.  Anyway, I downloaded mpeg2dec and compiled from source.  Was a bit of a pain, but since I didn't really know what I was doing that's to be expected.  Anyways, good luck with it from here.  Hope you get it all worked out.

(tig)


----------



## Viro (Mar 25, 2004)

Its in the package mpeg2dec-dev.


----------



## The Grimace (Mar 25, 2004)

Viro said:
			
		

> Its in the package mpeg2dec-dev.



Yeah, but as you stated above, it's still classified as 'unstable'.  If I'm gonna hose my system, I want it to be *all* my fault    Maybe I'll learn something from it...

On an aside, I can't get it to load an mpeg either.  Keep getting the error box, with the robot from RoboCop.  It trys, but gets parse errors.

Oh well, I'll mess around with it some more later.

(tig)


----------



## Viro (Mar 25, 2004)

hehe... Its no more stable than the one you downloaded off the web 
That's the whole Debian philosophy, the paranoid buggers. But its interesting you say you can't get it to load an MPEG. Where can I get an MPEG to try out?

I've tried getting an MPEG from my Sony Cyber-shot digital camera, but I think its only and MPEG1, not MPEG 2. I've got no clue about video editing. Anyone know how to determine what MPEG version a file is in?


----------



## MADMACMAN (Mar 25, 2004)

Yes,
you have to use a Mpeg 2 PS Stream like from a TV Card . The Files you get also when you rip a DVD for example with OsEX you can choose if you want ES Elementary Streams Mpeg & AC-3 = demultiplext or PS = Programm stream = VOP or Mpeg. So if you can Rip a DVD you can get a Mpeg or Vob to try out...
but well thank you very much for your great help....i have tryed also the 1.0.3 version to compile but i get also some errors...
a other thing is: is it possible to run Linux Software on Mac ? There are very nice Mpeg 2 Video Editors out there on Sourceforge like the Linux Video Editor http://sourceforge.net/projects/lvempeg/....witch can  also be very intersting if it run on Mac OS X....maybe you know how...

Thanxx


----------



## The Grimace (Mar 25, 2004)

I found a site that supposedly has samples, but none that I downloaded worked in gopchop.  I then went on to Gnutella via Poisoned and searched for mpeg2 files, which I'm still in the process of doing.  Hopefully I'll get SOMETHING that's predetermined to be mpeg2...

(tig)


----------



## The Grimace (Mar 25, 2004)

The only way that I know of to run Linux under OS X is via Virtual PC, which was recently aqcuired by Microsoft.  However, Mac-on-Linux is another story entirely.

Do you have a mpeg2 file that you could e-mail me?  I still don't know for certain whether or not GOPchop works properly for me.  It appears so, but without a certifiable MPEG-2 file I can't know for sure.

(tig)


----------



## MADMACMAN (Mar 25, 2004)

if you can't get Mpeg 2 PS Streams then drop a line here and i will upload a small 5 -10 MB on my webspace...


----------



## MADMACMAN (Mar 25, 2004)

http://pro13701.macbay.de/Live.mpg
this is a test Mpeg PS 10 sec. 5.9 MB
should enough to try...;-)


----------



## The Grimace (Mar 25, 2004)

Ok, this is gonna sound stupid, but was there anything in that mpeg?  'Cause it loads with 18 GOPs (0-17), all of which have 12 pictures (except the last which has 3) and audio.  However, all are 0 bytes in size.

There could be something I missed in the build;  I can go back and re-build if necessary.

(tig)


----------



## MADMACMAN (Mar 26, 2004)

yep the same to me....i build at first after reinstall fink with all the packagees version 1.0.0 and it run but without any video display...it imports the Mpeg 2 PS without any trouble ....and shows the gops...etc. but i don't see a Picture....mpeg2dec ist installed....try'ed also 1.0.3 but get an error that's the path to gtk is not correct...any idea ?


----------



## The Grimace (Mar 26, 2004)

I'm gonna fiddle around with some more build settings, see what I can come up with.  As I stated in an earlier post, I don't have any real experience with configure and make.  However, I have been meaning to become more acquainted, and this seems as good a time as any.  I'll post a progress report later.  I'll also look at how the app is designed, and whether or not I think I can separate the engine from the interface.  If the interface isn't too closely tied to the engine, I might be able to compile just the engine and add an interface with REALbasic or Interface Builder.  Don't get your hopes up, however.  No guarantees ;-)

(tig)


----------



## Viro (Mar 26, 2004)

Its not a problem with the GUI. Mpeg2dec is the problem. When I load the supplied MPEG2 file on Linux, I get all sorts of information about parent offset and Data Bytes. On OS X, it is reported as 0.

Mpeg2dec is probably unable to read the data. Not sure why, but it isn't able to do it. Will explore further to see if this hypothesis is true.


----------



## The Grimace (Mar 26, 2004)

Viro - What tools do you use?  Will you be looking at it with Linux or OS X?  Just curious.  I think I've mentioned that I'm not too familiar with command-line tools =)  I'll try to get it to build in Xcode and follow it in the debugger.  My first inclination is that something somewhere is returning null instead of a struct * or something, and default values are being used.
'Course, I don't really *know* diddly.

(tig)


----------



## Viro (Mar 26, 2004)

I'll be looking at it (when I've got time) under OS X. I just tested it on Linux to see what I'm meant to expect. I mean, I don't even know what the program is meant to do, how am I to know when its working? 

On the commandline, I'd use gdb for debugging. On OS X, I haven't yet found a GUI backend to GDB that's easy enough to use. There are loads of them for X11 though... DDD is the one I use.

For editing code, if you're a hardcore command line user, ViM is the choice . But that's normally just asking for extra pain. I tend to use JEdit because it has a nice GUI that's easy to navigate.

In my experience, XCode is just not worth the effort, especially since I don't do any Cocoa programming, mainly Java and Qt.


----------



## MADMACMAN (Mar 28, 2004)

so the programm is for cutting out Frames you don't wont in am Mpeg 2 TS Stream. It's little like the same then iMovie but only for Mpeg TS from DVD or DVB TV.
It's just a Mpeg 2 Editor and there is noone for the OSX at the moment and there is really need for it...so that's why i'm startet this...
So many thx Viro for the help with the configure thing...


----------



## The Grimace (Mar 29, 2004)

Protocol 7 has already ported mpeg2dec to OS X; check it out and see if it's what you're looking for.  I'm going look a bit closer at expat; I need an XML parser for a project I'm working on anyways.

As far as Cocoa, why not Carbon?  There are more C++ programmers out there than Obj-C.

Anywys, since I'm gonna probably be using expat, I'll keep working on an actual port of GOPchop.  Seems the least I can do.

(tig)


----------



## MADMACMAN (Mar 29, 2004)

yes i found that but i don't know how to implement it in gopchop and well it could also be  a Carbon App. icheckt the latest version but i got aöways a pkg info not found error...hmm post the details later
but thx Grimance that you help to get this to run...many thx
cu later


----------

