Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Help: Media seek in directshow

Help: Media seek in directshow

Scheduled Pinned Locked Moved C / C++ / MFC
databasehelpquestionworkspace
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    liur17
    wrote on last edited by
    #1

    I wrote a program to convert mpeg file to avi in directshow, now the conversion is OK, but I can't find out a method to seek the source media, I want to seek to a given point in source media before the conversion begin. In other words, I want to convert a segment of mpeg file to avi file. The structure of my program is following: 1. Read source mpeg file by using pGraph->AddSourceFilter(...); 2. Init IMediaSeeking, IMediaControl, etc by query pGraph; 3. Setup output avi file and init pMux by using pBuilder->SetOutputFileName(...); 4. Create Mpeg splitter and Mpeg Decoder then add them to pGraph; 5. Connect all filters by using pBuilder->RenderStream(....); 6. Start conversion by using pMediaControl->run(). now the conversion of whole mpeg file is OK, but I can't seek the source media, the pMediaSeeking->SetPositions(...) and GetDuration() function always return fail. I also tried to seek media by pMux but failed. someone can give me instruction to resolve it? thanks in advance.

    M 1 Reply Last reply
    0
    • L liur17

      I wrote a program to convert mpeg file to avi in directshow, now the conversion is OK, but I can't find out a method to seek the source media, I want to seek to a given point in source media before the conversion begin. In other words, I want to convert a segment of mpeg file to avi file. The structure of my program is following: 1. Read source mpeg file by using pGraph->AddSourceFilter(...); 2. Init IMediaSeeking, IMediaControl, etc by query pGraph; 3. Setup output avi file and init pMux by using pBuilder->SetOutputFileName(...); 4. Create Mpeg splitter and Mpeg Decoder then add them to pGraph; 5. Connect all filters by using pBuilder->RenderStream(....); 6. Start conversion by using pMediaControl->run(). now the conversion of whole mpeg file is OK, but I can't seek the source media, the pMediaSeeking->SetPositions(...) and GetDuration() function always return fail. I also tried to seek media by pMux but failed. someone can give me instruction to resolve it? thanks in advance.

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      Did you get my response to your email (maybe your email filter ate it or i didn't help you any :))? It was something like: I’m not sure if you can seek in that type of graph. If you follow the guidelines at Seeking the Filter Graph[^] you’ll find out if it works or not Mark

      Mark Salsbery Microsoft MVP - Visual C++ This episode brought to you by the number 3

      L 1 Reply Last reply
      0
      • M Mark Salsbery

        Did you get my response to your email (maybe your email filter ate it or i didn't help you any :))? It was something like: I’m not sure if you can seek in that type of graph. If you follow the guidelines at Seeking the Filter Graph[^] you’ll find out if it works or not Mark

        Mark Salsbery Microsoft MVP - Visual C++ This episode brought to you by the number 3

        L Offline
        L Offline
        liur17
        wrote on last edited by
        #3

        Thank you very much. I checked my mailbox and not found your mail.(maybe the antivirus software ate it:(,), however after I follow your instruction to read the "Seeking the Filter Graph" in MSDN, I still can't find out the answer, It only tell me how to seek the media for rendering the media on screen, I also use pMediaSeeking->GetCapabilities(...) to check if it supports seeking, it return S_OK.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups