[Ffmpeg-devel] encoding twice from an app yields lots of "ac-tex damaged at 0 0"
Karl H. Beckers
karl.h.beckers
Mon Jun 26 16:03:36 CEST 2006
Hi all,
I may be doing smth. completely wrong here, but am unable to find what ...
and perhaps one of you guys has come across this:
I have this app which encodes images gotten elsewhere to a video using
libavcodec/-format.
If I do this once everything works like a charm.
If I start the encoding again after stopping the first one and without
restarting the whole app, the resulting video is broken. It has MANY
artefacts most of the time more artefacts than actual video.
An MSMPEG4v2 video gives lots of these messages:
"ac-tex damaged at 0 0"
A FLV1 video these:
"run overflow at 0x0 i:1"
My first idea was "I must be forgetting to clean up smth. between the
encoding sessions", however I'm unable to find what. when stopping session
1 I do:
if (out_st) {
avcodec_close(out_st->codec);
out_st = NULL;
}
if (output_file) {
/*
* write trailer
*/
av_write_trailer(output_file);
/*
* free stream(s) ... probably always only one
*/
for (j = 0; j < output_file->nb_streams; j++)
av_free(output_file->streams[j]);
/*
* close file if multi-frame capture ... otherwise closed already
*/
if (job->target >= CAP_MF)
url_fclose(&output_file->pb);
/*
* free format context
*/
av_free(output_file->priv_data);
av_free(output_file);
output_file = NULL;
}
if (outpic_buf) { // this is the data of the output frame
av_free(outpic_buf);
outpic_buf = NULL;
}
free(outbuf); // this is the memory for the encoded frame
outbuf = NULL;
av_free(p_inpic);
p_inpic = NULL; // the input frame
av_free(outpic_buf); the actual image data of the output frame
av_free(p_outpic);
p_outpic = NULL; // the output frame
if (input_pixfmt == PIX_FMT_PAL8 && scratchbuf8bit) {
free(scratchbuf8bit);
scratchbuf8bit = NULL;
}
codec = NULL;
av_free_static();
Any ideas, hints? Am I forgetting anything?
TIA,
Karl.
More information about the ffmpeg-devel
mailing list