Skip to contentSkip to conversation

extend video capture example to capture mpeg video file

DISCUSSION bad boy 2 participants 2 messages Sep 14, 2010 Media (V4L/DVB)

lore
Share & tools
lore

bad boy

author
#0 lore raw

Hi

I have a Hauppage TV capture card that seems to be working . I can use the

cat /dev/video0 > test.mpeg to capture a video file to hard disk.

I am trying to adapt the video capture example, source "capture.c" to capture the mpeg file.

The example code ins capture.c calls the read_frame() function that then calls process image, which writes a "." to the screen.

What do I need to modify to capture a proper mpeg file ?

Your help would be deeply appreciated.

Thanks
badam

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

#1 lore raw
Quoted 1 line · bad boy

Hi

Please note, the video4linux-list is about dead; use [email protected] instead.

Quoted 4 lines

I have a Hauppage TV capture card that seems to be working . I can use the

cat /dev/video0 > test.mpeg to capture a video file to hard disk.

Quoted 8 lines

I am trying to adapt the video capture example, source "capture.c" to capture the mpeg file.

The example code ins capture.c calls the read_frame() function that then calls process image, which writes a "." to the screen.

What do I need to modify to capture a proper mpeg file ?

If you have a Hauppauge card whose driver supports the read() method and provides MPEG output (ivtv or cx18?), then 'cat /dev/video0' does capture a proper MPEG file to standard output.

Drivers that support the read() method, like ivtv and cx18, usually do not support the methods that use mmap(). I'm guessing capture.c uses the one of the mmap() methods, which is a completely different way of reading from a video device node than a read() call. By the time you are done rewriting capture.c, you will end up with something close to cat.c.

Quoted 1 line

Your help would be deeply appreciated.

$ mplayer /dev/video0 -cache 8192

will display the video and audio as it is captured.

Regards,
Andy

Quoted 2 lines

Thanks
badam