OK, I did some more research on these issues.

>That gets me past avcodec_open2, but there are still issues with writing
 audio.  The following returns 0 for no >error, but never fills got_packet with 
a true value.  I'm wondering if there's an issue of returning before 
>incrementing the stream when got_packet is zero. If the codec ignores the 
packet because of silent data, shouldn't >it still increment the stream?


>    e  = avcodec_encode_audio2(c, &pkt, frame, &got_packet);
>    if (!got_packet)
>        return;
>   pkt.stream_index = st->index;

placing the new stream index before the test appears to fix the problem.

   e  = avcodec_encode_audio2(c, &pkt, frame, &got_packet);
   pkt.stream_index = st->index;
    if (!got_packet)
        return;

>MP4 writing gives the error "non-strictly-monotonic PTS" when calling
>
>avcodec_encode_video(c, video_outbuf, video_outbuf_size, picture);
>

This error appears to have to do with mp4 not allowing variable frame rates.  
I'm assuming that if I increment PTS to an exact multiple of the fixed frame 
length, it will fix the problem.  I'll try that.
_______________________________________________
libav-api mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-api

Reply via email to