Skip to contentSkip to conversation

a multichannel capture problem

DISCUSSION Ming Liu 3 participants 8 messages Sep 8, 2008 – Oct 1, 2008 1 message not in the archive Media (V4L/DVB)

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Ming Liu

author
#1 lore raw

Hello,

As a newbie in V4L2, I am trying to capture two video channels simultaneously (we can live with about 0.05s difference between two channels). Currently, I am using PV-143 (a cheap card with one bt878 chip). After some research, I found:

1. bt878 can only handle one channel at one time, so I will not be able to reach a speed higher than 15 frames/second per channel.
2. Since I can not synchronize the two cameras, I will have much lower frame rate if I try to switch between two channels.

My problems are:

1. Is there any example codes that I can follow to estimate the frame rates using switch channel approach? Can I do this by using standard V4L2 APIs, or I will need to deal with the driver?
2. If I choose a multi-chip PCI based video capture card, is there any limit from the bandwidth? Are there any sample codes available?
3. In the program point of view, is there difference between using multi-chip card and several single chip cards?

Thank you in advance.
Sincerely yours
Ming

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

author
#2 lore raw

Any comments will be helpful.
I will really appreciate them.

Sincerely yours
Ming

Quoted 13 lines · Ming Liu

<div class="moz-text-flowed" style="font-family: -moz-fixed">Hello,

As a newbie in V4L2, I am trying to capture two video channels simultaneously (we can live with about 0.05s difference between two channels). Currently, I am using PV-143 (a cheap card with one bt878 chip). After some research, I found:

1. bt878 can only handle one channel at one time, so I will not be able to reach a speed higher than 15 frames/second per channel.
2. Since I can not synchronize the two cameras, I will have much lower frame rate if I try to switch between two channels.

My problems are:

1. Is there any example codes that I can follow to estimate the frame rates using switch channel approach? Can I do this by using standard V4L2 APIs, or I will need to deal with the driver?
2. If I choose a multi-chip PCI based video capture card, is there any limit from the bandwidth? Are there any sample codes available?
3. In the program point of view, is there difference between using multi-chip card and several single chip cards?

Quoted 7 lines

Thank you in advance.
Sincerely yours
Ming

</div>

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#3 lore raw
In reply to Ming Liu
Quoted 2 lines · Ming Liu

1. Is there any example codes that I can follow to estimate the frame rates using switch channel approach?

Motion (http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome ) is said to support multiple inputs of one card "at the same time". I never tried it, though.

Quoted 2 lines

Can I do this by using standard V4L2 APIs, or I will need to deal with the driver?

You can do this with V4L2.

Some time ago I made some experiments changing the input at random times using direct hardware access while capturing. IIRC the chip will skip at least one complete frame before it continues to capture.

Quoted 2 lines

2. If I choose a multi-chip PCI based video capture card, is there any limit from the bandwidth?

Of course. A few days ago we had a discussion about bandwidth issues when using 5+ bt8xx cards to capture 640x480 in YUV 4:2:0. When there are other chips using the PCI bus (f.ex. the harddisk controller), the limit will be lower.

Quoted 1 line

Are there any sample codes available?

Motion can handle multiple devices at the same time as well.

Quoted 2 lines

3. In the program point of view, is there difference between using multi-chip card and several single chip cards?

No.

Daniel

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#5 lore raw
In reply to Daniel Glöckner
Quoted 9 lines
Quoted 2 lines

Can I do this by using standard V4L2 APIs, or I will need to deal with the driver?

You can do this with V4L2.

Some time ago I made some experiments changing the input at random times using direct hardware access while capturing. IIRC the chip will skip at least one complete frame before it continues to capture.

what do you mean by direct hardware access?

- vk

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#6 lore raw
Quoted 7 lines · Vinicius Kamakura
Quoted 4 lines · Daniel Glöckner

Some time ago I made some experiments changing the input at random times using direct hardware access while capturing. IIRC the chip will skip at least one complete frame before it continues to capture.

what do you mean by direct hardware access?

I mmap'ed /sys/class/video4linux/video0/device/resource0 and toggled bit 5 of IFORM.

Daniel

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#7 lore raw

2008/9/30 Daniel Glöckner <[email protected]>:

Quoted 7 lines · Vinicius Kamakura
Quoted 6 lines · Daniel Glöckner
Quoted 4 lines

Some time ago I made some experiments changing the input at random times using direct hardware access while capturing. IIRC the chip will skip at least one complete frame before it continues to capture.

Quoted 7 lines
Quoted 1 line

what do you mean by direct hardware access?

I mmap'ed /sys/class/video4linux/video0/device/resource0 and toggled bit 5 of IFORM.

Daniel

Isn't that the same as using the VIDIOC_S_INPUT ioctl?
Or is there a performance gain (less field/frame skipping) on doing that?

- vk

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#8 lore raw
Quoted 2 lines · Vinicius Kamakura

Isn't that the same as using the VIDIOC_S_INPUT ioctl?
Or is there a performance gain (less field/frame skipping) on doing that?

I wanted the lowest latency and the least impact on the hardware.

Doing

  m[1]^=0x20;

should be faster than calling the kernel to do it.

It was a quick hack..

Daniel

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list