codec settings

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • n0ris
    Junior Member
    Junior Member
    • Jan 2003
    • 3

    codec settings

    Hi
    I would like to know how an application can get/set the filter settings without opening the property page. I am using directshow and I would like to create a batch option for my app.

    The problem is I don't want to open the property page before encoding and I know there's a another way. Some interface name ar c++ code sample would be greatly appreciated.
  • khp
    The Other
    • Nov 2001
    • 2161

    #2
    Are you talking about decoding (playback) or encoding ?

    Normally one would use VFW for encoding.

    I don't think there are any DirectShow functions for changeing filter settings automatically.

    The hackers way of getting/setting divx5 settings would be to look at the values of the registry key:

    Code:
    HKEY_CURRENT_USER\Software\DivXNetworks\DivX4Windows
    Last edited by khp; 23 Jan 2003, 09:14 AM.
    Donate your idle CPU time for something usefull.
    http://folding.stanford.edu/

    Comment

    • n0ris
      Junior Member
      Junior Member
      • Jan 2003
      • 3

      #3
      Actually I am thinking about both.

      I have noticed that in video editing apps the filter settings for encoding are saved with the project.

      Also some players have the capability to save the decoding settings.

      I have tried the ICSetState and ICGetState macros but both return error and I don't know how to make them work.

      In dshow docs they say that the filter should provide an interface to it's settings to allow an app to get them without displaying the property page. But if that's true how do I get the name of that interface?

      Comment

      • n0ris
        Junior Member
        Junior Member
        • Jan 2003
        • 3

        #4
        I wrote the following code. It displays the codec select dialog box and saves the data from the codec settings into memory then applies them back just to see if everything works ok.

        But it doesn't work. I get access violation when selecting divx, vidx, picvideo mjpeg or others. Microsoft mpeg4 and other codecs like cinepak or indeo don't throw errors.
        Maybe someone could help.


        console app:

        #include <vfw.h>
        #include <iostream.h>

        //---------------------------------------------------------------------------

        int main(int argc, char* argv[])
        {
        COMPVARS comp;
        void *mem= NULL;
        int test;
        long l;


        comp.cbSize = sizeof(COMPVARS);
        ICCompressorChoose(NULL,ICMF_CHOOSE_ALLCOMPRESSORS ,NULL, NULL,&comp, "test dialog");

        l = ICGetStateSize(comp.hic);
        if (l>0) {

        printf("ICGetStateSize: %d bytes - ok \n", l);

        //mem = AllocMem(l);
        mem = GlobalAlloc(GHND, l);

        if (!mem) printf("AllocMem - failed \n");
        else printf("AllocMem - ok \n");

        test = ICGetState(comp.hic, mem, l);

        if (test < 0) {
        printf("ICGetState - failed \n");
        //FreeMem(mem);
        }
        else printf("ICGetState: %d - ok \n",test);

        }
        else
        printf("no data");

        test = ICSetState(comp.hic, mem, l);

        printf("bytes set: %d \n",test);

        scanf("%d",test);
        return 0;
        }

        Comment

        Working...