[FFmpeg-devel] H264 encoding and RTP muxing - calculating pts and dts

Dominik Tomczak dominiktomczak
Tue Jul 20 13:40:15 CEST 2010


I can't use video4linux because
a) I compile under MinGW
b) For video frames capturing I use DirectShow interface.
How can I calculate DTS and PTS manually?

Regrads
Dominik

On Tue, Jul 20, 2010 at 1:35 PM, Luca Abeni <lucabe72 at email.it> wrote:

> Hi,
>
> I think this is a libav-user question, anyway...
>
> On 07/20/2010 12:56 PM, Dominik Tomczak wrote:
>
>> Hello
>>
>> My application uses libav libaries to encode frames with H264 and mux them
>> using RTP. The sequence is
>>
>> int encodedBytes = avcodec_encode_video
>> if (encodedBytes>  0)
>> {
>> AVPacket packet;
>> ...
>>
>> av_interleaved_write_frame(&packet)
>> }
>>
>> I get the video frames in RGB from my web camera, convert it to YUV but I
>> don't know how to set DTS and PTS values for packet.
>>
> You can use the video4linux2 input, and it will generate proper timestamps
> for the input frames; then, the H264 encoder will generate proper PTSs and
> DTSs based on the input timestamps, and you can use them for the RTP muxer.
>
> This basically is what ffmpeg.c does, and it works fairly well (just
> tested).
>
>
>                                Luca
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
>



-- 
Dominik Tomczak
Software Engineer
www.dominiktomczak.com



More information about the ffmpeg-devel mailing list