CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2011
    Location
    India
    Posts
    333

    Extract AVI Frames

    Hi

    i'm using this code - Extracting AVI Frames.

    Problem is, code is not working for all avi files. What is the reason?
    Regards,

    SaraswathiSrinath

  2. #2
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: Extract AVI Frames

    You can't be serious. How could we know what the reason is? You have to provide more details about the files that work fine and the files that do not.

    First thing you should find out if the problem files are playable at all. Second, if those are able to rewind/fastforward.
    Best regards,
    Igor

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

    Re: Extract AVI Frames

    Quote Originally Posted by Igor Vartanov View Post
    You can't be serious. How could we know what the reason is? You have to provide more details about the files that work fine and the files that do not.

    First thing you should find out if the problem files are playable at all. Second, if those are able to rewind/fastforward.
    i checked files are playable. i tested with small avi files. so both files are not able to rewind/fastforward.

    Kindly find the attached project.

    i run my project using this file AVI Video Files, . Working good,
    Code:
    Dimention: 320*240
    Length: 102 frames
    Max bytes per second : 230032
    samples per second : 14
    streams: 1
    file type: 8055788
    clock.avi. Working good, got 12 frames(bmp files).
    Code:
    Dimention: 321x321
    Length: 12 frames
    Max bytes per second : 7100 
    samples per second : 1
    streams: 2
    file type: 2681620
    But some video files running properly. when i extract this by frames then the
    msg display
    Code:
    Dimention: 1280*720
    Length: 24 frames
    Max bytes per second 4976640
    samples per second : 24
    streams: 2
    file type: 4189556
    video taken by camera,
    Code:
    Dimention: 320x120
    Length: 81frames
    Max bytes per second : 0
    samples per second : 29
    streams: 1
    file type: 18214892
    both files are not running. break point at below lines,
    Code:
    BOOL CreateFromPackedDIBPointer(LPBYTE pDIB, int iFrame)
    {
        ASSERT(pDIB!=NULL);
    }
    Attached Files Attached Files
    Regards,

    SaraswathiSrinath

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

    Re: Extract AVI Frames

    Code:
    PGETFRAME pFrame;
        pFrame = AVIStreamGetFrameOpen(pStream, 
               NULL/*(BITMAPINFOHEADER*) AVIGETFRAMEF_BESTDISPLAYFMT*/ /*&bih*/);
        if(!pFrame ) MessageBox(0, "AVIStreamGetFrameOpen() Function Failed.", "", MB_OK);
    AVIStreamGetFrameOpen() - Returns a GetFrame object that can be used with the AVIStreamGetFrame function. If the system cannot find a decompressor that can decompress the stream to the given format, or to any RGB format, the function returns NULL.

    Here AVIStreamGetFrameOpen function returns NULL. so only i'm getting error. How can i solve this issue.

    its true. downloading the latest xvid codec, recover from this problem?
    Last edited by saraswathisrinath; September 5th, 2015 at 04:04 AM.
    Regards,

    SaraswathiSrinath

  5. #5
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: Extract AVI Frames

    You need to go some other way. Using IMediaDet interface maybe, or creating your own directshow filter. Or switching to other technology like ffmpeg, gstreamer, opencv, etc. Will depend on your goals and requirements.
    Best regards,
    Igor

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