Deconstruction FFmpeg (II.)

Source: Internet
Author: User

By comparing the filtergraph of both DirectShow and FFmpeg, the filtergraph operation of FFmpeg was analyzed.

The first filtergraph is a graph, which consists of points and edges. The point in Filtergraph is the filter. In DirectShow, there is no edge object, the connection of filter depends on the pin component and the Ipin interface, and a pair of inputpin and Outputpin form an edge. Each filter can have at least one pin, that is, each point has at least one edge (excluding a plot with only one point, and a point without adjacent edges). The Inputpin and outputpin that make up the connection hold each other's references. The operation of the Filtergraph relies on the three methods of the Ipin interface Read,async_read and receive. The high data is pushed downstream by the receive of the Out Edge (Outputpin) call to the side (Inputpin). Reverse, downstream through the input edge (Inputpin) calls to the side of the Out Edge (Outputpin) of the read or async_read to the high pull data. Upstream source data can be reached downstream by a path in the diagram.

In the FFmpeg, Avfiltercontext is the point, Avfilterlink is the edge. Avfilterlink is the avfiltercontext of the entrance, Avfiltercontext is the neighboring point of Avfilterlink. The Avfilterpad is a pin-equivalent component that enables Filtergraph to run. The main functions of avfilterpad are three interface functions, Poll_frame,request_frame and Filter_frame.

Pushes frame data by recursion to downstream "first order" traversal

Filter_frame (link, frame) {  filter (frame);  Input_pad->filter_frame (link, frame);}

Pull frame data by recursive upstream "post-shipment" traversal

Request_frame (link, frame) {  output_pad->request_frame (link, frame);  Filter (frame);}

Object Diagram Please see a "deconstruction FFmpeg (a)".

Deconstruction FFmpeg (II.)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.