Hello,
I got a weird behaviour of avcodec_encode_video() when developing an
application that extracts the storyboard frames from a video.
Actually I don't have a clue to say whether that is my local platform's
problem or ffmpeg's problem itself. I'll describe here then if you have met
it before, please give me an advice.
My goal is:
- Extract frames from a video.
- Calculate MD5 of these frames.
I installed my application on 3 platforms: Ubuntu 9.10 32 bits, CentOS 32
bits, CentOS 64 bits.
It's suprising that the MD5 is calculated correctly on both Ubuntu 32 bits
and CentOS 64 bits, but not on CentOS 32 bits (although the images saved to
local file system are OK, with the same size).
Debugging hardly in the code I saw that it might due to the output buffer of
av_encode_video, which be used later on MD5 algorithm. So I try to write the
first frame's buffer  of video to file and compare what I get in these 3
platforms.
And yes, there's just 1 'number' different from a list of ~150000 number
when I compare the output file (in particular, '8' vs '9'). That's why MD5
calulated later would be different.
This's my first time sending email to this mailing list. Sorry if do
something wrong.

Thanks and regards,

P/S:
Here is my code for debugging (the buffer gets slightly different value on
my CentOS 32 bits):

pOCodecCtx->qmin = pOCodecCtx->qmax = 3;
pOCodecCtx->mb_lmin = pOCodecCtx->lmin = pOCodecCtx->qmin * FF_QP2LAMBDA;
pOCodecCtx->mb_lmax = pOCodecCtx->lmax = pOCodecCtx->qmax * FF_QP2LAMBDA;
pOCodecCtx->flags |= CODEC_FLAG_QSCALE;

pFrame->quality = 4;
pFrame->pts = i;


int szBufferActual = avcodec_encode_video(pOCodecCtx, buffer, numBytes, pFrame);
for (int j = 0; j < numBytes; j++)
    printf("%lld", buffer[j]);


-- 

Le Truong Vinh Phu - Student - Class MT05KSTN
Faculty of Computer Science and Engineering
HCM city University of Technology - VietNam
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to