Ogg Theora video output - Linux patch available

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
wkv
Posts: 8
Joined: 19.02.2006
With us: 18 years 9 months
Location: Colorado Springs, CO USA

Ogg Theora video output - Linux patch available

Post #1by wkv » 28.02.2006, 04:32

Hello,

I needed/wanted to have some video produced for an opening sequence
to an animation I've done. I found that celestia 1.4.1 only supported the
windows AVI interface. I've coded up a basic, no frills, Ogg Theora
encoder module and have it working under linux. It should/could be
portable to Windows, I just don't do development on that platform.
I also spotted a forum entry that Pat Suwalski mentioned a possible
gstreamer interface which in the end would be more general perhaps.
However my experience with gstreamer 10 has me believe it is still not
ready for prime time (memory leaks, random crashes and hangs
which I've not had time or interest to debug).

One thing that I discovered is that real-time encoding is probably
not going to be possible and the slowness of watching the
movement is not very tolerable so perhaps it would be better to
have just produced raw video, perhaps libquicktime or YUVMPEG2
output compatible with mjpegtools.

Anyway I've got it working under the GTK/Gnome interface (again
not a requirement) so am wondering if there is any interest
in my cleaning up the patch a bit and sending it somewhere?

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #2by Christophe » 28.02.2006, 17:37

Yes, I'm interested. You can send a patch to chris at teyssier.org

Thanks
Christophe

Topic author
wkv
Posts: 8
Joined: 19.02.2006
With us: 18 years 9 months
Location: Colorado Springs, CO USA

Updated patch available

Post #3by wkv » 04.07.2006, 07:29

I've completed the functionality that I was interested in and generated an updated patch against the CVS version. I sent an email to Chris however didn't hear back. If anyone is interested let me know.

Abor
Posts: 16
Joined: 07.07.2006
With us: 18 years 4 months

Post #4by Abor » 18.07.2006, 09:37

Just a little of public feedback:

I asked wkv the patch, applied it on a 17-07-2006 CVS checkout and now I can capture ogg-theora movies from Celestia with the gtk/gnome interfaces.

Once again: thanks, wkv.

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #5by Christophe » 18.07.2006, 10:08

I do plan to get this integrated for the next release, it's just that I'm a bit slow.

I've fixed the aspect ratio problem, but I still have to do the KDE interface and integrate this in the build system.
Christophe

RocketMan@JSC
Posts: 43
Joined: 29.01.2005
With us: 19 years 9 months

Post #6by RocketMan@JSC » 18.07.2006, 16:31

Yes, I would find this very helpful.

Lately I was thinking of trying to integrate the Helix stuff but it just looks like too much for the time I have available.

Is there any chance I can get a copy of your patch? Right now I'm running on RHEL 3.7? and running Celestia 1.4.1 with the GTK+ interface.

Thanks,

Scott

p.s. If I can get the player working, I can record a shuttle external tank separation with proper orientation of the two vehicles--it looks pretty cool.

Topic author
wkv
Posts: 8
Joined: 19.02.2006
With us: 18 years 9 months
Location: Colorado Springs, CO USA

Quasi current patches

Post #7by wkv » 19.07.2006, 06:35

I wanted to fix some issues that Abor found however I can't get the current CVS version of Celestia to compile/link. One item that I corrected was that I had tried to merge two patches, which caused patch to get confused. So I've split it into two pieces. If you have the celestia source the following patches should work.

The first one contains the changes to the celestia source. The second contains the new files that implement the recording.

http://www.bridgingconnections.com/vide ... 0718.patch
http://www.bridgingconnections.com/vide ... 0530.patch

In the top level directory use "patch -p0 < file" to apply both patches.
Build the new "configure" script using make -f Makefile.cvs

After setup of the capture use F11 to start and stop capturing. F12 closes the capture (I implemented the same keys as the Windows AVI interface). Abor noted a double free error on the close operation. When I get a CVS version to compile I will look closer into the problem (last time it was due to old Ogg/Theora libraries, but I want to verify).

I'm curious to know what Christophe found/fixed about the aspect ration problem?

HTH,
William.

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #8by Christophe » 19.07.2006, 07:11

I explained it in an email I sent you about a week ago. I still had the same problems, the aspect ratio was wrong on all players. MPlayer was showing the correct image size in its output, put then applying a wrong aspect ratio. Using -noaspect fixed the problem but only for mplayer.

Setting ti.aspect_numerator and ti.aspect_denominator to 0 actually fixes the problem for all players.
Christophe

Topic author
wkv
Posts: 8
Joined: 19.02.2006
With us: 18 years 9 months
Location: Colorado Springs, CO USA

Aspect fix

Post #9by wkv » 19.07.2006, 07:27

Sorry I had been I'll last week and didn't see Christophe's email until now. The suggestion to just set the values to 0 will work. Although it could be argued for the the wrong reason. By not setting the aspect ratio, the players don't have any information to make a correction so leave the video alone. This will cause grief if you actually try to convert and burn a DVD for playback in a standalone DVD play however if you've tried to do that you are already familiar with pain ;-)
Perhaps I'll add a "None" option to the Aspect Ratio options and make it the default (principle of least surprise for the users).

Abor
Posts: 16
Joined: 07.07.2006
With us: 18 years 4 months

Re: Quasi current patches

Post #10by Abor » 19.07.2006, 15:43

wkv wrote: Abor noted a double free error on the close operation. When I get a CVS version to compile I will look closer into the problem (last time it was due to old Ogg/Theora libraries, but I want to verify).

You're right, the problem was related to libtheora-1.0alpha5. I recompiled with libtheora-1.0alpha7 installed and F12 doesn't break Celestia anymore.

Christophe: I am really glad that this will go into a future release with KDE integration. You, wkv and the other devels are invited to black coffee at will (someone defined a developer as a coffee-to-code converter). And free beer for everybody else.

Cheers.

Edit: I also upgraded to libogg-1.1.2

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #11by Christophe » 24.07.2006, 21:38

The patch is commited, and support in the KDE interface has been added.

But I found a bug: if the video size is the same as the frame size (width and height multiples of 16), there is a double free when deleting yuvframe[0]. If the video size is different from the window size, you may get a segfault the first time captureFrame is called for the second capture.

I haven't been able to pinpoint it yet.
Christophe

Abor
Posts: 16
Joined: 07.07.2006
With us: 18 years 4 months

Post #12by Abor » 25.07.2006, 11:19

Sorry I didn't test enough last time, F12 still crashes sometimes with the updated theora libs and today's cvs --with-kde (thanks for writing it). It works well here with any "Current" aspect ratio, which usually is non-standard when I open Celestia, though it breaks with other settings.

Tests with a Celestia inner window of 800x600 and "Specify aspect ratio" checkbox unckecked:

Code: Select all

Aspect ratio  Size                   fresh-run    not-fresh-run
------------------------------------------------------------------------
Current       Current                   OK

4:3           Current width/height      OK
4:3           SVGA                      OK
4:3           XGA, PAL,etc...           crash

16:9          Current width/height      OK
16:9          WVGA                      OK         crashes sometimes
16:9          HD720                     crash
16:9          HD-1080                   OK
------------------------------------------------------------------------
   (not-fresh-run: after having captured something else)

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #13by Christophe » 25.07.2006, 12:20

Thanks for the comprehensive report Abor.
Christophe

Topic author
wkv
Posts: 8
Joined: 19.02.2006
With us: 18 years 9 months
Location: Colorado Springs, CO USA

Finally I can reproduce

Post #14by wkv » 26.07.2006, 11:33

I now am getting the error. I'll have to investigate further tomorrow though as I need some sleep. Thanks for the report.


Return to “Development”