[FFmpeg-trac] #2877(undetermined:new): Unable to rewind/seek a mp3

FFmpeg trac at avcodec.org
Fri Sep 20 09:28:37 CEST 2013


#2877: Unable to rewind/seek a mp3
-------------------------------------+-------------------------------------
             Reporter:  jpo38        |                    Owner:
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
              Version:  unspecified  |  undetermined
             Keywords:  seek         |               Resolution:
             Blocking:               |               Blocked By:
Analyzed by developer:  0            |  Reproduced by developer:  0
-------------------------------------+-------------------------------------

Comment (by jpo38):

 Thank you for investigating this problem.

 When I read my mp3 files, AVFormatContext::start_time is 0, so I suspect
 my file starts with timestamp 0, right?

 I replaced
 av_seek_frame( container, audio_stream, 0, AVSEEK_FLAG_FRAME );
 by
 avformat_seek_file( container, audio_stream, INT64_MIN,
 container->start_time, INT64_MAX, 0 )

 No change. I can still see the bug.

 I ran {{{ffprobe IN.mp3 -read_intervals "%2,0%2" -of compact
 -show_packets}}}

 Here is the output (truncated):

 {{{
 packet|codec_type=audio|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=417|pos=461|flags=K
 packet|codec_type=audio|stream_index=0|pts=368640|pts_time=0.026122|dts=368640|dts_time=0.026122|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=878|flags=K
 packet|codec_type=audio|stream_index=0|pts=737280|pts_time=0.052245|dts=737280|dts_time=0.052245|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=1296|flags=K
 packet|codec_type=audio|stream_index=0|pts=1105920|pts_time=0.078367|dts=1105920|dts_time=0.078367|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=1714|flags=K
 packet|codec_type=audio|stream_index=0|pts=1474560|pts_time=0.104490|dts=1474560|dts_time=0.104490|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=2132|flags=K
 packet|codec_type=audio|stream_index=0|pts=1843200|pts_time=0.130612|dts=1843200|dts_time=0.130612|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=2550|flags=K
 packet|codec_type=audio|stream_index=0|pts=2211840|pts_time=0.156735|dts=2211840|dts_time=0.156735|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=2968|flags=K
 packet|codec_type=audio|stream_index=0|pts=2580480|pts_time=0.182857|dts=2580480|dts_time=0.182857|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=3386|flags=K
 packet|codec_type=audio|stream_index=0|pts=2949120|pts_time=0.208980|dts=2949120|dts_time=0.208980|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=3804|flags=K
 packet|codec_type=audio|stream_index=0|pts=3317760|pts_time=0.235102|dts=3317760|dts_time=0.235102|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=4222|flags=K
 packet|codec_type=audio|stream_index=0|pts=3686400|pts_time=0.261224|dts=3686400|dts_time=0.261224|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=4640|flags=K
 packet|codec_type=audio|stream_index=0|pts=4055040|pts_time=0.287347|dts=4055040|dts_time=0.287347|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=5058|flags=K
 packet|codec_type=audio|stream_index=0|pts=4423680|pts_time=0.313469|dts=4423680|dts_time=0.313469|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=5476|flags=K
 packet|codec_type=audio|stream_index=0|pts=4792320|pts_time=0.339592|dts=4792320|dts_time=0.339592|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=5894|flags=K
 packet|codec_type=audio|stream_index=0|pts=5160960|pts_time=0.365714|dts=5160960|dts_time=0.365714|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=6312|flags=K
 packet|codec_type=audio|stream_index=0|pts=5529600|pts_time=0.391837|dts=5529600|dts_time=0.391837|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=6730|flags=K
 packet|codec_type=audio|stream_index=0|pts=5898240|pts_time=0.417959|dts=5898240|dts_time=0.417959|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=7148|flags=K

 ...

 packet|codec_type=audio|stream_index=0|pts=26542080|pts_time=1.880816|dts=26542080|dts_time=1.880816|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=30554|flags=K
 packet|codec_type=audio|stream_index=0|pts=26910720|pts_time=1.906939|dts=26910720|dts_time=1.906939|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=30972|flags=K
 packet|codec_type=audio|stream_index=0|pts=27279360|pts_time=1.933061|dts=27279360|dts_time=1.933061|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=417|pos=31390|flags=K
 packet|codec_type=audio|stream_index=0|pts=27648000|pts_time=1.959184|dts=27648000|dts_time=1.959184|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=31807|flags=K
 packet|codec_type=audio|stream_index=0|pts=28016640|pts_time=1.985306|dts=28016640|dts_time=1.985306|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=32225|flags=K
 packet|codec_type=audio|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=417|pos=461|flags=K
 packet|codec_type=audio|stream_index=0|pts=368640|pts_time=0.026122|dts=368640|dts_time=0.026122|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=878|flags=K
 packet|codec_type=audio|stream_index=0|pts=737280|pts_time=0.052245|dts=737280|dts_time=0.052245|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=1296|flags=K
 packet|codec_type=audio|stream_index=0|pts=1105920|pts_time=0.078367|dts=1105920|dts_time=0.078367|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=1714|flags=K
 packet|codec_type=audio|stream_index=0|pts=1474560|pts_time=0.104490|dts=1474560|dts_time=0.104490|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=2132|flags=K
 packet|codec_type=audio|stream_index=0|pts=1843200|pts_time=0.130612|dts=1843200|dts_time=0.130612|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=2550|flags=K
 packet|codec_type=audio|stream_index=0|pts=2211840|pts_time=0.156735|dts=2211840|dts_time=0.156735|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=2968|flags=K
 packet|codec_type=audio|stream_index=0|pts=2580480|pts_time=0.182857|dts=2580480|dts_time=0.182857|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=3386|flags=K
 packet|codec_type=audio|stream_index=0|pts=2949120|pts_time=0.208980|dts=2949120|dts_time=0.208980|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=3804|flags=K
 packet|codec_type=audio|stream_index=0|pts=3317760|pts_time=0.235102|dts=3317760|dts_time=0.235102|duration=368640|duration_time=0.026122|convergence_duration=N/A|convergence_duration_time=N/A|size=418|pos=4222|flags=K

 ...

 }}}

 Looks like you read the file twice and you're getting the same number of
 data. It works the same for me, only the data I read (when converted to
 float/double) are not the same....
 Did you try to compile my sample? It's very straightforward. It reads the
 file once, rewinds and reads again. It then compares data. We read the
 same number of samples but not the same values...

 Jean

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2877#comment:10>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list