[Libav-user] libavfilter help - for filtering I frames from Transport stream

Dhanish Vijayan dhanish at elementzonline.com
Thu Jun 8 10:27:58 EEST 2017

Hi All,

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

ffmpeg -i ESPN-DISH.ts -f image2 -vf "select=eq(pict_type\,PICT_TYPE_I)"
 -vsync vfr yi%03d.png

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.

I found this example easy to modify for my use case.

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.

AVFilter *buffersrc  = avfilter_get_by_name("buffer");
AVFilter *buffersink = avfilter_get_by_name("ffbuffersink");

But couldnt figure out how to tweak the code for extraction of I frames.

Please anyone help me to use the functions suitably for filtering the I
frames from the video input.

Thanks in advance.


Thank you,
warm regards,

[image: Logo]

Dhanish Vijayan

Chief Technical Officer

Elementz Engineers Guild Pvt Ltd

Email: dhanish at elementzonline.com

Website: www.elementzonline.in, www.elementzonline.com

Mob: +91-8129025513

Off: +91-471-2300804

Elementz Engineers Guild Pvt Ltd
TC 25/1655/5, Rema Plaza,
SS Kovil Road, Thampanoor,
Kerala - 695001

Phone: 0471-6006699, 3106699, 2329699

Elementz Engineers Guild Pvt Ltd
TC 12/78(11), Capital Heights,
PMG Plamoodu road,
Pattom P. O.,Thiruvananthapuram,
Kerala - 695004

Phone: 0471-2300804

Elementz Engineers Guild Pvt Ltd
SBC 3, Thejaswini,
Technopark Campus,
Thiruvananthapuram - 695581

Phone: 0471-3106622

Elementz Engineers Guild Pvt Ltd
No.131, 4th Cross,
2nd main, RHB Colony,
Opposite Phoenix Marketcity,
Bangalore - 560048

Phone: +91-9020616699

Connect with us :
  [image: FB] <https://www.facebook.com/elementzonline>   [image: Twitter]
<https://twitter.com/elementzonline>   [image: Twitter]

Disclaimer: : 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.

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20170608/d21fd860/attachment.html>

More information about the Libav-user mailing list