Kino Video Editor
 
  Kino / dvgrab
Latest News
Download
Features
Requirements
Screen Shots
  Support
User Guide
HOWTOs
FAQ
Mailing Lists
Contributed Code
  Development
Project Vision
Developer Guide
Source Code
Current Developers
Report a Bug
  Community
Success Stories
Discussion
 

I have closed the forums to new postings because there was not enough discussion, I answered nearly all the questions, and I no longer work on Kino. Please use the forums provided by your Linux distribution. Meanwhile, I will leave this open in read-only mode to serve as a knowledge base.


Subject: "programmatically extracting data from dvgrab" Previous topic | Next topic
Printer-friendly copy
Top Linux Digital Video dvgrab Topic #1054
Show all folders | View messages in linear mode

alexWed Dec-17-08 01:15 PM
Member since Dec 17th 2008
1 posts
Click to send email to this author Click to send private message to this author Click to view this author's profile Click to add this author to your buddy list
#1054, "programmatically extracting data from dvgrab"


          

Hi there,

I'm trying to get live video from a canon HV20 into a system my research group has written that does SLAM (simultaneous localization and mapping). Basically we're doing real time feature tracking so that we can do camera pose recovery, etc etc. Basically at the end we want an interface where we can say (in c++) something like GetFrame(&myframe) and get live frames from the camera.

This is already working for cameras that support the DC standard (we use libdc1394) but the HV20 is not one of those so I intend to use dvgrab. My initial thought was to get dvgrab to write to a named pipe and then have our system read from that. This raises a few questions:

1. What is the best way to read the dvgrab output from c++? Considering that some of the I/O primitives will be unavailable for named pipes (seek, etc) will things like mplayer and ffmpeg be able to read them? An example of getting dvgrab to dump to a named pipe and having mplayer render it would be really helpful.

2. What happens if our system reads more slowly that dvgrab writes? Do frames get buffered. or do we drop frames (the latter is more desirable since we don't mind missing frames but we don't want to "lag" behind the current camera position too much).

3. Would it perhaps be easier to actually integrate some of the dvgrab source code into our project and thereby avoid the need for pipes at all?

Thanks for any help / suggestions!
Alex

  

IP Printer Friendly copy | Reply | Reply with quote | Top

ddennedySun Dec-21-08 08:13 AM
Member since Jun 26th 2006
1362 posts
Click to send email to this author Click to send private message to this author Click to view this author's profile Click to add this author to your buddy list
#1056, "RE: programmatically extracting data from dvgrab"
In response to Reply #0


          

1.) Here is an example of capturing HDV and playing it with FFmpeg ffplay via pipe.

$ dvgrab -f mpeg2 - | ffplay -f mpegts -

Named pipe is something like:
$ mkfifo foo.ts
$ dvgrab -f mpeg2 - > foo.ts &
$ ffplay foo.ts

I do not have a HDV camera to test that first hand, but it should work.

2.) dvgrab will drop frames, but there is also a buffer between the thread reading firewire and the thread writing to the pipe/fifo to absorb process scheduling latency.

3.) I think it is rather easy to use the classes. See dvgrab.cc. First, scan through to locate all the parts dealing with option processing, usage help, and interactive control so you can ignore them. You are then left with code about startCapture, captureThread, and stopCapture.

+-DRD-+
Lead Kino Developer

  

IP Printer Friendly copy | Reply | Reply with quote | Top

Top Linux Digital Video dvgrab Topic #1054 Previous topic | Next topic
Powered by DCForum+ Version 1.1
Copyright 1997-2002 DCScripts.com