[MEncoder-users] i want to add mencoder in my program.

Chang Min Jeon jcm1981 at gmail.com
Thu Oct 6 17:43:47 CEST 2005


mencoder include main function.
 but i did rename main function to encoding.
 adding main.cpp including main function.
 I create encode thread.
 but segment fault occur in second time.
 i trace error.
 error line number 750 codecs_uninit_free() function in "codec-cfc.c".
 my main.cpp source following line,
 extern "C" {
void *encoding(void *data);
}
int main()
{
pthread_t p_thread[2];
char *argv[12];
int status;
argv[0] = "";
argv[1] = "-tv",
argv[2] =
"driver=v4l2:width=240:height=160:chanlist=us-bcast:norm=ntsc:channel=11";
argv[3] = "tv://";
argv[4] = "-o";
argv[5] = "tv.avi";
argv[6] = "-ovc";
argv[7] = "lavc";
argv[8] = "-oac";
argv[9] = "lavc";
argv[10] = "-endpos";
argv[11] = "5";

printf(" during encoding \n" );
int ret = pthread_create ( &p_thread[0], NULL, encoding, argv);
printf(" waiting for 10 second during encoding \n" );
sleep(7);

ret = pthread_create ( &p_thread[1], NULL, encoding, argv);
while(1)
{
printf(" during encoding \n" );
sleep(1);
}

// wait thread
pthread_join(p_thread[0], (void **)&status);
pthread_join(p_thread[1], (void **)&status);



More information about the MEncoder-users mailing list