title: How do I specify the linesize of a frame when calling av_frame_get_buffer
body: <pre class="lang-c prettyprint-override"><code>    int stream_index = find_stream(AVMEDIA_TYPE_VIDEO, input);
  
      AVStream *s = input-&gt;container-&gt;streams[stream_index];
  
      AVFrame *new_frame = av_frame_alloc();
  
      new_frame-&gt;width = s-&gt;codecpar-&gt;width;
      new_frame-&gt;height = s-&gt;codecpar-&gt;height;
      new_frame-&gt;format = s-&gt;codecpar-&gt;format;
  
      av_frame_get_buffer(new_frame, 0);
  
      printf(&quot;%i %i %i %i %i %i\n&quot;, new_frame-&gt;linesize[0], new_frame-&gt;linesize[1], new_frame-&gt;linesize[2], new_frame-&gt;width, new_frame-&gt;height, new_frame-&gt;format);
      apply_path(input-&gt;paths[stream_index], new_frame);
  </code></pre>
  <p>the values from the frame created with <code>av_frame_get_buffer(new_frame, 0);</code>
  are this:</p>
  <pre><code>linesize 0  1080  
  linesize 1  540  
  linesize 2  540  
  width  1080  
  height  1080  
  format  0 (AV_PIX_FMT_YUV420P)  
  </code></pre>
  <p>The values I want:</p>
  <pre><code>linesize 0  1152  
  linesize 1  576  
  linesize 2  576  
  width  1080  
  height  1080  
  format  0 (AV_PIX_FMT_YUV420P)   
  </code></pre>
  <p>I want to use linesize instead of width and height because when I decode frames from diferent videos they may have different linesizes but same width and height</p>