I don't think many of us here are lawyers, so take any answers with the appropriate sized pinch of salt (or, preferably, professional legal advice), but...
In terms of copyright on the code, the LGPL provides a license to do what you want: you'll have to make the code to libavcodec available, along with any modifications you make to it, but you don't have to make your code available.
(EDIT: as pointed out by Pavel below, you need to allow your users to also make modifications to your copy of libavcodec; in practice, dynamically linking to libavcodec is the easiest way to comply with this. )
For what you're doing, copyright may not be the only consideration. If you're in/distributing to the US, and probably other countries, you've also got software patents to worry about -- many of the codecs implemented by libavcodec are covered by patents, and to be legal you'll need to acquire the necessary licenses from the patent owners.