reading MPEG-2 from firewire

Petr Holub hopet at ics.muni.cz
Sat Jan 29 11:19:47 PST 2005


Hi all,

we have got our first HD camera which outputs HD MPEG-2 stream
through it's firewire interface. I've tried to hack together
simple fwcontrol based application to read the stream into
a file. I started with what's available for DV in fwdv.c
and modified the code according to what I was able to read
from different IEC61883 descriptions (don't have access to
real specs :( ). It seems to receive packets in correct
MPEG-TS format but it seems that I receive just say one
of 200 packets. Do I need to do the intialization in a different
way than the following? (I've modified PSIZE to 596 which
corresponds to maximum packet I've observed on the link
when the camera is sending.)

        bufreq.rx.nchunk = NCHUNK;
        bufreq.rx.npacket = NPACKET_R;
        bufreq.rx.psize = PSIZE;
        bufreq.tx.nchunk = 0;
        bufreq.tx.npacket = 0;
        bufreq.tx.psize = 0;
        if (ioctl(d, FW_SSTBUF, &bufreq) < 0) {
                err(1, "ioctl");
        }

        isoreq.ch = ich & 0x3f;
        isoreq.tag = (ich >> 6) & 3;

        if( ioctl(d, FW_SRSTREAM, &isoreq) < 0)
                err(1, "ioctl");

Thanks for any hint,
Petr




More information about the freebsd-firewire mailing list