[FFmpeg-devel] Problems with encoding a just decoded frame

Homero Damico homero.damico
Tue Nov 6 00:37:36 CET 2007


I'm using the ffmpeg for a personal steganographic software using videos,
however I'm not sure about the best way to implement this.
In short, I need to decode a video (for the moment, MPEG-1/2) change
some data, and re-encode.
I'm doing something like this (based on 'avcodec_sample.0.4.9.cpp' ) :

avcodec_decode_video(pCodecCtx, pFrame, &frameFinished, packet.data,
packet.size);
if(frameFinished)  {
         //Insert some data on the video
         avcodec_encode_video(pCodecCtx, buffer, bufferSize, pFrame);
 }

It looks right to me. I've tried some things, like creating (and
configurating) a new CodecContext,
storage the frames and re-encoding all togheter after (this one I've
discovered to be awfully wrong).

My problem is that the program seems and compile ok, but for some
reason it crashes when try to execute the encode instruction.
In other hand, I'm using the libs on windows (MinGW + MSys + MSVC).

It's a know issue? It's my env? It's the MSVC? It's karma or the libs hate me?
Any clues? :-)

Thanks in advance,
Homero Damico




More information about the ffmpeg-devel mailing list