[Libav-user] About output_example.c

Vincent,Wei weikun0905 at gmail.com
Mon Apr 18 05:16:50 CEST 2011


Hi,all

     I am a new user of ffmpeg, I need to change the RTP packet to the avi
file,used the H264 encoder, so I read the code of output_example.c. And I
had tried to genrerate a test.avi file just like the example.
    There are some question about the result:
    (1) When I use the .avi as the extensions, it uesd the CODEC_ID_MPEG4 as
default , I had found that it is defined at the avienc.c line:562
       AVOutputFormat avi_muxer = {
       .....
      CODEC_ID_MP2,
      CODEC_ID_MPEG4,
       .....
       };
      I had try to change it to the CODEC_ID_H264, but when I try to
genrerat the test.avi again, I found that it can't work rightly,error as
follow:
      error, non monotone timestamps -368934881474191031 >=
-368934881474191031
     Error while writing video frame .
     Why?

(2) When I edit the output_example.c line:445
       fmt = guess_format("h264", filename, NULL);
      I also set the .avi as the extensions, but it can't generate the avi
format file(alougth the file look like .avi extension name,but the format do
not fit the avi format standard).
      It generate the file which fit the .264 file format ,so it is turly
encode as the h264, but I need the avi file.

(3) The example is worked as the YUV420 as input data, but my data source
had already been encoded as H264(RTP packet payload),
     I thought that I may not need to change the data to YUV first, it's not
efficient.
     I means that if the data is already the encoded ,the
avcodec_encode_video() may not be called? If it is right,av_write_frame()
need what data as the input data ? raw h264 data ?or some others??

How can I use the ffmpeg to help me do the work?

That is all, so many questions for all of you, please help me, thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20110418/0e63c98d/attachment.html>


More information about the Libav-user mailing list