<div dir="ltr"><div dir="ltr"><div dir="ltr">Sorry for the late reply Cory <div>I tried the following options via vtkAVIWriter's SetCompressorFourCC() method<div><br></div><div>'MSVC'(default) - works but gives the scattered lines in the background for gradient background</div><div>'DIB' - Full Frames (Uncompressed) - works well and removes the gradient background problem - creates large AVI files (upto 300 MB for a 4-5 second animation)</div><div>'LAGS' - Lagarith Lossless Codec - got unknown compressor error</div><div>'MJPG' - got unknown compressor error</div><div>'DIVX' - got unknown compressor error</div><div>'XVID' - got unknown compressor error</div><div>'H264' - got unknown compressor error</div><div><br></div><div>Thanks,</div></div><div>Santosh</div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Nov 30, 2018 at 7:51 PM Cory Quammen <<a href="mailto:cory.quammen@kitware.com">cory.quammen@kitware.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Great, glad to hear it. What compression options did you settle on in<br>
case someone runs into this issue in the future?<br>
On Fri, Nov 30, 2018 at 8:30 AM Santosh Biradar <<a href="mailto:scbiradar@gmail.com" target="_blank">scbiradar@gmail.com</a>> wrote:<br>
><br>
> 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.<br>
> Thanks Andras for pointing me to an alternate to vtkAVIWriter. I will explore the MKV container.<br>
><br>
> Santosh<br>
><br>
> On Wed, Nov 28, 2018 at 1:01 PM Andras Lasso <<a href="mailto:lasso@queensu.ca" target="_blank">lasso@queensu.ca</a>> wrote:<br>
>><br>
>> 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.<br>
>><br>
>><br>
>><br>
>> We build required libraries (VP9, libwbm, yasm) using CMake superbuild on Windows/Linux/Mac. Container file reading/writing implementation is here: <a href="https://github.com/IGSIO/IGSIO/blob/master/Source/VideoIO/MKV/vtkMKVWriter.cxx" rel="noreferrer" target="_blank">https://github.com/IGSIO/IGSIO/blob/master/Source/VideoIO/MKV/vtkMKVWriter.cxx</a>, and VP9 codec is here: <a href="https://github.com/IGSIO/SlicerIGSIO/blob/master/VideoIO/Codecs/vtkVP9VolumeCodec.cxx" rel="noreferrer" target="_blank">https://github.com/IGSIO/SlicerIGSIO/blob/master/VideoIO/Codecs/vtkVP9VolumeCodec.cxx</a>.<br>
>><br>
>><br>
>><br>
>> Andras<br>
>><br>
>><br>
>><br>
>> From: vtkusers <<a href="mailto:vtkusers-bounces@public.kitware.com" target="_blank">vtkusers-bounces@public.kitware.com</a>> On Behalf Of Cory Quammen<br>
>> Sent: Tuesday, November 27, 2018 10:11 AM<br>
>> To: santosh <<a href="mailto:scbiradar@gmail.com" target="_blank">scbiradar@gmail.com</a>><br>
>> Cc: vtkusers <<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>><br>
>> Subject: Re: [vtkusers] vtkAVIWriter with renderer gradient background shows distinct lines<br>
>><br>
>><br>
>><br>
>> 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.<br>
>><br>
>><br>
>><br>
>> Personally I prefer to dump animation frames and assemble them with outside video software.<br>
>><br>
>><br>
>><br>
>> Cory<br>
>><br>
>><br>
>><br>
>> On Tue, Nov 27, 2018 at 9:26 AM Santosh Biradar <<a href="mailto:scbiradar@gmail.com" target="_blank">scbiradar@gmail.com</a>> wrote:<br>
>><br>
>> Thanks for the quick response Cory.<br>
>><br>
>> 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.<br>
>><br>
>> 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.<br>
>><br>
>> There is no difference in the quality of the background.<br>
>><br>
>><br>
>><br>
>> I also get the same behavior in Paraview's Save Animation feature (version 5.5 on windows)<br>
>><br>
>><br>
>><br>
>> Thanks,<br>
>><br>
>> Santosh<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> On Tue, Nov 27, 2018 at 7:29 PM Cory Quammen <<a href="mailto:cory.quammen@kitware.com" target="_blank">cory.quammen@kitware.com</a>> wrote:<br>
>><br>
>> Sounds like quantization/compression artifacts. You can try changing the quality setting to reduce compression via vtkAVIWriter::SetQuality().<br>
>><br>
>><br>
>><br>
>> HTH,<br>
>><br>
>> Cory<br>
>><br>
>><br>
>><br>
>> On Tue, Nov 27, 2018 at 8:55 AM Santosh Biradar <<a href="mailto:scbiradar@gmail.com" target="_blank">scbiradar@gmail.com</a>> wrote:<br>
>><br>
>> I am trying to create a movie of an animation using vtkAVIWriter.<br>
>><br>
>> 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.<br>
>><br>
>><br>
>><br>
>> A code snippet of what I am doing:<br>
>><br>
>><br>
>><br>
>> window_to_image = vtk.vtkWindowToImageFilter()<br>
>> window_to_image.SetInput(renWin.GetRenderWindow())<br>
>> window_to_image.SetInputBufferTypeToRGB()<br>
>> window_to_image.ReadFrontBufferOff()<br>
>><br>
>> writer = vtk.vtkAVIWriter()<br>
>> writer.SetInputConnection(window_to_image.GetOutputPort())<br>
>><br>
>> I am running python wrapper of VTK-6.3.0 on windows<br>
>><br>
>><br>
>><br>
>> Thanks,<br>
>><br>
>> Santosh<br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
>><br>
>> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>><br>
>> Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
>><br>
>> Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
>><br>
>> Follow this link to subscribe/unsubscribe:<br>
>> <a href="https://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">https://public.kitware.com/mailman/listinfo/vtkusers</a><br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>><br>
>> Cory Quammen<br>
>> Staff R&D Engineer<br>
>> Kitware, Inc.<br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>><br>
>> Cory Quammen<br>
>> Staff R&D Engineer<br>
>> Kitware, Inc.<br>
<br>
<br>
<br>
-- <br>
Cory Quammen<br>
Staff R&D Engineer<br>
Kitware, Inc.<br>
</blockquote></div>