thank you.. my exercise to understand the library is:
read sequence of images from files ( .jpg or bmp ) and create a video mpeg4 with them. There are examples of how to do it? my code to read the image file is correct? .. when i "encode" the frame with CODEC_ID_MPEG4, is correct write the frame for create video movie .mpeg4......... I'm working under linux, and i use the default player thanks for the help 2011/11/9 Ronald S. Bultje <[email protected]> > Hi, > > On Wed, Nov 9, 2011 at 2:40 AM, Paolo Melucci <[email protected]> > wrote: > > Good day to all. > > I'm sorry, my english is not correct. > > I'm trying to create a movie by reading a single image *.jpg in Linux > > machine. > > only one image ( is an exercise to understand ) > > I have now started to use the libraries > > this is my code, > [..] > > pCodec = avcodec_find_encoder(CODEC_ID_MPEG4); > [..] > > for(i=0;i<30;i++){ > > out_size = avcodec_encode_video(pCodecCtx, picBuf, bufSize, > frame); > > printf("encoding frame %3d (size=%5d)\n", i, out_size); > > fwrite(picBuf, 1, out_size, f); > > } > [..] > > /* add sequence end code to have a real mpeg file */ > > picBuf[0] = 0x00; > > picBuf[1] = 0x00; > > picBuf[2] = 0x01; > > picBuf[3] = 0xb7; > > fwrite(picBuf, 1, 4, f); > > fclose(f); > > free(picBuf); > > I don't think this is the right way to write video files, you probably > want to mux them into some kind of a container, e.g. AVI or so. > > What player do you use to play it back? It should warn you that this > file is incomprehensible. > > Ronald > _______________________________________________ > libav-api mailing list > [email protected] > https://lists.libav.org/mailman/listinfo/libav-api > -- Ing. Paolo Melucci
_______________________________________________ libav-api mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-api
