[Libav-user] write audio packets to file

Prakash Rokade prakash.rokade420 at gmail.com
Thu Feb 23 08:03:45 EET 2017


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
<https://www.ffmpeg.org/doxygen/3.2/muxing_8c-example.html>

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20170223/6fbd1ccc/attachment.html>


More information about the Libav-user mailing list