Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Re: LEAD MPEG4 Decoder
Started by familyguyfan at 08-18-2008 7:30. Topic has 12 replies.

Print Search « Previous Thread Next Thread »
  08-18-2008, 7:30
familyguyfan is not online. Last active: 9/2/2008 1:14:50 PM familyguyfan

Not Ranked
Joined on 08-18-2008
Posts 7
LEAD MPEG4 Decoder
Reply Quote
Hi all,
<br><br>
I've been able to play and take snapshots of a .ASF file for a long time, and I recently evaluated the MPEG4 Video Decoder so that I would be able to perform the same task for another video type (this time a .MP4). The .MP4 file plays back and snapshots without a hitch, but I'm left unable to snapshot the .ASF file...
<br><br>
Before the installation of the MPEG4 decoder, I gathered the following information regarding my .ASF file during playback:
<br><br>
Windows Media Player:<br>
Audio = G.726 32kb/s, 8kHz, Mono<br>
Video = ISO MPEG-4 VIDEO, V1
<br><br>
GSpot:<br>
Audio = Sharp G.726 Audio Codec<br>
Video = DMO:MPEG4s Decoder DMO
<br><br><br>

After the installation of the MPEG4 decoder, I gathered information for my .ASF file during playback, in exactly the same way:
<br><br>
Windows Media Player:<br>
Audio = G.726 32kb/s, 8kHz, Mono<br>
Video = ISO MPEG-4 VIDEO, V1
<br><br>
GSpot:<br>
Audio = Sharp G.726 Audio Codec<br>
Video = LEAD MPEG4 Decoder (2.0)
<br><br><br>

When snapshotting the .ASF file before everything went pear-shaped, I got a clear image of the video I was snapshotting. After, I'm only getting an empty black square where there should be an image. Could someone give me some advice on where to go with this? I need to be able to play and framegrab both my .ASF and my .MP4 (along with other file formats I'm using such as .MOV, .AVI etc...)
<br><br>
Any help will be greatly appreciated
<br><br><br>

Thank you
   Report 
  08-18-2008, 11:46
Adam Boulad is not online. Last active: 1/8/2009 3:31:15 PM Adam Boulad



Top 10 Posts
Joined on 09-16-2007
Posts 541
Re: LEAD MPEG4 Decoder
Reply Quote
Could it be that the video renderer is using a DirectDraw accelerated drawing surface? This is drawn bypassing the Windows GDI, which doesn't let screen capture functions see it.

If this is the reason, you could disable DirectDraw acceleration on your computer using the DxDiag.EXE utility. Run the utility and go to the Display tab. Click the Disable button next to DirectDraw acceleration.

Does this solve the problem?
Adam Boulad
LEADTOOLS Technical Support

   Report 
  08-19-2008, 7:22
familyguyfan is not online. Last active: 9/2/2008 1:14:50 PM familyguyfan

Not Ranked
Joined on 08-18-2008
Posts 7
Re: LEAD MPEG4 Decoder
Reply Quote
Hi! Thanks for your suggestion, unfortunately I'm getting the same exception (HRESULT: 0x80040200 from MediaDet)...

We've actually tried lowering our graphics card acceleration on the computer before (which didn't work either).

Any other suggestions?

Thank you for helping!
   Report 
  08-19-2008, 10:19
Adam Boulad is not online. Last active: 1/8/2009 3:31:15 PM Adam Boulad



Top 10 Posts
Joined on 09-16-2007
Posts 541
Re: LEAD MPEG4 Decoder
Reply Quote
What exception are you talking about exactly, and what program or function triggers it? In your previous post, you mentioned that you had video playback that gives you a black rectangle when you try to take a snapshot of. My reply was related to that point only.
Adam Boulad
LEADTOOLS Technical Support

   Report 
  08-19-2008, 12:18
familyguyfan is not online. Last active: 9/2/2008 1:14:50 PM familyguyfan

Not Ranked
Joined on 08-18-2008
Posts 7
Re: LEAD MPEG4 Decoder
Reply Quote
Sorry I wasn't clear... (MediaDet comes from: interop.DexterLib) which wraps DirectShow. For an example, look here: http://www.codeproject.com/KB/directx/picturesfrommovie.aspx

Here is a section of code we're using, it might help clear things up for you:

MediaDet mediaDet = new MediaDet();
string snapShotName = string.Empty;
string videoFullPath = _videoSourcePath;
string snapShotFullPath = _imageDestinationPath;

mediaDet.Filename = @"C:\Documents and Settings\User\Desktop\Videos\video.asf";
mediaDet.CurrentStream = 0;

try
{
mediaDet.WriteBitmapBits(_positionInFile, width, height, snapShotFullPath);
}
catch (Exception ex)
{
Response.Write(ex.Message);
Response.Write(ex.StackTrace);
}

return snapShotFullPath;
   Report 
  08-20-2008, 10:54
Adam Boulad is not online. Last active: 1/8/2009 3:31:15 PM Adam Boulad



Top 10 Posts
Joined on 09-16-2007
Posts 541
Re: LEAD MPEG4 Decoder
Reply Quote
So is this related to the screen capture issue? Or did I misunderstand the original post and you were NOT trying to do screen capture?
What I'm trying to determine is whether the problem or problems you're facing are related to any of our products, and if yes, how to check the problem here to try to find a solution. Please keep in mind that the experience of our support team in programming DirectShow is mainly tied to our own multimedia toolkit. We don't directly do much programming using DirectShow SDK (or its .NET wrapper).
Adam Boulad
LEADTOOLS Technical Support

   Report 
  08-20-2008, 11:14
familyguyfan is not online. Last active: 9/2/2008 1:14:50 PM familyguyfan

Not Ranked
Joined on 08-18-2008
Posts 7
Re: LEAD MPEG4 Decoder
Reply Quote
Sure that's understandable...

This IS an issue related to snapshotting, I'll talk you through the workflow (including the point at which it fails):

1: Install "Codec45_JVCG726E.EXE" (Sharp G.726) which enables the snapshotting of one particular video. (This is the only codec we're able to use for these videos).
2: Install "MPEG4Decoder.exe" which enables the snapshotting of another particular video but also breaks the snapshotting of the original videos that use the Sharp G.726 codec.


Is it possible that the LEAD codec is completely shunning the initial G.726 codec?
   Report 
  08-21-2008, 11:33
Adam Boulad is not online. Last active: 1/8/2009 3:31:15 PM Adam Boulad



Top 10 Posts
Joined on 09-16-2007
Posts 541
Re: LEAD MPEG4 Decoder
Reply Quote
Let me phrase it this way. You have some sort of multimedia program that needs DirectShow codecs. With one type of videos, you are using a non-LEAD codec that works well for you. For other videos, you're using our LEAD MPEG4 Decoder, which works well with that second type, but when installing it, the first non-LEAD codec stops working. Is this the case?

If yes, one possible reason is that by default, DirectShow can automatically decide which of the decoders installed to use when it needs to decompress a video stream. If multiple decoders are registered as possible choices for a certain format, it will pick one of them based on a merit system.

Since you are a DirectShow programmer, you might be able to force using a particular codec in your code, but I'm not sure if that can be done or how.
If not, sometimes changing the order of codec installation on the machine affects some multimedia programs, so try to uninstall both codecs and re-install them in a different order.

As a last resort, you could consider playing with the codecs' merit values, but this could be risky. For details on this option, see this forum post:
http://support.leadtools.com/SupportPortal/cs/forums/21611/ShowPost.aspx
Adam Boulad
LEADTOOLS Technical Support

   Report 
  08-22-2008, 11:39
familyguyfan is not online. Last active: 9/2/2008 1:14:50 PM familyguyfan

Not Ranked
Joined on 08-18-2008
Posts 7
Re: LEAD MPEG4 Decoder
Reply Quote
Thanks for your continued support!

You've summarised my problem accurately, I'm going to have a look into the merit system but I'm pretty sure I've tried reordering the installations of the codecs. I'll confirm this, but I might be back!

Many thanks


Rob
   Report 
  08-27-2008, 10:55
familyguyfan is not online. Last active: 9/2/2008 1:14:50 PM familyguyfan

Not Ranked
Joined on 08-18-2008
Posts 7
Re: LEAD MPEG4 Decoder
Reply Quote
Hi again,

I've yet to test the reordering of the installation, but I've come up against a pretty nasty bug during testing...

When using the LEAD MPEG4 Decoder (2), I can only take snapshots of the first frame, no matter what position I request a snap shot from!

Any ideas?

Sorry to bug you again!
   Report 
  08-28-2008, 7:56
Adam Boulad is not online. Last active: 1/8/2009 3:31:15 PM Adam Boulad



Top 10 Posts
Joined on 09-16-2007
Posts 541
Re: LEAD MPEG4 Decoder
Reply Quote
MPEG4 compression uses an "inter-frame" algorithm. This means a key frame is compressed and stored, then a group of subsequent frames are not stored complete, but the differences from the key frame are calculated, compressed and stored. This means arbitrary seeking to a random frame is not always possible, but this depends also on the application and how it tries to seek.

Please note that I still don't know what you mean exactly by "take snapshot". Is this a feature in your software? If yes, how does it work exactly?


Adam Boulad
LEADTOOLS Technical Support

   Report 
  08-28-2008, 13:15
familyguyfan is not online. Last active: 9/2/2008 1:14:50 PM familyguyfan

Not Ranked
Joined on 08-18-2008
Posts 7
Re: LEAD MPEG4 Decoder
Reply Quote
Hi, sorry for being unclear...

I'm referring to "snapshots" in the context of creating a Bitmap image from a frame at a specific position in a video file.

That's what I was worried about... The ffdshow codecs/filters I'm using all for "snapshots" to be taken anywhere within a video file, after the installation of the MPEG4 Decoder, the videos that were once snapshotting successfully, can only have their first frame shapshotted...

Sorry for my continued jargon!

Here is a typical call to MediaDet:

//axWMPlayer is the Windows Media Player object
//I'm using to play the video files.
WriteGrabimage(
axWMPlayer.Ctlcontrols.currentPosition,
axWMPlayer.currentMedia.sourceURL, axWMPlayer.currentMedia.imageSourceHeight, axWMPlayer.currentMedia.imageSourceWidth);


Thanks
   Report 
  08-31-2008, 10:09
Adam Boulad is not online. Last active: 1/8/2009 3:31:15 PM Adam Boulad



Top 10 Posts
Joined on 09-16-2007
Posts 541
Re: LEAD MPEG4 Decoder
Reply Quote
I'm afraid since this problem only happens in your own project, I will not be able to suggest any solution for it.
If you have any other clues that indicate the problem is caused by our codec, please send us the details and we will investigate them. An example of other clues could be a common multimedia application that has a similar problem with our codec, but not with other codecs.


Adam Boulad
LEADTOOLS Technical Support

   Report 
Post
LEAD Support Fo... » Developer » Multimedia » Re: LEAD MPEG4 Decoder

Powered by Community Server, by Telligent Systems