Note that there are some explanatory texts on larger screens.

plurals
  1. POC++ : What's the easiest library to open video file
    text
    copied!<p>I would like to open a small video file and map every frames in memory (to apply some custom filter). I don't want to handle the video codec, I would rather let the library handle that for me.</p> <p>I've tried to use Direct Show with the SampleGrabber filter (using this sample <a href="http://msdn.microsoft.com/en-us/library/ms787867(VS.85).aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/ms787867(VS.85).aspx</a>), but I only managed to grab some frames (not every frames!). I'm quite new in video software programming, maybe I'm not using the best library, or I'm doing it wrong. </p> <p>I've pasted a part of my code (mainly a modified copy/paste from the msdn example), unfortunately it doesn't grabb the 25 first frames as expected...</p> <pre><code>[...] hr = pGrabber-&gt;SetOneShot(TRUE); hr = pGrabber-&gt;SetBufferSamples(TRUE); pControl-&gt;Run(); // Run the graph. pEvent-&gt;WaitForCompletion(INFINITE, &amp;evCode); // Wait till it's done. // Find the required buffer size. long cbBuffer = 0; hr = pGrabber-&gt;GetCurrentBuffer(&amp;cbBuffer, NULL); for( int i = 0 ; i &lt; 25 ; ++i ) { pControl-&gt;Run(); // Run the graph. pEvent-&gt;WaitForCompletion(INFINITE, &amp;evCode); // Wait till it's done. char *pBuffer = new char[cbBuffer]; hr = pGrabber-&gt;GetCurrentBuffer(&amp;cbBuffer, (long*)pBuffer); AM_MEDIA_TYPE mt; hr = pGrabber-&gt;GetConnectedMediaType(&amp;mt); VIDEOINFOHEADER *pVih; pVih = (VIDEOINFOHEADER*)mt.pbFormat; [...] } [...] </code></pre> <p>Is there somebody, with video software experience, who can advise me about code or other simpler library?</p> <p>Thanks</p> <p>Edit: Msdn links seems not to work (<a href="http://stackoverflow.uservoice.com/pages/general/suggestions/19963" rel="noreferrer">see the bug</a>)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload