[Help]I need to convert jpg image files to motion jpeg file by c++ coding

Examples and samples for those who develop software with FFmpeg.
Post Reply
YJJ
Posts: 2
Joined: Thu Apr 14, 2016 12:36 am

[Help]I need to convert jpg image files to motion jpeg file by c++ coding

Post by YJJ » Thu Apr 14, 2016 12:45 am

Hi, there

I'm trying to convert jpeg files to a vidio file(Motion JPeg codec)
so, I brought an encoding source sample from somewhere and have tried to fix it.

but I'm really lost few days here. when I choose using MJPEG codec, It kept falling at avcodec_open2 function.
and there is no logic for multiple inputs.

some advcie please.


this is where I selected a codec as the MJPEG
pCodecCtx->pix_fmt = AV_PIX_FMT_YUV420P;
//pCodecCtx->pix_fmt = AV_PIX_FMT_RGB24;

if (avcodec_open2(pCodecCtx, pCodec, NULL) < 0) {
printf("Could not open codec\n");
return -1;

Post Reply