As stated in http://msdn.microsoft.com/en-us/library/dd377544(VS.85).aspx, ISampleGrabber accepts only videos with VIDEOINFOHEADER structure, but not VIDEOINFOHEADER2. Is there any alternative to ISampleGrabber, or any example code for a filter that would do similar job? I have tried with IBasicVide, but it renders video on the screen which I would like to avoid. Thanks.
You have to write your own filter for this goal.
There is already a sample in the SDK. See the dump filter sample.
If the renderer sample is too complex, use a transform filter and insert a NullRenderer behind this filter.
Related
Is it possible to use the flow logic or file filtering in Transloadit to convert a PNG to a JPG if the uploaded file is not already a JPG, but skip the step and continue with the other processing steps otherwise?
From what I can see from the docs, you can only halt an assembly if a condition is or isnt met..
Thanks!
You can use the /file/filter robot to pass :original files only to an /image/resize step if it matches your conditions.
You should disable error_on_decline to make this filtering seamless.
Here's more information on the /file/filter robot and here are all the variables you can use to filter by.
Looks like you could use either ${file.ext} or maybe ${file.mime}
Hope this helps!
Core Image provides two filters, CILightenBlendMode and CIMaximumCompositing, which both appear to use the formula outputColorComponent = max(backgroundColorComponent, foregroundColorComponent). And from their respective descriptions in the Core Image Filter Reference, it sounds like these two filters do exactly the same thing.
What's the difference between these two filters? Why isn't there just a single filter?
(The same question applies also to the CIDarkenBlendMode and CIMinimumCompositing pair of filters.)
I'm looking for a way to specify that the images returned by the Google Custom Search API have a square format.
I've tried tbs=iar:s (because I've read Using the Custom Search API (REST JSON) to search for square images), but it doesn't work.
Have you an idea please ?
The problem is that tbs query parameter only applies to a regular image search on Google. For example, if you wanted to search for cat pictures with a square aspect ratio, you could do a search like this:
http://images.google.com/?q=cat&tbs=iar:s
But the Custom Search API uses a completely different set of parameters. The full list of supported parameters is shown in the REST documentation.
Some of the tbs queries do have equivalents. For example:
tbs=ic:gray translates to imgColorType=gray
tbs=isz:m translates to imgSize=medium
tbs=itp:clipart translates to imgType=clipart
But sadly there appears to be no equivalent for the iar aspect ratio filter. I tried guessing a few queries (things like imgAspectRatio=square) in case there was an undocumented parameter, but didn't have any luck with that.
The best alternative I could suggest is using imgSize=icon. This tends to return images that have a square aspect ratio, but with the unfortunate side effect that the images also tend to be rather small (the largest size I've seen returned is 256x256). Depending on your needs though, this may be good enough.
I apologise if this isn't particularly useful to you. I'm not just trying to grab the bounty on this question, so feel free not to vote this answer up. I just wanted to let you know what I had found in case it was of some help.
You can simply use both tbs=isz:l,iar:s that way it will return only large images with same aspect ration.
DMO seems to be used for replacing DirectShow transform filter. Some documents say there could be a DMO without input streams. But how is it supposed to work? If there is no input stream, in function IMediaObject::CheckInputType what should be written?
You can implement an inputless DMO, e.g. let's suppose the DMO generates output internally. Noone will call CheckInputType because no inputs exist, this is fine (your CheckInputType body will be empty and e.g. returning E_NOTIMPL).
However you should rather step back and explain what it is for. No, DMOs are not a replacement for DirectShow filters. DMOs can be mapped into DirectShow filter space, through DMO Wrapper Filter, however the latter does not support DMOs with no inputs so your DMO is going to be useless for DirectShow pipeline.
To create a custom DirectShow source, you need to implement full filter.
I'd like to create a Base16 encoder and decoder for Lion's new Security.framework to complement kSecBase32Encoding and kSecBase64Encoding. Apple's documentation shows how to write a custom transform (Caesar cipher) using SecTransformRegister. As far as I can tell, custom transforms registered this way have to operate symmetrically on the data and can't be used to encode and decode data differently. Does anyone know if writing a custom encoder/decoder is possible, and if so, how?
I don't see a way to tie custom encoders into SecEncodeTransformCreate(), which is what kSecBase32Encoding and the others are based on. But it's easy to create a transform that accepts a "encoding" bool and makes use of that to decide whether to encode or decode. In the CaesarTransform example, they attach an attribute called key with SecTransformSetAttribute(). You'd do the same thing, but with a bool encode.
And of course you could just create an encoding transform and a decoding transform.