CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: CAnimateCtrl

  1. #1
    Join Date
    Nov 2011
    Location
    India
    Posts
    333

    CAnimateCtrl

    Hi,

    I'm using Windows 8 OS, VC 2012.

    Using the below link i load avi file in my mfc application.
    CAnimateCtrl() Example Code.
    It was working Good.

    I like to change the avi file Sample.avi instead of Filecopy.avi
    Download Sample.avi in inside RawAVIStream.zip

    After replace the avi file, the avi file was not running?

    again i was changed windows 8 default system avi files to run in mfc application. I was worked properly.

    Any restrictions in avi file size to load avi files?

    My Requirement:
    1. I want to load any avi file using file open dialog
    2. Play avi file via CAnimateCtrl.
    3. Like Windows media player i will Play, Fwd, Rw & Stop my avi file at any time and read the current frame as RGB bytes and store the bytes in file.

    Thanks in advance.
    Regards,

    SaraswathiSrinath

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: CAnimateCtrl

    From MSDN:
    Animation controls can play only simple AVI clips. Specifically, the clips to be played by an animation control must meet the following requirements:
    There must be exactly one video stream and it must have at least one frame.
    There can be at most two streams in the file (typically the other stream, if present, is an audio stream, although the animation control ignores audio information).
    The clip must either be uncompressed or compressed with RLE8 compression.
    No palette changes are allowed in the video stream.
    Victor Nijegorodov

  3. #3
    Join Date
    Nov 2011
    Location
    India
    Posts
    333

    Re: CAnimateCtrl

    Thanks Mr.Victor.

    Is possible to read frame by frame RGB data in MFC Windows Media Player?

    I done to read the whole avi file as RGB Data.

    But i like to read frame by frame.

    If i pause the avi file means, just i read that frame data.

    Is possible?
    Regards,

    SaraswathiSrinath

  4. #4
    Join Date
    Nov 2011
    Location
    India
    Posts
    333

    Re: CAnimateCtrl

    Hi,

    I achived my goal. But, one small complication,

    Using this link Extracting AVI Frames, i was created my project and done my work.

    I was loaded SAMPLE.AVI file into my project and extract avi video into video frames , then i choosen single frame and convert that frame into RGB data. This is my requirement and i was done.
    Note : Download Sample.avi inside RawAVIStream.zip

    But, I have only .MOV file.
    Using mov to avi convertor, i was convert my .MOV(no audio) file into .AVI file.
    Then i was loaded the converted avi file into my project. It was getting error like
    c:\windows\system32\mfc110d.dll
    line 325: ASSERT(pDIB != NULL);


    Code:
    //Get the first frame
        int index=0;
        for (int i=iFirstFrame; i<iNumFrames; i++)
        {
            index= i-iFirstFrame;       
            BYTE* pDIB = (BYTE*) AVIStreamGetFrame(pFrame, index);   //Here pDIB is NULL 
            CreateFromPackedDIBPointer(pDIB, index);
        }
    The above code return pDIB = Null for my .avi file.

    How can i solve this problem? pls help me.
    Regards,

    SaraswathiSrinath

  5. #5
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: CAnimateCtrl

    There aren't a whole lot of tools out there that can create an AVI in the specific format that CAnimate control needs. (and it's VERY picky about it).

    You will need to find creator/conversion tools that explicitely support the format.

    Alternatively, create your own animation control. I built one based on animating GIFs for one project because the graphic artists found it impossible to create an avi that properly worked with CAnimateCtrl.

  6. #6
    Join Date
    Nov 2011
    Location
    India
    Posts
    333

    Re: CAnimateCtrl

    Thanks Mr.OReubens.

    I tried to make it in MFC. But i can't finally i found a tool Image Grap.

    It will extract images from all kind of video files avi, mpeg, wmv, mts and etc.

    I used this tool.
    Regards,

    SaraswathiSrinath

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured