Thanks, Luca.

I need to write both audio and video, so I *have* to use interleaved
frames, right?

I was trying to read up on the pts value yesterday, but I'm a little
unclear what to set it to. I have the time the packet was captured (in
milliseconds) and the time of the first packet in the stream, but I'm
not sure how that fits in with the AVStream->time_base units. If I'm
capping at 25 FPS, do I simply calculate (from my own timestamps)
which frame I'm passing the encoder?

What if packets are dropped? Do I need to manually feed the encoder
the previous frame for all the dropped frames, or does the encoder
know how to handle this case if there's a gap in the pts value?

Cheers,
Soren

On Thu, Dec 29, 2011 at 7:44 AM, Luca Barbato <[email protected]> wrote:
> On 28/12/11 20:57, Soren Dreijer wrote:
>>
>> Heya,
>>
>> I’m capturing video frames from a Direct3D application and I’d like to
>> encode them with libav to a video. Since I’m essentially capturing
>> live from the Direct3D application, I can’t guarantee that my frames
>> are happening right on the 1/<fps>  mark (but I do have the capture
>> time, of course).
>>
>> How do I properly set the presentation time for the individual video
>> frames when calling av_interleaved_write_frame()? The example
>> ‘output-example.c’ assumes all frames are right on the 1/25 mark.
>
>
> Just set pts according to what you get, that should be enough, best results
> could be achieved using a non-interleaving write_frame() though.
>
> lu
>
> --
>
> Luca Barbato
> Gentoo/linux
> http://dev.gentoo.org/~lu_zero
>
> _______________________________________________
> libav-api mailing list
> [email protected]
> https://lists.libav.org/mailman/listinfo/libav-api
_______________________________________________
libav-api mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-api

Reply via email to