[Libav-user] Clip audio file with specified time range!

thanh nhan thanh nhan nhanndt_87 at yahoo.com
Fri Mar 8 04:00:02 CET 2013

Hi all,
Does anyone know how to clip audio file with specified time range in second ( like int star_time, end_time) using ffmpeg functions.
My current status is I am running a while loop:
while (av_read_frame(formatContext, &packet) == 0)
   int frameFinished = 0;
   avcodec_decode_audio4(codecContext, frame, &frameFinished, &packet);
   // do somthing
I found some fields in AVStream and AVFrame that introduce time-base, time-stamp... but i don't clearly what they mean. How can i translate those kinds of time in to real time unit( second or milisecond)
Thanks in advance!

More information about the Libav-user mailing list