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

Reply via email to