

To finish this first part, we look for the codec and verifies if FFMPEG supports it. If(avcodec_open(pCodecCtx, pCodec)width * pCodecCtx->height * 3 PCodec=avcodec_find_decoder(pCodecCtx->codec_id) It looks inside the video stream, then we place ourselves at the beginning of the film. PFormatCtx → streams is an array of pointers. If(pFormatCtx->streams ->dec_type=CODEC_TYPE_VIDEO) If(av_find_stream_info(pFormatCtx)nb_streams) i++) If(av_open_input_file(&pFormatCtx, filename, NULL, 0, NULL)!=0) *Declare a pointer pCodec will receive the code for decoding the video file.*/ Again, once you understand the operation of this program, you are free to structure the code in other object oriented. To do this, we'll make a function init_video (char * filename) which returns an integer. The first thing to do is open the video file and prepare for the latter reading. These variables will be explained at the time of their use in the rest of this tutorial. Finally Data is the array of pixels, without which we could not transfer the video to SFML. sp_video is that using the sprite SFML to draw our video screen. Im_video will receive the pixel array containing each image from the video. For this tutorial, I'm more in form and substance. You are free to structure the code in a cleaner. FFMpeg is coded in C and our projects in C + +, it is desirable to indicate to the compiler. The following are the basic elements which we will need for our program. The purchase of the sound is not answered here. This tutorial does not explain how to do the compiling FFMpeg, but the only way to load a video.

This library was originally designed to work with SDL or OpenGL and GLUT possibly Linux, but it is also possible to compile Windows, Mac OS and BSD and use it with other booksellers from the moment you knows how to manipulate the pixels in each image. For this, there is a library developed in C language called FFMPEG. SFML does not have a module to load, save, convert or view the video. I know nothing about French except the word "Bonjour". I translate it into English using the Google language tool.


The original tutorial is in French and is at the following link:
