Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] AIO-DIVX Changes




Hello all,

mplayer/mencoder changed syntax of the rescale parameters
this affects the divx-record patch - here up2date code (dvbapi.c):

     // DIVX record patch start
     if (record) {
         if ((Setup.divxrecord>=1) && (record)) {
             // here we ensure we get a .avi behind xxx.VDR
             //printf ("Adding .avi to record filename: %s\n",fileName);
             sprintf(fileName, "%s.avi",fileName); // 
         }
         if (Setup.divxrecord>=1) {
                //printf ("recording divx to '%s'\n", fileName);
                dsyslog(LOG_INFO, "recording divx to '%s' please ensure your mplayer is recent and supports -vop parameter", fileName);
                // TODO: load DIVX encode settings from setup file ect and compute a correct variable size
                // because we waste some mem here and do a dirty trick to bypass an overflow
                char mencodercall[512]; //so the compiler knows mencodercall is a var (reqired by sprintf below) 
                     if (Setup.divxrecord==2) sprintf(mencodercall, "/usr/local/bin/mencoder -ovc divx4 -divx4opts br=600 -divx4opts q=5 -oac copy -vop scale=268:200 -o \'%s\' -- - ",fileName);
                else if (Setup.divxrecord==3) sprintf(mencodercall, "/usr/local/bin/mencoder -ovc divx4 -divx4opts br=800 -divx4opts q=3 -oac copy -vop scale=268:200 -o \'%s\' -- - ",fileName); 
                else if (Setup.divxrecord==4) sprintf(mencodercall, "/usr/local/bin/mencoder -ovc divx4 -divx4opts br=1200 -divx4opts q=2 -oac copy -vop scale=268:200 -o \'%s\' -- - ",fileName); 
                else {   // divx = 1 or unspecified value
                         printf("Custom DIVX encoding with Bitrate=%d00 Quality=%d X-Resolution=%d Y-Resolution=%d\n",Setup.divxbitrate,Setup.divxquality,Setup.divxx,Setup.divxy);
                         sprintf(mencodercall, "/usr/local/bin/mencoder -ovc divx4 -divx4opts br=%d00 -divx4opts q=%d -oac copy -vop scale=%d:%d -o \'%s\' -- - ",Setup.divxbitrate,Setup.divxquality,Setup.divxx,Setup.divxy,fileName);
                }
                if (!divxpipe && !divxpipe.Open(mencodercall,"w")) {
                   printf ("ERROR: can't open pipe to encoder for recording divx to '%s'\n", fileName);
                   esyslog(LOG_ERR, "ERROR: can't open pipe to encoder");
                }
                file=divxpipe.compipe; // aka return value
         }
         else {
                dsyslog(LOG_INFO, "recording VDR file to '%s'", fileName);
                file = OpenVideoFile(fileName, O_RDWR | O_CREAT | BlockingFlag);
                if (file < 0) LOG_ERROR_STR(fileName);
         } // (Setup.divxrecord>=1)
    // DIVX record patch end


In addition to this you can remove the warning about using the VCD-addon together with DIVX recording.
It seems that the VCD addon works without disturbing record within a few seconds...
there's still a random BUG which causes VDR to stop sending data to the pipe at certain (unknown) conditions.

I collected errors ranging from 7seconds and at 4000seconds of record... i also had a recording
which was terminated by timer after 2 hours of record time...

It seems like there's a 30 or 55 second delay from the end of data to destruction of the pipe handle and
exiting vdr (rarely, but sometimes with segfault)... investigation will continue, help is welcome :)


Regards,
emmtee




Home | Main Index | Thread Index