Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3671094
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:26:42+00:00 2026-05-19T02:26:42+00:00

In DirectShow, a media sample has two time-related properties: its time stamp and its

  • 0

In DirectShow, a media sample has two time-related properties: its time stamp and its media time. My application needs to seek to specific frames within a video and thus requires the media time. As it seems, however, most decoder filters do not pass on this information.

I have a DirectShow graph that looks like this:

[File Source (Async.)] -> [AVI Splitter] -> [<Video decoder>] -> [My filter]

I have tried the following video decoders:

  • DMO Wrapper Filter with Mpeg4s Decoder DMO (that’s the default for MPEG-4 on my machine)
  • Xvid MPEG-4 Video Decoder
  • MainConcept (Demo) MPEG-4 Video Decoder
  • ffdshow Video Decoder (ffdshow tryouts)

Of these four, only the ffdshow decoder produces samples with media time. The other three only set the time stamp, but leave the media time empty. This seems strange as each sample they get from the AVI splitter has its media time set correctly.

Does anybody know why this happens? Is there a workaround for getting the media time that works reliably even when the application continually jumps through the video?

Edit (in response to kidjan):

Let’s assume I want to read video frame #100. With a 25fps file, this frame is 4 seconds into the video. Using the filter graph’s IMediaSeeking interface, I seek to that position. Internally, this seek request is forwarded to the splitter filter (the AVI splitter in the example). However, there are two potential problems:

  • Depending on the video format, I cannot be sure that the splitter will be able to seek precisely to frame #100. It may arrive at frame #95 instead and I will have to read 5 frames before getting the correct frame.
  • The splitter may be frame-accurate, but due to the asynchronous nature of DirectShow the next frame yielded by the decoder filter may be a relict from before the seeking. If the decoder filter uses threading, it may deliver that frame after the seek action.

In these cases, it would be helpful if the decoder filter set the samples’ media time. This way, I would know for certain which frame I receive.

What my question boils down to is basically:
How can I grab a specific video frame (by number) within a DirectShow graph?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T02:26:42+00:00Added an answer on May 19, 2026 at 2:26 am

    Not all decoders follow all the rules of DirectShow, so losing media times is one of the things you’ll have to bear with. If you’re only working with AVI files, just rely on accuracy of the splitter when using IMediaSeeking and use Stop() and Pause() of IMediaControl appropriately to ensure any cached frames are dismissed and you’ve got the frame you need. With AVI file you can get true frame rate from its header and calculate correct seek times if using media times fails.

    But for non-AVI files there may be no constant framerate and using media times for seeking doesn’t make sense there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So Windows Mobile has its DirectShow for media editing capturing and so what is
Since Windows Media Player 6.1, Windows has its' own mp3 decoder. Can I use
I am using DirectShow/VMR9 to playback a MPEG 4 video in my application. I
I have a DirectShow filter graph in my Delphi 6 application built with the
I have a DirectShow application written in Delphi 6 using the DSPACK component library.
When a pin connection problem arises in my Delphi 6 (with DSPACK) DirectShow application
I want to build application which needs to be able to capture video from
Is there a way to detect that a DirectShow filtergraph has reached the end
I am developing a new media playback application for Digital cinema. While checking the
I'm developing a DirectShow filter which has 2 input pins (1 for audio, 1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.