[FFmpeg-devel] Parallelizing MPEG encoding with MPI

Andreas Simbuerger simi
Sat Dec 6 21:20:17 CET 2008

Greetings everybody!

I'm currently working on a programming exercise for my diploma at the
University of Passau. We try to enhance MPEG encoding by introducing
parallelism on GOP encoding with the MPI libraries.

Basically i'd like to split the n processes i get with mpi into
3 groups.

One node will be the "Input Node". The Node will send all data necessary
for encoding the first frame within the GOP to the next scheduled

Another node will become the "Output Node". This Node will receive the
encoded GOPs frame by frame and reorder them by their timestamps.

The remaining nodes will group together as the "Process Nodes".
They will do the actual encoding. This will result in a "GOP chain".

Input -(I-Frame)-> N1 -> N2 -> N3 -> N4 ... Nn |
		   ^                           |
		   |----until GOP is finished--|

The distribution between N1 to Nn will be controlled by a scheduler.
First i want to get this encoding to work without any scheduling.

This was the basic idea, but now i have some more or less technical
questions due to my lack of experience using the C language.

I was looking for the implementation of 
int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, 
                            int buf_size, const AVFrame *pict);
which is declared in avcodec.h

This is kinda embarassing to me, because even with using a text search
over all source files i could not find the implementation of this
header. Nevertheless it is used within the encoding loop in ffmpeg.c.

So my question is... where can i find the implementation of this

Beside that, i achieved to compile the source with MPI and i am able to
distribute data required for encoding between my nodes. Although it is
still full of errors but i'm getting closer to that ;-)

Hope someone could show me the right spot to look at :-)


More information about the ffmpeg-devel mailing list