[Libav-user] write audio packets to file

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[Libav-user] write audio packets to file

Prakash Rokade

I am trying to write audio packet to file using ffmpeg.
The source device sending the packet after some interval.

e.g. First packet has a time stamp 00:00:00 
Second packet has a time stamp 00:00:00.5000000
Third packet has a time stamp 00:00:01
And so on...

Means two packet per second.

I want to encode those packets and write to a file.

I am referring the Ffmpeg example from link Muxing.c

While encoding and writing there is no error. But output file has only 2 sec audio duration and speed is also super fast.

The video frames are proper according the settings.

I think the problem is related to calculation of pts, dts and duration of packet.

Suggest me how to calculate proper values for pts, dts and duration. Or if this problem related to other thing let me know how i can resolve the problem.

Libav-user mailing list
[hidden email]