Skip to content

Identical VideoCharacteristics except for FPS leads to one uncompressed image and one compressed image #164

@tank104

Description

@tank104

I have two identical VideoCharacteristics but the higher frame rate (5/2) produces uncompressed high quality image and the lower frame rate (1/1) produces compressed lower quality image.

Code example:


    var videoCharacteristic = new VideoCharacteristics(
        PixelFormats.YUYV,
        2592, 1944,
        new Fraction(5, 2),
        "YUY2", true,
        "32595559-0000-0010-8000-00aa00389b71");

    byte[] imageData = await deviceInfo.TakeOneShotAsync(
       videoCharacteristic);


    Console.WriteLine($"Width: {videoCharacteristic.Width}, Height: {videoCharacteristic.Height}, " +
                      $"PixelFormat: {videoCharacteristic.PixelFormat}, IsCompression: {videoCharacteristic.IsCompression}");
    Console.WriteLine($"Image1 data length: {imageData.Length}");

    // Save to file
    await File.WriteAllBytesAsync("oneshot1.bmp", imageData);

    videoCharacteristic = new VideoCharacteristics(
        PixelFormats.YUYV,
        2592, 1944,
        new Fraction(1, 1),
        "YUY2", true,
        "32595559-0000-0010-8000-00aa00389b71");

    imageData = await deviceInfo.TakeOneShotAsync(
       videoCharacteristic);//, TranscodeFormats.DoNotTranscode);

    // Save to file
    await File.WriteAllBytesAsync("oneshot2.bmp", imageData);

    Console.WriteLine($"Width: {videoCharacteristic.Width}, Height: {videoCharacteristic.Height}, " +
                      $"PixelFormat: {videoCharacteristic.PixelFormat}, IsCompression: {videoCharacteristic.IsCompression}");
    Console.WriteLine($"Image2 data length: {imageData.Length}");

Output looks like:


Width: 2592, Height: 1944, PixelFormat: YUYV, IsCompression: False
Image1 data length: 15116598
Width: 2592, Height: 1944, PixelFormat: YUYV, IsCompression: False
Image2 data length: 484803

Is this an issue with the camera or with FlashCap? Can I do anything to help debug or sort the issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions