LibDvbV5Device device = new LibDvbV5Device();
device.SetLog(8, null);
device.Find();

LibDvbV5DeviceList findDeviceByDeliverySystem = device.FindDeviceByDeliverySystem(LibDvbV5FrontendDeliverySystem.SYS_DVBC_ANNEX_A);
if (findDeviceByDeliverySystem == null)
    return;
            
LibDvbV5DeviceList demuxerName = device.GetSisterDevice(findDeviceByDeliverySystem, DvbDeviceType.Demux);
LibDvbV5DeviceList dvrName = device.GetSisterDevice(findDeviceByDeliverySystem, DvbDeviceType.Dvr);

LibDvb5FrontendParameters frontend = findDeviceByDeliverySystem.ToFrontendParameters();
frontend.SetDeliverySystem(LibDvbV5FrontendDeliverySystem.SYS_DVBC_ANNEX_A);
frontend.StoreParameter(17, (uint)LibDvbV5FrontendDeliverySystem.SYS_DVBC_ANNEX_A);
frontend.StoreParameter(3, 610000000);       //freq
frontend.StoreParameter(8, 6900000);       //symbol rate
frontend.SetParameters();
Thread.Sleep(400);
frontend.GetStatistics();
Thread.Sleep(400);
uint retrieveStats = frontend.RetrieveStats(512);
if ((retrieveStats & 0x10) != 0)
{
    Console.WriteLine("got lock!");
    LibDvbV5OpenDescriptor dvrFd = device.DeviceOpen(dvrName);
    if (dvrFd == null)
        throw new IOException("open failed");
    dvrFd.SetBufferSize(1024 * 1024);
                
    LibDvbV5OpenDescriptor demuxFd = device.DeviceOpen(demuxerName);
    if (demuxFd == null)
        throw new IOException("open failed");

    demuxFd.DemuxSetPesFilter(0x2000, DemuxerPesType.DMX_PES_OTHER);

    FileStream fileStream = File.OpenWrite(String.Format("{0}.ts", DateTime.Now.Ticks));
    byte[] packBuffer = new byte[188];
    int readLen = 0;
    for (int i = 0; i < 9001; i++)
    {
        readLen = dvrFd.Read(packBuffer, 188);
        if (readLen > 0)
        {
            fileStream.Write(packBuffer, 0, 188);
        }
    }

    fileStream.Flush(true);
    fileStream.Close();
    demuxFd.Dispose();
    dvrFd.Dispose();
}
else
{
    Console.WriteLine("no lock :(");
}
frontend.Dispose();
device.Dispose();