problem with pymedia under panda3D

Hello,
I’m using panda3d for the render of a software, and I need to make a movie in it.
For that, I first save pictures from the scene, then use a ‘frame joiner’ wich make the movie itself from the list of pictures.
This frame_joiner use pymedia.

The issue apears when I try to get the encoder:

import sys, os, time
import pygame
import pymedia.video.vcodec as vcodec
import glob
from pprint import pprint
    
def getEncoder(outCodec, height, width):
    if outCodec== 'mpeg1video': bitrate= 2700000
    else                      : bitrate= 9800000
    #==
    params= { \
      'type': 0,
      'gop_size': 12,
      'frame_rate_base': 125,
      'max_b_frames': 0,
      'height': height,
      'width': width,
      'frame_rate': 2997,
      'deinterlace': 0,
      'bitrate': bitrate,
      'id': vcodec.getCodecID( outCodec )
    }
    return vcodec.Encoder( params ) <-issue here
    

When I call the function from my code using panda I get that:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1209812784 (LWP 11691)]
MPV_encode_init (avctx=0xab96b80) at video/libavcodec/mpegvideo.c:559
559     video/libavcodec/mpegvideo.c: No such file or directory.
        in video/libavcodec/mpegvideo.c
(gdb) bt
#0  MPV_encode_init (avctx=0xab96b80) at video/libavcodec/mpegvideo.c:559
#1  0xb6d89095 in avcodec_open () from /usr/lib/python2.4/lib-dynload/libpanda.so
#2  0xabeb1481 in Codec_New (cObj=0xac56d74, type=<value optimized out>, bDecoder=0) at video/vcodec/vcodec.c:1313
#3  0xabeb1583 in EncoderNew (type=0xabfa0780, args=0xac3892c, kwds=0x0) at video/vcodec/vcodec.c:1403
#4  0x0808fffd in ?? ()
#5  0xabfa0780 in pyvcodec_methods ()
   from /usr/lib/python2.4/site-packages/pymedia-1.3.7.3-py2.4-linux-i686.egg/pymedia/video/vcodec.so
#6  0x0ac3892c in ?? ()
#7  0x00000000 in ?? ()

The frame_joiner can work without panda, when I use it this way it works perfectly. When I call it from a file not using panda, it still works.
When I call it from a file using Panda3D, the problem appeared.
The fact that libpanda.so appeared in the stack where it has no reason to do so make me think that there is a problem with panda3D and pymedia.
Can anybody help me?

Thanks in advance.

Perhaps it’s a conflict in the version of the ffmpeg library used by pymedia, and the one used by Panda. You might need to compile a custom version of either or both of pymanda and Panda to ensure they both use the same version of ffmpeg (or compile a version of Panda that doesn’t use ffmpeg at all).

Or, save all the frames, and then quit and exit and run a separate process to join them, without having Panda loaded.

David