It wasn't in extradata but you gave me an idea :-). It was a combination of two mistakes. I passed corrupted timestamps to the H.264 encoder and I called avformat_write_header before avcodec_open2. If you want to see the code, it's available at:
https://code.google.com/p/jlibav/ Thanks for help. 2013/5/10 Anton Khirnov <[email protected]> > > On Thu, 9 May 2013 22:57:36 +0200, Ondřej Perutka < > [email protected]> wrote: > > Hello, > > > > I compiled Libav with enabled libx264 and tried to encode a video using > my > > application and H.264 encoder. The result was quite surprising. The video > > stream from the resulting file could not be played although encoding > passed > > with no error and audio stream from the same file was OK. > > > > Using different container makes no change. Video stream works fine if I > use > > another encoder (e.g. mpeg4, flv, h263p, mpeg2 etc.). > > > > I compared encoding codec context in my application and avconv using gdb. > > There were no differences. But there were big differences in resulting > file > > from my application and avconv (using same encoder settings). The result > > from avconv worked fine and was about 4 times smaller. > > > > When I tried to open and decode the result from my app, the pix_fmt field > > of the decoder context was set to NONE and the decoder was refusing all > > video packets from the stream. > > > > Do you have any idea where could be a problem? > > > > Hard to say anything specific without seeing your code or at least the > encoded > file. A wild guess could be missing extradata. > Also, does the decoder print any errors or just fails silently? > > -- > Anton Khirnov > _______________________________________________ libav-api mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-api
