<div dir="ltr">Hi All,<div><br></div><div>I have successfully used ffmpeg command line tool to extract all Iframes(Key frames) from a transport stream and saved to file using the following command</div><div><br></div><div>ffmpeg -i ESPN-DISH.ts -f image2 -vf "select=eq(pict_type\,PICT_TYPE_I)"  -vsync vfr yi%03d.png</div><div><br></div><div>For my particular use case, I have to read the frames programatically to extract the I frames and stream the I frames in a UI container. So far I can compile and the following program from this link to extract the YUV filtered images. </div><div><br></div><div>I found this example easy to modify for my use case. </div><div><a href="https://github.com/leixiaohua1020/simplest_ffmpeg_video_filter/blob/master/simplest_ffmpeg_video_filter/simplest_ffmpeg_video_filter.cpp">https://github.com/leixiaohua1020/simplest_ffmpeg_video_filter/blob/master/simplest_ffmpeg_video_filter/simplest_ffmpeg_video_filter.cpp</a><br></div><div><br></div><div>But I am having confusion on how to use the select=eq(pict_type\,PICT_TYPE_I) filter in the code. Particularly I can see the following functions to define the filter. </div><div><br></div><div><div>AVFilter *buffersrc  = avfilter_get_by_name("buffer");</div><div>AVFilter *buffersink = avfilter_get_by_name("ffbuffersink");</div></div><div><br></div><div>But couldnt figure out how to tweak the code for extraction of I frames.</div><div><br></div><div>Please anyone help me to use the functions suitably for filtering the I frames from the video input. </div><div><br></div><div>Thanks in advance.</div><div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><table style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium" width="100%" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td><table width="650" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td width="1098"><p style="font-stretch:normal;font-size:12px;line-height:15px;font-family:Helvetica,Arial,sans-serif;color:rgb(46,46,46);margin:0px;padding:0px 0px 6px">Thank you,<br>warm regards,</p><p style="font-stretch:normal;font-size:12px;line-height:15px;font-family:Helvetica,Arial,sans-serif;color:rgb(46,46,46);margin:0px;padding:0px 0px 6px"><img src="http://elementzonline.com/signature/logo.png" alt="Logo" height="49" width="165"></p><p style="font-stretch:normal;font-size:15px;font-family:Helvetica,Arial,sans-serif;color:rgb(138,40,40);font-weight:bold;margin:0px;padding:0px">Dhanish Vijayan</p><p style="font-stretch:normal;font-size:13px;font-family:Helvetica,Arial,sans-serif;color:rgb(138,40,40);font-weight:bold;margin:0px;padding:0px">Chief Technical Officer</p><p style="font-stretch:normal;font-size:12px;line-height:15px;font-family:Helvetica,Arial,sans-serif;color:rgb(46,46,46);margin:0px;padding:0px 0px 6px">Elementz Engineers Guild Pvt Ltd</p><p style="font-stretch:normal;font-size:12px;line-height:15px;font-family:Helvetica,Arial,sans-serif;color:rgb(46,46,46);margin:0px;padding:0px 0px 6px"><span style="font-weight:bold">Email</span>: <a href="mailto:dhanish@elementzonline.com" target="_blank">dhanish@elementzonline.com</a></p><p style="font-stretch:normal;font-size:12px;line-height:15px;font-family:Helvetica,Arial,sans-serif;color:rgb(46,46,46);margin:0px;padding:0px 0px 6px"><span style="font-weight:bold">Website</span>: <a href="http://www.elementzonline.in" target="_blank">www.elementzonline.in</a>, <a href="http://www.elementzonline.com" target="_blank">www.elementzonline.com</a></p><p style="font-stretch:normal;font-size:12px;line-height:15px;font-family:Helvetica,Arial,sans-serif;color:rgb(46,46,46);margin:0px;padding:0px 0px 6px"><span style="font-weight:bold">Mob</span>: +91-8129025513</p><p style="font-stretch:normal;font-size:12px;line-height:15px;font-family:Helvetica,Arial,sans-serif;color:rgb(46,46,46);margin:0px;padding:0px 0px 6px"><span style="font-weight:bold">Off</span>: +91-471-2300804</p><p style="font-stretch:normal;font-size:12px;line-height:15px;font-family:Helvetica,Arial,sans-serif;color:rgb(46,46,46);margin:0px;padding:0px 0px 6px"></p><br><table width="900" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="border-right:1px dashed rgb(0,0,0);padding:0px 10px 0px 0px" align="left" valign="top" width="349"><span><p style="font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:12px;line-height:15px;font-family:Helvetica,Arial,sans-serif;color:rgb(46,46,46);margin:0px;padding:0px 0px 6px"><span style="font-weight:bold">Elementz Engineers Guild Pvt Ltd</span><br>
          TC 25/1655/5, Rema Plaza,<br>
          SS Kovil Road, Thampanoor,<br>
          Thiruvananthapuram<br>
          Kerala - 695001</p>
          <p style="font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:12px;line-height:15px;font-family:Helvetica,Arial,sans-serif;color:rgb(46,46,46);margin:0px;padding:0px 0px 6px"><span style="font-weight:bold">Phone</span>: 0471-6006699, 3106699, 2329699</p></span></td><td style="border-right:1px dashed rgb(0,0,0);padding:0px 10px" align="left" valign="top" width="349"><p style="font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:12px;line-height:15px;font-family:Helvetica,Arial,sans-serif;color:rgb(46,46,46);margin:0px;padding:0px 0px 6px"><span style="font-weight:bold">Elementz Engineers Guild Pvt Ltd</span><br>
          TC 12/78(11), Capital Heights,<br>
          PMG Plamoodu road,<br>
          Pattom P. O.,Thiruvananthapuram,<br>
Kerala - 695004 </p>
          <p style="font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:12px;line-height:15px;font-family:Helvetica,Arial,sans-serif;color:rgb(46,46,46);margin:0px;padding:0px 0px 6px"><span style="font-weight:bold">Phone</span>: 0471-2300804</p></td>
        <td style="border-right:1px dashed rgb(0,0,0);padding:0px 0px 0px 10px" align="left" valign="top" width="349"><p style="font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:12px;line-height:15px;font-family:Helvetica,Arial,sans-serif;color:rgb(46,46,46);margin:0px;padding:0px 0px 6px"><span style="font-weight:bold">Elementz Engineers Guild Pvt Ltd</span><br>
          SBC 3, Thejaswini,<br>
Technopark Campus,<br>
Thiruvananthapuram - 695581 <br>
Kerala
        </p>
          <p style="font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:12px;line-height:15px;font-family:Helvetica,Arial,sans-serif;color:rgb(46,46,46);margin:0px;padding:0px 0px 6px"><span style="font-weight:bold">Phone</span>: 0471-3106622</p></td>
        <td style="padding:0px 0px 0px 10px" align="left" valign="top" width="349"><p style="font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:12px;line-height:15px;font-family:Helvetica,Arial,sans-serif;color:rgb(46,46,46);margin:0px;padding:0px 0px 6px"><span style="font-weight:bold">Elementz Engineers Guild Pvt Ltd</span><br>
          No.131, 4th Cross,<br>
2nd main, RHB Colony,<br>
Opposite Phoenix Marketcity,<br>
Mahadevapura,<br>
Bangalore - 560048
        </p>
          <p style="font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:12px;line-height:15px;font-family:Helvetica,Arial,sans-serif;color:rgb(46,46,46);margin:0px;padding:0px 0px 6px"><span style="font-weight:bold">Phone</span>: +91-9020616699</p></td></tr></tbody></table></td></tr><tr><td><table width="650" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td><br></td></tr><tr>
    <td><table border="0" cellpadding="0" cellspacing="0">
  <tbody><tr>
    <td><p style="font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:12px;line-height:15px;font-family:Helvetica,Arial,sans-serif;color:rgb(46,46,46);margin:0px;padding:0px 0px 6px"><span style="font-weight:bold">Connect with us </span>: </p></td>
    <td> </td>
    <td><a href="https://www.facebook.com/elementzonline" target="_blank"><img src="http://elementzonline.com/signature/fb.png" alt="FB" height="25" width="25"></a></td>
    <td> </td>
    <td><a href="https://twitter.com/elementzonline" target="_blank"><img src="http://elementzonline.com/signature/twitter.png" alt="Twitter" height="25" width="25"></a></td>
    <td> </td>
    <td><a href="https://www.linkedin.com/company/elementz-engineers-guild-pvt-ltd" target="_blank"><img src="http://elementzonline.com/signature/linkedin.png" alt="Twitter" height="25" width="25"></a></td>
    </tr>
</tbody></table>
</td>
  </tr>
</tbody></table></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr></tbody></table></td></tr><tr><td> </td></tr><tr><td style="border-top:1px dashed rgb(0,0,0);border-bottom:1px dashed rgb(0,0,0);padding:10px 0px 0px"><p style="font-stretch:normal;font-size:12px;line-height:15px;font-family:Helvetica,Arial,sans-serif;color:rgb(46,46,46);margin:0px;padding:0px 0px 6px"><span style="font-weight:bold">Disclaimer: </span>: This message and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. No Liability is attached to the originator or Elementz Engineers Guild Pvt. Ltd. Views or opinions presented in this email is of the author and may not necessarily reflect the opinions of Elementz Engineers Guild Pvt. Ltd.</p><p style="font-stretch:normal;font-size:12px;line-height:15px;font-family:Helvetica,Arial,sans-serif;color:rgb(46,46,46);margin:0px;padding:0px 0px 6px">This message contains confidential information. If you have received this e-mail by mistake, please notify the sender immediately by e-mail and delete this e-mail and its contents from your system.</p></td></tr></tbody></table></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div><img src="http://t.sidekickopen65.com/e1t/o/5/f18dQhb0S7ks8dDMPbW2n0x6l2B9gXrN7sKj6v4LNfxW3MybnT5v0NQWW5w6DZ03LvrVvW2_MlX11k1H6H0?si=6136575903399936&pi=337cb20b-28ba-4143-d03a-69337d67da04" style="display:none!important" height="1" width="1"></div>