Hi all, I'm new to DirectShow so please bare with me. I'm trying to get a video file's screen size. What's the correct way to query for this? Thanks Tom
On Fri, 08 Aug 2008 11:33:19 +0200, Tom wrote: > Hi all, I'm new to DirectShow so please bare with me. That's a bit presumptuous ;) (you meant "bear," not "bare") > I'm trying to get a video file's screen size. Do you mean the dimensions of the video? > What's the correct way to query for this? It depends on the type of video. Some work with IMediaDet (samples of its use are in the docs and SDK). Some you have to render the graph and query the output pin on the video decoder. -- Please read this before replying: 1. Dshow & posting help: http://tmhare.mvps.org/help.htm 2. Trim & respond inline (please don't top post or snip everything) 3. Benefit others: follow up if you are helped or you found a solution
The March Hare [MVP] wrote: > On Fri, 08 Aug 2008 11:33:19 +0200, Tom wrote: > >> Hi all, I'm new to DirectShow so please bare with me. > > That's a bit presumptuous ;) (you meant "bear," not "bare") > >> I'm trying to get a video file's screen size. > > Do you mean the dimensions of the video? > >> What's the correct way to query for this? > > It depends on the type of video. Some work with IMediaDet (samples of its > use are in the docs and SDK). Some you have to render the graph and query > the output pin on the video decoder. LOL I'm sorry, of course I meant "bear" !!! :D Yes I mean the actual video size and I think I'll have a look at: "Some you have to render the graph and query the output pin on the video decoder." first! Thanks Tom
On Sat, 09 Aug 2008 14:18:59 +0200, Tom wrote: > LOL I'm sorry, of course I meant "bear" !!! :D We programmers sometimes get too dependent on the compiler to catch our errors :) > Yes I mean the actual video size and I think I'll have a look at: > "Some you have to render the graph and query the output pin on the video > decoder." first! Some other things to keep in mind: - some video files may have the metadata in the header and the dimensions can be extracted more quickly that way (WMV sometimes, IIRC) - some video types do not have square pixels so you need to be careful whether you are getting the native resolution or adjusted resolution (example: NTSC DV Video is 740x480 native for both 4:3 and 16:9 output; the VMR9 will correct the aspect ratio based on information in the media type from the DV Video Decoder's output pin which uses VideoInfoHeader2) - there is no universal solution :( -- Please read this before replying: 1. Dshow & posting help: http://tmhare.mvps.org/help.htm 2. Trim & respond inline (please don't top post or snip everything) 3. Benefit others: follow up if you are helped or you found a solution