Re: vtkAVIWriter with renderer gradient background shows distinct lines

Cory Quammen via vtkusers <[email protected]>
Newsgroups gmane.comp.lib.vtk.user
Message-ID <CAB5Fpx5Fw2RiVB6xOoDA0D_UiSLc10m0zh1gv0neYmrsfe1P4Q@mail.gmail.com>
Great, glad to hear it. What compression options did you settle on in
case someone runs into this issue in the future?
On Fri, Nov 30, 2018 at 8:30 AM Santosh Biradar <[email protected]> wrote:
>
> Thanks Cory. I was able to try different compression options and was able to remove the background lines appearing because of the gradient albeit with large size of the AVI files.
> Thanks Andras for pointing me to an alternate to vtkAVIWriter. I will explore the MKV container.
>
> Santosh
>
> On Wed, Nov 28, 2018 at 1:01 PM Andras Lasso <[email protected]> wrote:
>>
>> In 3D Slicer we use VP9 codec with MKV container and it works well. VP9 is not as widely used as H264 but it is completely royalty-free and offers good compression ratio and acceptable speed even with lossless settings.
>>
>>
>>
>> We build required libraries (VP9, libwbm, yasm) using CMake superbuild on Windows/Linux/Mac. Container file reading/writing implementation is here: https://github.com/IGSIO/IGSIO/blob/master/Source/VideoIO/MKV/vtkMKVWriter.cxx, and VP9 codec is here: https://github.com/IGSIO/SlicerIGSIO/blob/master/VideoIO/Codecs/vtkVP9VolumeCodec.cxx.
>>
>>
>>
>> Andras
>>
>>
>>
>> From: vtkusers <[email protected]> On Behalf Of Cory Quammen
>> Sent: Tuesday, November 27, 2018 10:11 AM
>> To: santosh <[email protected]>
>> Cc: vtkusers <[email protected]>
>> Subject: Re: [vtkusers] vtkAVIWriter with renderer gradient background shows distinct lines
>>
>>
>>
>> I'm afraid I don't have a lot of experience with the AVI compression options. You might experiment with vtkAVIWriter::SetCompressorFourCC() to see if you can find a compressor that gives more satisfactory results.
>>
>>
>>
>> Personally I prefer to dump animation frames and assemble them with outside video software.
>>
>>
>>
>> Cory
>>
>>
>>
>> On Tue, Nov 27, 2018 at 9:26 AM Santosh Biradar <[email protected]> wrote:
>>
>> Thanks for the quick response Cory.
>>
>> I tried setting quality to 0,1,2. The quality of the movie was best for 2 and worst for 0 but the background remained the same in each case.
>>
>> The quality of the output of the  filter (in this case, a vtkContourFilter) reduces with reduction in SetQuality but the background remains of the same quality.
>>
>> There is no difference in the quality of the background.
>>
>>
>>
>> I also get the same behavior in Paraview's Save Animation feature (version 5.5 on windows)
>>
>>
>>
>> Thanks,
>>
>> Santosh
>>
>>
>>
>>
>>
>> On Tue, Nov 27, 2018 at 7:29 PM Cory Quammen <[email protected]> wrote:
>>
>> Sounds like quantization/compression artifacts. You can try changing the quality setting to reduce compression via vtkAVIWriter::SetQuality().
>>
>>
>>
>> HTH,
>>
>> Cory
>>
>>
>>
>> On Tue, Nov 27, 2018 at 8:55 AM Santosh Biradar <[email protected]> wrote:
>>
>> I am trying to create a movie of an animation using vtkAVIWriter.
>>
>> The renderer has a gradient background. The .avi file created has distinct lines/bands in the background because of the gradient. Is it possible to get rid of these lines. I notice that if I use a vtkBMPWriter and write an image, the image seems fine without any such lines/bands.
>>
>>
>>
>> A code snippet of what I am doing:
>>
>>
>>
>> window_to_image = vtk.vtkWindowToImageFilter()
>> window_to_image.SetInput(renWin.GetRenderWindow())
>> window_to_image.SetInputBufferTypeToRGB()
>> window_to_image.ReadFrontBufferOff()
>>
>> writer = vtk.vtkAVIWriter()
>> writer.SetInputConnection(window_to_image.GetOutputPort())
>>
>> I am running python wrapper of VTK-6.3.0 on windows
>>
>>
>>
>> Thanks,
>>
>> Santosh
>>
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> https://public.kitware.com/mailman/listinfo/vtkusers
>>
>>
>>
>>
>> --
>>
>> Cory Quammen
>> Staff R&D Engineer
>> Kitware, Inc.
>>
>>
>>
>>
>> --
>>
>> Cory Quammen
>> Staff R&D Engineer
>> Kitware, Inc.



-- 
Cory Quammen
Staff R&D Engineer
Kitware, Inc.
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.