Hi, You need to use AVStream:time_base double dNbSeconds = (double)(pAVPacket->dts - pAVStream->first_dts) * pAVStream->time_base.num / pAVStream->time_base.den;
-----Message d'origine----- De : [email protected] [mailto:[email protected]] De la part de thanh nhan thanh nhan Envoyé : vendredi 8 mars 2013 04:00 À : [email protected] Objet : [Libav-user] Clip audio file with specified time range! 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! _______________________________________________ Libav-user mailing list [email protected] http://ffmpeg.org/mailman/listinfo/libav-user _______________________________________________ Libav-user mailing list [email protected] http://ffmpeg.org/mailman/listinfo/libav-user
