On Mon, Aug 3, 2009 at 3:45 PM, Stephan Assmus <[email protected]> wrote:

> I do see one problem in your explaination, though. In my code, just opening
> and closing the AVCodecContext for each stream makes all the difference (I
> tested that with a #define to either include this code or not). These
> instances have not been used for anything when I call av_write_frame(). So
> I am very much expecting that there is still something fishy. How can it be
> explained that just opening and closing the AVCodecContext instances, but
> not using them for anything, makes all the difference here?
>
>

Opening the AVCodecContext will cause FFmpeg to fill in any defaults for
that codec.  In turn, some AVFormatContext require defaults for a codec to
have been filled in when it writes the header

For example, opening a H263 codec that has the global headers flag set will
cause global header data to be created in AVCodecContext, and then calling
av_write_header for a .mov AVFormatContext will use (indeed requires) that
information.

It's somewhat confusing, but yes the rule is if you're calling
av_write_header, make sure you've opened each codec first (in Xuggler we
explicitly throw warnings if you don't).

- Art


-- 
http://www.xuggle.com/
xu‧ggle (zŭ' gl) v. To freely encode, decode, and experience audio and
video.

Use Xuggle to get the power of FFmpeg in Java.
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to