Thumbnail from Video file

  • Thread starter Thread starter mc
  • Start date Start date
M

mc

My Problem:
I need some C# code which creates a thumbnail from a video. The only
catch is that I need to run it on a shared host (web server) which will
only support assemblies that have the Allow Partially Trusted Callers
(APTCA) attribute.

Solution background:
I have successfully wrapped the qedit.dll using the tlbimp.exe
application, this enables me to create a strong named assembly however
there appears to be no way of specifying the APTCA attribute.

The Detail:
I have implemented a HttpHandler which when the suffix ".thumb" is
appended to an image returns a Thumbnail of that image to the browser, I
have extended this to include wmv files, The Image thumbnails run ok at
either trust level however as the assembly I have used does not support
the APTCA attribute attempts to create a thumbnail for a video cause the
error "System.Security.SecurityException: That assembly does not allow
partially trusted callers."

Question:
Does anyone have any solutions to add the APTCA attribute to my interop
assembly, or other assembly which may fit the bill?

I'm on a shared host so I'm not able to make any reconfigurations of the
live server.

TIA


MC
 
Hi,

I'm afraid that there is a known limitation on this. We cannot add
attributes to wrapped assemblies generated with tlbimp.exe. In other word,
you shouldn't be able to run it within ASP.net if you do not modify the web
application's trust level.

You can also check manually generate the thumbnail through the
IMediaDet::WriteBitmapBits API. However I assume this may also require the
ASP.net application executing under full trust to make the call be
successful. If you would give it a try, please refer to the following
chapters in the SDK:

IMediaDet Interface
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directshow/
htm/imediadetinterface.asp

Grabbing a Poster Frame
http://msdn2.microsoft.com/en-us/library/ms783752.aspx

Thanks.

Sincerely,

WenJun Zhang

Microsoft Online Community Support

==================================================

Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at:

http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
As I understand it I was already using the "IMediaDet::WriteBitmapBits"
interface, I had wrapped the qedit.dll with tlbimp to get it strongly
named.

Is there any other way to have refrenced this API (using string naming
and the APTCA) without using tlbimp?

are there any Third party components which could help me perform this step?
 
Hi,

Sure, you can manually create the wrapper dll and add attributes to it
without using tlbimp. Please refer to the following MSDN articles:

How to: Create Primary Interop Assemblies Manually
http://msdn2.microsoft.com/en-gb/library/1w557csx.aspx

How to: Create Wrappers Manually
http://msdn2.microsoft.com/en-gb/library/x8fbsf00.aspx

Hope the info helps. If you meet any problem in the process, you can post a
new thread to our interop newsgroup for detailed assistance:

microsoft.public.dotnet.framework.interop

Have a good day.

Sincerely,

WenJun Zhang

Microsoft Online Community Support

==================================================

Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at:

http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top