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. Other Discussions
  3. Article Writing
  4. USB camera capture code!! (DirectShow)

USB camera capture code!! (DirectShow)

Scheduled Pinned Locked Moved Article Writing
data-structurestutorial
2 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.
  • K Offline
    K Offline
    Kim Sung Gyoo
    wrote on last edited by
    #1

    I'm writing an USB camera-capture program using DirectShow. I've succeeded previewing and writing the captured stream to an AVI file. But the written file is very slow because it isn't compressed. I don't know how to add a compression filter into the capture graph. Please show me any code about capture program.

    P 1 Reply Last reply
    0
    • K Kim Sung Gyoo

      I'm writing an USB camera-capture program using DirectShow. I've succeeded previewing and writing the captured stream to an AVI file. But the written file is very slow because it isn't compressed. I don't know how to add a compression filter into the capture graph. Please show me any code about capture program.

      P Offline
      P Offline
      Paul A Howes
      wrote on last edited by
      #2

      Web-cams generally use compression over the USB connection, but the drivers do the decompression for you. When you send video to another person through Netmeeting (or any other video conferencing program) it compresses the video stream in another format. As you would like to do something similar yourself, you will need to obtain a pointer to the IFilterGraph or IGraphBuilder interface exposed by the graph doing the capture, then insert and connect the "Infinite Tee Filter" just before the render filter to get a copy of the video stream. Then, connect the "ASF Writer Filter" to the Tee, which will generate the output file for you. Read through the DirectShow section of the Platform SDK, and look at the sample files. A lot of the code is already there for you to use. -- Paul "I drank... WHAT?"

      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