On date Wednesday 2008-12-03 15:29:09 +0100, Luca Abeni encoded:
> Hi Stefano,
> 
> Stefano Sabatini wrote:
> > On date Wednesday 2008-12-03 13:17:31 +0100, Luca Abeni encoded:
> >> Stefano Sabatini wrote:
> >>> Hi all,
> >>>
> >>> the following program is meant to be a basic example of the encoding
> >>> decoding libavcodec API.
> >>>
> >>> The problem is that I *always* got an empty frame when decoding the
> >>> frame.
> >> This does not happen here: the encdec-dst.pgm file I get is just a
> >> "low quality" version of the encdec-src.pgm file. Probably, the rate
> >> control mechanism starts encoding the first frame with a low quality
> >> (and the image you use as input requires a very high bitrate).
> > 
> > Hi Luca, after three days hitting hard my head on the wall, I finally
> > discovered what was going wrong, in attachement there is a working
> > version.
> > 
> > And the problem was...
> > 
> > ... that apparently libavcodec wasn't working correctly without to
> > first call av_register_all, a libavformat symbol, maybe the problem
> > also depends on the fact that I'm using shared libraries.
> Uhmmm... I suspect you just forgot to call avcodec_init() ;-)
> 
> For some reason, here the program works even if such function is
> not called, but generates a low-quality picture.
> If I add the call to avcodec_init(), then the picture is encoded
> at the correct quality (if I increase the bitrate).
> 
> I am linking statically, and I am not linking libavformat.

Ouch!, that was the point (I believed that avcodec_register_all() also
called avcodec_init())...

So that was entirely my fault... 

Regards.
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to