[Libav-user] FFMPEG seek Issue with mp3 songs

Michelle Cannon sai.ramesh51 at gmail.com
Thu Jan 1 10:09:42 CET 2015

Hi all. 
       I implemented one audio player using with ffmpeg for playing all
format audio files in android.I used following code for seek the song.

             int64_t seekTime = av_rescale_q(seekValue * AV_TIME_BASE,

				int64_t seekStreamDuration =

				int flags = AVSEEK_FLAG_BACKWARD;
				if (seekTime > 0 && seekTime < seekStreamDuration)
					flags |= AVSEEK_FLAG_ANY;
                int ret = av_seek_frame(fmt_ctx, seekStreamIndex,

				if (ret < 0)
					ret = av_seek_frame(fmt_ctx, seekStreamIndex, seekTime,

 Its working fine for most of the songs.But some of the mp3 songs getting
duration problem.For example if the song length is 2 mins if i seek the song
to some position then finally song ends with 2 mins 10 seconds.I get this
issue with only mp3 songs.Without seeking the same song ends with exact
time. I am using ffmpeg 2.1  The some code working fine with ffmpeg 0.11.1
Please provide any information about this issue.

View this message in context: http://libav-users.943685.n4.nabble.com/FFMPEG-seek-Issue-with-mp3-songs-tp4660741.html
Sent from the libav-users mailing list archive at Nabble.com.

More information about the Libav-user mailing list