Skip to main content
added 3 characters in body
Source Link
Alexey Popkov
  • 62.3k
  • 7
  • 154
  • 375

I asked here for a solution how single video images can be extracted very fast from avi files.

Piotr Wendykier gave a solution for versionMathematica 11.3.

Now I'm using Mathematica 12 and his solution does not work anymore.

Why

i = MediaTools`Private`$MFReadNextFrame[]

does not readingread an image out of the video as in version 11.3?

In[1]:= file = 
 URLSave["http://mirrors.standaloneinstaller.com/video-sample/\
Panasonic_HDC_TM_700_P_50i.avi", "c:\\tmp\\sample.avi"]

Out[1]= "c:\\tmp\\sample.avi"

In[2]:= Needs["MediaTools`"]

In[3]:= MediaTools`Private`$MFInitReader[file]

Out[3]= MediaTools`Private`$MFInitReader["c:\\tmp\\sample.avi"]

In[4]:= AbsoluteTiming[i = MediaTools`Private`$MFReadNextFrame[];]

Out[4]= {1.9*10^-6, Null}

In[5]:= MediaTools`Private`$MFFinalizeReader[]

Out[5]= MediaTools`Private`$MFFinalizeReader[]

In[6]:= ImageDimensions[i]

During evaluation of In[6]:= ImageDimensions::imginv: Expecting an image or graphics instead of MediaTools`Private`$MFReadNextFrame[].

Out[6]= ImageDimensions[MediaTools`Private`$MFReadNextFrame[]]

I asked here for a solution how single video images can be extracted very fast from avi files.

Piotr Wendykier gave a solution for version 11.3.

Now I'm using Mathematica 12 and his solution does not work anymore.

Why

i = MediaTools`Private`$MFReadNextFrame[]

does not reading an image out of the video as in version 11.3?

In[1]:= file = 
 URLSave["http://mirrors.standaloneinstaller.com/video-sample/\
Panasonic_HDC_TM_700_P_50i.avi", "c:\\tmp\\sample.avi"]

Out[1]= "c:\\tmp\\sample.avi"

In[2]:= Needs["MediaTools`"]

In[3]:= MediaTools`Private`$MFInitReader[file]

Out[3]= MediaTools`Private`$MFInitReader["c:\\tmp\\sample.avi"]

In[4]:= AbsoluteTiming[i = MediaTools`Private`$MFReadNextFrame[];]

Out[4]= {1.9*10^-6, Null}

In[5]:= MediaTools`Private`$MFFinalizeReader[]

Out[5]= MediaTools`Private`$MFFinalizeReader[]

In[6]:= ImageDimensions[i]

During evaluation of In[6]:= ImageDimensions::imginv: Expecting an image or graphics instead of MediaTools`Private`$MFReadNextFrame[].

Out[6]= ImageDimensions[MediaTools`Private`$MFReadNextFrame[]]

I asked here for a solution how single video images can be extracted very fast from avi files.

Piotr Wendykier gave a solution for Mathematica 11.3.

Now I'm using Mathematica 12 and his solution does not work anymore.

Why

i = MediaTools`Private`$MFReadNextFrame[]

does not read an image out of the video as in version 11.3?

In[1]:= file = 
 URLSave["http://mirrors.standaloneinstaller.com/video-sample/\
Panasonic_HDC_TM_700_P_50i.avi", "c:\\tmp\\sample.avi"]

Out[1]= "c:\\tmp\\sample.avi"

In[2]:= Needs["MediaTools`"]

In[3]:= MediaTools`Private`$MFInitReader[file]

Out[3]= MediaTools`Private`$MFInitReader["c:\\tmp\\sample.avi"]

In[4]:= AbsoluteTiming[i = MediaTools`Private`$MFReadNextFrame[];]

Out[4]= {1.9*10^-6, Null}

In[5]:= MediaTools`Private`$MFFinalizeReader[]

Out[5]= MediaTools`Private`$MFFinalizeReader[]

In[6]:= ImageDimensions[i]

During evaluation of In[6]:= ImageDimensions::imginv: Expecting an image or graphics instead of MediaTools`Private`$MFReadNextFrame[].

Out[6]= ImageDimensions[MediaTools`Private`$MFReadNextFrame[]]
deleted 15 characters in body; edited tags
Source Link
Alexey Popkov
  • 62.3k
  • 7
  • 154
  • 375

I have asked here for a solution how single video images can be extracted very fast from avi files.

Piotr Wendykier gave a solution for version 11.3.

No I amNow I'm using MathematicaMathematica 12 and repeated his code, whichtsolution does not work any moreanymore.

Why is

i = MediaTools`Private`$MFReadNextFrame[]

does not reading an image out of the video as in version 11.3?

In[1]:= file = 
 URLSave["http://mirrors.standaloneinstaller.com/video-sample/\
Panasonic_HDC_TM_700_P_50i.avi", "c:\\tmp\\sample.avi"]

Out[1]= "c:\\tmp\\sample.avi"

In[2]:= Needs["MediaTools`"]

In[3]:= MediaTools`Private`$MFInitReader[file]

Out[3]= MediaTools`Private`$MFInitReader["c:\\tmp\\sample.avi"]

In[4]:= AbsoluteTiming[i = MediaTools`Private`$MFReadNextFrame[];]

Out[4]= {1.9*10^-6, Null}

In[5]:= MediaTools`Private`$MFFinalizeReader[]

Out[5]= MediaTools`Private`$MFFinalizeReader[]

In[6]:= ImageDimensions[i]

During evaluation of In[6]:= ImageDimensions::imginv: Expecting an image or graphics instead of MediaTools`Private`$MFReadNextFrame[].

Out[6]= ImageDimensions[MediaTools`Private`$MFReadNextFrame[]]

I have asked here for a solution how single video images can be extracted very fast from avi files.

Piotr Wendykier gave a solution for version 11.3.

No I am using Mathematica 12 and repeated his code, whicht does not work any more.

Why is

i = MediaTools`Private`$MFReadNextFrame[]

not reading an image out of the video as in version 11.3?

In[1]:= file = 
 URLSave["http://mirrors.standaloneinstaller.com/video-sample/\
Panasonic_HDC_TM_700_P_50i.avi", "c:\\tmp\\sample.avi"]

Out[1]= "c:\\tmp\\sample.avi"

In[2]:= Needs["MediaTools`"]

In[3]:= MediaTools`Private`$MFInitReader[file]

Out[3]= MediaTools`Private`$MFInitReader["c:\\tmp\\sample.avi"]

In[4]:= AbsoluteTiming[i = MediaTools`Private`$MFReadNextFrame[];]

Out[4]= {1.9*10^-6, Null}

In[5]:= MediaTools`Private`$MFFinalizeReader[]

Out[5]= MediaTools`Private`$MFFinalizeReader[]

In[6]:= ImageDimensions[i]

During evaluation of In[6]:= ImageDimensions::imginv: Expecting an image or graphics instead of MediaTools`Private`$MFReadNextFrame[].

Out[6]= ImageDimensions[MediaTools`Private`$MFReadNextFrame[]]

I asked here for a solution how single video images can be extracted very fast from avi files.

Piotr Wendykier gave a solution for version 11.3.

Now I'm using Mathematica 12 and his solution does not work anymore.

Why

i = MediaTools`Private`$MFReadNextFrame[]

does not reading an image out of the video as in version 11.3?

In[1]:= file = 
 URLSave["http://mirrors.standaloneinstaller.com/video-sample/\
Panasonic_HDC_TM_700_P_50i.avi", "c:\\tmp\\sample.avi"]

Out[1]= "c:\\tmp\\sample.avi"

In[2]:= Needs["MediaTools`"]

In[3]:= MediaTools`Private`$MFInitReader[file]

Out[3]= MediaTools`Private`$MFInitReader["c:\\tmp\\sample.avi"]

In[4]:= AbsoluteTiming[i = MediaTools`Private`$MFReadNextFrame[];]

Out[4]= {1.9*10^-6, Null}

In[5]:= MediaTools`Private`$MFFinalizeReader[]

Out[5]= MediaTools`Private`$MFFinalizeReader[]

In[6]:= ImageDimensions[i]

During evaluation of In[6]:= ImageDimensions::imginv: Expecting an image or graphics instead of MediaTools`Private`$MFReadNextFrame[].

Out[6]= ImageDimensions[MediaTools`Private`$MFReadNextFrame[]]
added 118 characters in body
Source Link
mrz
  • 11.8k
  • 2
  • 26
  • 85

I have asked here for a solution how single video images can be extracted very fast from avi files.

Piotr Wendykier gave a solution for version 11.3.

No I am using Mathematica 12 and repeated his code, whicht does not work any more.

Why is i = MediaToolsPrivate$MFReadNextFrame[] not reading an image out of the video as in version 11.3? Why is

i = MediaTools`Private`$MFReadNextFrame[]

not reading an image out of the video as in version 11.3?

In[1]:= file = 
 URLSave["http://mirrors.standaloneinstaller.com/video-sample/\
Panasonic_HDC_TM_700_P_50i.avi", "c:\\tmp\\sample.avi"]

Out[1]= "c:\\tmp\\sample.avi"

In[2]:= Needs["MediaTools`"]

In[3]:= MediaTools`Private`$MFInitReader[file]

Out[3]= MediaTools`Private`$MFInitReader["c:\\tmp\\sample.avi"]

In[4]:= AbsoluteTiming[i = MediaTools`Private`$MFReadNextFrame[];]

Out[4]= {1.9*10^-6, Null}

In[5]:= MediaTools`Private`$MFFinalizeReader[]

Out[5]= MediaTools`Private`$MFFinalizeReader[]

In[6]:= ImageDimensions[i]

During evaluation of In[6]:= ImageDimensions::imginv: Expecting an image or graphics instead of MediaTools`Private`$MFReadNextFrame[].

Out[6]= ImageDimensions[MediaTools`Private`$MFReadNextFrame[]]

I have asked here for a solution how single video images can be extracted very fast from avi files.

Piotr Wendykier gave a solution for version 11.3.

No I am using Mathematica 12 and repeated his code, whicht does not work any more.

Why is i = MediaToolsPrivate$MFReadNextFrame[] not reading an image out of the video as in version 11.3?

In[1]:= file = 
 URLSave["http://mirrors.standaloneinstaller.com/video-sample/\
Panasonic_HDC_TM_700_P_50i.avi", "c:\\tmp\\sample.avi"]

Out[1]= "c:\\tmp\\sample.avi"

In[2]:= Needs["MediaTools`"]

In[3]:= MediaTools`Private`$MFInitReader[file]

Out[3]= MediaTools`Private`$MFInitReader["c:\\tmp\\sample.avi"]

In[4]:= AbsoluteTiming[i = MediaTools`Private`$MFReadNextFrame[];]

Out[4]= {1.9*10^-6, Null}

In[5]:= MediaTools`Private`$MFFinalizeReader[]

Out[5]= MediaTools`Private`$MFFinalizeReader[]

In[6]:= ImageDimensions[i]

During evaluation of In[6]:= ImageDimensions::imginv: Expecting an image or graphics instead of MediaTools`Private`$MFReadNextFrame[].

Out[6]= ImageDimensions[MediaTools`Private`$MFReadNextFrame[]]

I have asked here for a solution how single video images can be extracted very fast from avi files.

Piotr Wendykier gave a solution for version 11.3.

No I am using Mathematica 12 and repeated his code, whicht does not work any more.

Why is

i = MediaTools`Private`$MFReadNextFrame[]

not reading an image out of the video as in version 11.3?

In[1]:= file = 
 URLSave["http://mirrors.standaloneinstaller.com/video-sample/\
Panasonic_HDC_TM_700_P_50i.avi", "c:\\tmp\\sample.avi"]

Out[1]= "c:\\tmp\\sample.avi"

In[2]:= Needs["MediaTools`"]

In[3]:= MediaTools`Private`$MFInitReader[file]

Out[3]= MediaTools`Private`$MFInitReader["c:\\tmp\\sample.avi"]

In[4]:= AbsoluteTiming[i = MediaTools`Private`$MFReadNextFrame[];]

Out[4]= {1.9*10^-6, Null}

In[5]:= MediaTools`Private`$MFFinalizeReader[]

Out[5]= MediaTools`Private`$MFFinalizeReader[]

In[6]:= ImageDimensions[i]

During evaluation of In[6]:= ImageDimensions::imginv: Expecting an image or graphics instead of MediaTools`Private`$MFReadNextFrame[].

Out[6]= ImageDimensions[MediaTools`Private`$MFReadNextFrame[]]
added 118 characters in body
Source Link
mrz
  • 11.8k
  • 2
  • 26
  • 85
Loading
Source Link
mrz
  • 11.8k
  • 2
  • 26
  • 85
Loading