Menu

Read Test and Write Test fail on XP32

Help
2009-03-18
2013-02-21
  • Jochen Deibele

    Jochen Deibele - 2009-03-18

    Hi!

    Thank you for your toolbox, this seems to be extremely useful.
    However I have problems with some of the codecs and the testsuite doesn't run either.
    Installed the win-720 binary package on a 32Bit XP with Matlab 2008b.

    - running testall results in (see [1] below). It fails in one of the doMultiFullReadTest
    - running the write test on DirectShow fails also. (see[2] below).
    - if I write a test script on my own which tries all codecs (from codecs = videoWriter([],'codecs');) I'm able to use some but not all. Of course I can't use the ones I wanted to use ;-)

    Does somebody know what I'm doing wrong?

    Thank you in advance!
    Jochen

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    [1]
      testDirectShow...
        standardTestBattery...
          readTests...
            >>> doPreciseSeekTests('numbers.uncompressed.avi',...)
              >>> doFullRead('numbers.uncompressed.avi',...)
              <<< doFullRead('numbers.uncompressed.avi',...)
            <<< doPreciseSeekTests('numbers.uncompressed.avi',...)
            >>> doPreciseSeekTests('numbers.wmv3.avi',...)
              >>> doFullRead('numbers.wmv3.avi',...)
              <<< doFullRead('numbers.wmv3.avi',...)
            <<< doPreciseSeekTests('numbers.wmv3.avi',...)
            doMultiFullReadTestOnAllLoadables...
              >>> doMultiFullReadTest('intersection147.25fps.xvid.avi',...)
                >>> doFullRead('intersection147.25fps.xvid.avi',...)
                <<< doFullRead('intersection147.25fps.xvid.avi',...)
    ??? Error using ==> vrassert at 25
    ASSERT FAILED: any(images(:,:,1) ~= images(:,:,2))

    Error in ==> doMultiFullReadTest at 24
      vrassert any(images(:,:,1) ~= images(:,:,2));

    Error in ==> doMultiFullReadTestOnAllLoadables at 22
      doMultiFullReadTest(loadables{i}, varargin{:});

    Error in ==> readTests at 37
    doMultiFullReadTestOnAllLoadables(plugin);

    Error in ==> standardTestBattery at 16
    readTests(plugin);

    Error in ==> testDirectShow at 16
    standardTestBattery('DirectShow')

    Error in ==> testAll at 32
      testDirectShow;

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%

     
    • Gerald Dalley

      Gerald Dalley - 2009-03-18

      Try typing

      dbstop error

      then re-run the tests.  When the assertion is raised, display the two images:

      figure; imshow(images(:,:,1)); figure; imshow(images(:,:,2));

      what frame number shows up on both of them?

       
    • Jochen Deibele

      Jochen Deibele - 2009-03-18

      frame number is 0 on both.
      images(:,:,1) and (:,:,2) are equal (I subtracted them the result is just zeros), while (:,:,3) is showing a frame number 1, (:,:,4) a 2 and so forth.

      The file on the disk is OK (using another viewer).

      By the way I forgot to attach the log [2] for the writeTest error ... see below.

      Thank you for your quick response!

      [2]
      %%%%%%%%%%%%%%%%%%%%%%%%
      >> writeTests DirectShow
      writeTests...
      Warning: File
      'C:\DOCUME~1\deibele\LOCALS~1\Temp\tp018f0202_90b2_4b89_b199_32b5cdbe6382.avi'
      not found.
      > In writeTests at 75
      ??? Error using ==> videoWriter_DirectShow
      Could not connect the source, compressor, and file writer objects.

          Failed assertion : SUCCEEDED(retHresultAssert = builder->RenderStream( 0,
          &MEDIATYPE_Video, (IPin*)source->getPin(), compressor, renderer))
      Failed test: builder->RenderStream( NULL, &MEDIATYPE_Video,
      (IPin*)source->getPin(), compressor, renderer)
      HRESULT = 0x80004005.  Unspecified error      Function       : void __thiscall
      VideoIO::DirectShowOVideo::connectFiltergraphIfNeeded(void)
            File           : DirectShowOVideo.cpp
            Line           : 1096

      Error in ==> videoWriter.addframe>addSingleDataFrame at 185
      feval(vw.plugin, 'addframe', vw.handle, img);

      Error in ==> videoWriter.addframe at 144
          addSingleDataFrame(vw, frame);

      Error in ==> writeTests at 52
          addframe(vw, frame);

      76    rethrow(e);
      K>>
      %%%%%%%%%%%%%%%%%%%%%%%%

       
      • Gerald Dalley

        Gerald Dalley - 2009-03-18

        [1] Are you using the divx decoder?  If so, see the FAQ question titled

        "I am using the DivX decoder on Windows and all of the frames are off by one position."

        in FAQ.txt.

        [2] writeTests uses the default codec, which is generally the last one that you attempted to use.  Try adding
           
            ,'codec','NONE'

        to all of the videoWriter calls in writeTests.m.  If that resolves it, I may add it into the official version (default codecs for DirectShow are a new feature in videoIO and the kinks are still being worked out).

        [3] What exact codecs are you trying to use, but aren't working?

         
        • Jochen Deibele

          Jochen Deibele - 2009-03-19

          [1]

          That did the trick - now the readtest works out properly. Sorry, i wasn't aware that I'm using the divX decoder ...

          There is just some messages that this or that file is not fully compatible or the codec is not installed.
          However there's also one message which is perhaps interesting:
          ...doMultiFullReadTestOnAllLoadables
          Successfully caught backend error: Error using ==> videoReader_DirectShow
                Data type mismatch:  expected mxDOUBLE_CLASS, but a string "abcdef" was found instead.    Function: double __cdecl VideoIO::mat2scalar<double>(const class VideoIO::MatArray *)
                    File    : c:\users\dalleyg\documents\projects\videoio\trunk\matarray.h
                    Line    : 232
          ...readTests

          [2]
          adding 'codec','NONE' and the writeTest DirectShow finishes without error.

          [3] trying to write wmv, have installed both the newest media player (which is supposed to come with some wmv codecs) and the windows media encoder package, but the only option I get is the "WMVideo9 Encoder DMO" or WMVideo8 but they both fail. I get the following error message:

          ??? Error using ==> videoWriter_DirectShow
          Could not connect the source, compressor, and file writer objects.

              Failed assertion : SUCCEEDED(retHresultAssert = builder->RenderStream(
              0, &MEDIATYPE_Video, (IPin*)source->getPin(), compressor, renderer))
          Failed test: builder->RenderStream( NULL, &MEDIATYPE_Video,
          (IPin*)source->getPin(), compressor, renderer)
          HRESULT = 0x80040217.  No combination of intermediate filters could be found
          to make the connection.      Function       : void __thiscall
          VideoIO::DirectShowOVideo::connectFiltergraphIfNeeded(void)
                File           : DirectShowOVideo.cpp
                Line           : 1096

          Error in ==> videoWriter.addframe>addSingleDataFrame at 185
          feval(vw.plugin, 'addframe', vw.handle, img);

          Error in ==> videoWriter.addframe at 144
              addSingleDataFrame(vw, frame);

          I wrote a script which first gets all codecs and tries them one by one (see below), there are some which work and some which do not work (propably because the codec is not present) - perhaps that would be a nice add-on in the testsuite to determine which codec is available for writing (feel free to reuse)?

          btw: is there a possibility to find out which options I can pass to which codec?

          Thank you for your help!

          %%%%%%%%%%%%%%%%%%%%%
            codecs = videoWriter([],'codecs').'

          figure;
          %  codecs={codecs{20}}
            for j = 1:numel(codecs)
                try
                    fprintf('Testing codec %i "%s"  ...',j,codecs{j});
                    vw = videoWriter(sprintf('ttestvid_%i.avi',j), 'codec',codecs{j}); 
                    fprintf(' . ');
                    for i = 1:10
                      img = uint8(rand(240,320)*255);
                      addframe(vw, img); 
                      fprintf('.');
                      imshow(img); 
                      pause(0.01); 
                    end 
                    fprintf(' . ');
                    vw = close(vw); 
                    fprintf('OK\n');
                catch
                    fprintf('  FAILED\n');
                    try
                      vw = close(vw);
                    end;
                end;
            end;

           

Log in to post a comment.