title: mlt: image distortion using lossless codec
body: <p>I have two 1920x1080 PNG files, <a href="https://i.stack.imgur.com/qxCTc.png" rel="nofollow noreferrer">center.png</a> and <a href="https://i.stack.imgur.com/DETjR.png" rel="nofollow noreferrer">right.png</a>, which are identical except that the image in <code>right.png</code> is shifted horizontally by 325 pixels.</p>
  <p>With mlt XML, I made a two-second long video using the lossless FFV1 format, showing one second of <code>center.png</code>, and then one second of <code>right.png</code>.  Here's my file, <code>foo.mlt</code>:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;                                           
  &lt;mlt&gt;                                                                            
    &lt;profile width=&quot;1920&quot; height=&quot;1080&quot;                                            
             display_aspect_num=&quot;1920&quot; display_aspect_den=&quot;1080&quot;                   
             sample_aspect_num=&quot;1&quot; sample_aspect_den=&quot;1&quot;                           
             colorspace=&quot;709&quot; progressive=&quot;1&quot;                                      
             frame_rate_num=&quot;30&quot; frame_rate_den=&quot;1&quot;/&gt;                              
                                                                                   
    &lt;consumer mlt_service=&quot;avformat&quot; properties=&quot;lossless/FFV1&quot; target=&quot;out.mkv&quot;/&gt; 
                                                                                   
    &lt;producer id=&quot;center&quot; mlt_service=&quot;qimage&quot; resource=&quot;center.png&quot; length=&quot;30&quot;/&gt; 
    &lt;producer id=&quot;right&quot;  mlt_service=&quot;qimage&quot; resource=&quot;right.png&quot;  length=&quot;30&quot;/&gt; 
                                                                                   
    &lt;playlist&gt;                                                                     
      &lt;entry producer=&quot;center&quot;/&gt;                                                   
      &lt;entry producer=&quot;right&quot;/&gt;                                                    
    &lt;/playlist&gt;                                                                    
  &lt;/mlt&gt; 
  </code></pre>
  <p>Then I run <code>melt foo.mlt</code> at the terminal and check the output file <code>out.mkv</code> in my video viewer.  However, on close inspection, when <code>right.png</code> appears in the video, it is slightly distorted (with some sort of halo-type artifact).  Here is a magnified view:</p>
  <p><a href="https://i.stack.imgur.com/Hjs9e.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Hjs9e.png" alt="enter image description here" /></a></p>
  <p>Weirdly, only the <code>right.png</code> image is distorted; the <code>center.png</code> displays correctly, even though the two images are identical except for positioning.</p>
  <p>Is this a bug?  I wouldn't expect any image distortion with a lossless codec, but maybe I've done something wrong.</p>
  <p>My specs:</p>
  <p>Ubuntu 20.04.2 LTS, 64-bit<br />
  melt 6.25.0<br />
  ffmpeg version 4.2.4-1ubuntu0.1</p>
  <p>Thanks</p>