Opened 10 years ago

Last modified 7 years ago

#3752 open defect

can't seek to specified position in asf stream

Reported by: hxuanyu Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: asf seek
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

This video https://dl.dropboxusercontent.com/u/89678527/AVRO%20Close-up_Ned%201_07_08_2010_13_50_05.dvr-ms can be played successfully in ffplay and SMPlayer, but when use ffplay.exe -ss 00:00:10 to play from 10 seconds, the first frame read out is in fact the frame at about 20th second. Please see attachment the frame at 10th second, and the frame shown when ffplay.exe -ss 00:00:10 is called.

Below is the console output:

$ ffplay.exe -ss 00:00:10 AVRO\ Close-up_Ned\ 1_07_08_2010_13_50_05.dvr-ms
ffplay version N-64357-g42a92a2 Copyright (c) 2003-2014 the FFmpeg developers

built on Jul 1 2014 22:02:07 with gcc 4.8.3 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-decklink --enable-zlib
libavutil 52. 90.101 / 52. 90.101
libavcodec 55. 68.100 / 55. 68.100
libavformat 55. 44.100 / 55. 44.100
libavdevice 55. 13.101 / 55. 13.101
libavfilter 4. 9.100 / 4. 9.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100
libpostproc 52. 3.100 / 52. 3.100

[mp3 @ 03e485e0] Header missing 0KB vq= 0KB sq= 0B f=0/0
[mpeg2video @ 03e4a7c0] Invalid frame dimensions 0x0.

Last message repeated 8 times

Input #0, asf, from 'AVRO Close-up_Ned 1_07_08_2010_13_50_05.dvr-ms':

Metadata:

DVR Index Granularity: 500
WM/SubTitle : IJSkoude passie: de geschiedenis van het consumptieijs
WM/SubTitleDescription: Documentaireserie. In deze aflevering zien we hoe de Italianen in de 17de eeuw ontdekten hoe ze ijs konden bereiden, waarna de lekkernij zijn veroveringstocht begon.
genre : Varia,Muziek en kunst
WM/MediaCredits : ;;;
WM/OriginalReleaseTime: 0001-01-01T00:00:00Z
service_provider: Ned 1
service_name : Nederland 1
WM/MediaOriginalChannel: 1
WM/MediaOriginalBroadcastDateTime: 0001-01-01T00:00:00Z
WM/WMRVServiceID: 750832
WM/WMRVProgramID: !BE18453AACCFD179BB3844D07BAC1181!
WM/MediaOriginalRunTime: 1640261632
WM/WMRVEncodeTime: 18446744072897685192
WM/MediaIsStereo: 0
WM/VideoClosedCaptioning: 0
WM/MediaIsRepeat: 0
WM/MediaIsLive : 0
WM/MediaIsTape : 0
WM/MediaIsDelay : 0
WM/MediaIsSubtitled: 0
WM/MediaIsMovie : 0
WM/MediaIsPremiere: 0
WM/MediaIsFinale: 0
WM/MediaIsSAP : 0
WM/WMRVRequestID: 39127134
WM/WMRVScheduleItemID: 14235578
WM/WMRVQuality : 3
WM/WMRVOriginalSoftPrePadding: 18446744073709551496
WM/WMRVOriginalSoftPostPadding: 600
WM/WMRVActualSoftPrePadding: 0
WM/WMRVHardPrePadding: 0
WM/Provider : BDS
WM/ProviderCopyright: © 2010 Microsoft Corporation. Alle rechten voorbehouden. Servicevoorwaarden: http://go.microsoft.com/fwlink/?LinkId=8430

:

WM/WMRVEndTime : 409258576
WM/WMRVExpirationDate: 18446744073709551591
WM/WMRVBitrate : 1271310320
WM/WMRVKeepUntil: 18446744073709551615
WM/WMRVHardPostPadding: 0
WM/WMRVActualSoftPostPadding: 0
WM/WMRVContentProtectedPercent: 0
WM/WMRVInBandRatingSystem: 255
WM/WMRVInBandRatingLevel: 255
WM/WMRVInBandRatingAttributes: 0
WM/WMRVWatched : 0
WM/WMRVATSCContent: 0
WM/WMRVDTVContent: 1
WM/WMRVHDContent: 0
WM/WMRVContentProtected: 0
WM/MediaThumbTimeStamp: 1026284153
WM/MediaThumbWidth: 360
WM/MediaThumbHeight: 288
WM/MediaThumbStride: 1080
WM/MediaThumbRet: 0
WM/MediaThumbType: 3
WM/MediaThumbRatingSystem: 255
WM/MediaThumbRatingLevel: 255
WM/MediaThumbRatingAttributes: 0
WM/MediaThumbAspectRatioX: 16
WM/MediaThumbAspectRatioY: 9
WMFSDKVersion : 11.0.6002.18049
WMFSDKNeeded : 0.0.0.0000
VBR Peak : 159498240
title : AVRO Close-up
IsVBR : 1

Duration: 00:02:01.97, start: 11.818000,

Attachments (2)

SEEK_TO_10.JPG (346.9 KB ) - added by hxuanyu 10 years ago.
patchasfstarttime.diff (451 bytes ) - added by Carl Eugen Hoyos 7 years ago.

Download all attachments as: .zip

Change History (10)

by hxuanyu, 10 years ago

Attachment: SEEK_TO_10.JPG added

comment:1 by Carl Eugen Hoyos, 10 years ago

Keywords: asf added

Is the problem you see not reproducible with ffmpeg (the application)?

in reply to:  1 ; comment:2 by hxuanyu, 10 years ago

Replying to cehoyos:

Is the problem you see not reproducible with ffmpeg (the application)?

Hi, using ffmpeg -i input -ss xx:xx:xx -t tt:tt:tt out.mp4 can generated a video staring at xx:xx:xx. That means ffmpeg works ok.

I initially found this issue in our own program which calls ffmpeg API. In our program, the first complete frame read out after seek is 6-7 seconds after the position we seek to, although AVSEEK_FLAG_BACKWARD is specified in av_seek_frame

in reply to:  2 comment:3 by Carl Eugen Hoyos, 10 years ago

Replying to hxuanyu:

Replying to cehoyos:

Is the problem you see not reproducible with ffmpeg (the application)?

Hi, using ffmpeg -i input -ss xx:xx:xx -t tt:tt:tt out.mp4 can generated a video staring at xx:xx:xx. That means ffmpeg works ok.

Using ffmpeg -i input -ss x out.mp4 does not seek (so it does not test the issue you see).

Please test ffmpeg -ss x -i input out.mp4: If you see the same issue as with ffplay, please provide the ffmpeg command line that shows unexpected output together with the complete, uncut console output, consider using the "Code block".

comment:4 by hxuanyu, 10 years ago

Hi, below command was run to generate a mp4 video starting from 10th second of original video.

But the first frame of generated b.mp4 appears at 20th second in original video. So ffmpeg also has the problem.

$ ffmpeg.exe -ss 00:00:10 -i AVRO\ Close-up_Ned\ 1_07_08_2010_13_50_05.dvr-ms b.mp4
ffmpeg version N-64357-g42a92a2 Copyright (c) 2000-2014 the FFmpeg developers
  built on Jul  1 2014 22:02:07 with gcc 4.8.3 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-decklink --enable-zlib
  libavutil      52. 90.101 / 52. 90.101
  libavcodec     55. 68.100 / 55. 68.100
  libavformat    55. 44.100 / 55. 44.100
  libavdevice    55. 13.101 / 55. 13.101
  libavfilter     4.  9.100 /  4.  9.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
[mp3 @ 04143780] Header missing
[mpeg2video @ 028fdf60] Invalid frame dimensions 0x0.
    Last message repeated 8 times
Input #0, asf, from 'AVRO Close-up_Ned 1_07_08_2010_13_50_05.dvr-ms':
  Metadata:
    DVR Index Granularity: 500
    WM/SubTitle     : IJSkoude passie: de geschiedenis van het consumptieijs
    WM/SubTitleDescription: Documentaireserie. In deze aflevering zien we hoe de Italianen in de 17de eeuw ontdekten hoe ze ijs konden bereiden, waarna de lekkernij zijn veroveringstocht begon.
    genre           : Varia,Muziek en kunst
    WM/MediaCredits : ;;;
    WM/OriginalReleaseTime: 0001-01-01T00:00:00Z
    service_provider: Ned 1
    service_name    : Nederland 1
    WM/MediaOriginalChannel: 1
    WM/MediaOriginalBroadcastDateTime: 0001-01-01T00:00:00Z
    WM/WMRVServiceID: 750832
    WM/WMRVProgramID: !BE18453AACCFD179BB3844D07BAC1181!
    WM/MediaOriginalRunTime: 1640261632
    WM/WMRVEncodeTime: 18446744072897685192
    WM/MediaIsStereo: 0
    WM/VideoClosedCaptioning: 0
    WM/MediaIsRepeat: 0
    WM/MediaIsLive  : 0
    WM/MediaIsTape  : 0
    WM/MediaIsDelay : 0
    WM/MediaIsSubtitled: 0
    WM/MediaIsMovie : 0
    WM/MediaIsPremiere: 0
    WM/MediaIsFinale: 0
    WM/MediaIsSAP   : 0
    WM/WMRVRequestID: 39127134
    WM/WMRVScheduleItemID: 14235578
    WM/WMRVQuality  : 3
    WM/WMRVOriginalSoftPrePadding: 18446744073709551496
    WM/WMRVOriginalSoftPostPadding: 600
    WM/WMRVActualSoftPrePadding: 0
    WM/WMRVHardPrePadding: 0
    WM/Provider     : BDS
    WM/ProviderCopyright: © 2010 Microsoft Corporation. Alle rechten voorbehouden. Servicevoorwaarden: http://go.microsoft.com/fwlink/?LinkId=8430
                    :
    WM/WMRVEndTime  : 409258576
    WM/WMRVExpirationDate: 18446744073709551591
    WM/WMRVBitrate  : 1271310320
    WM/WMRVKeepUntil: 18446744073709551615
    WM/WMRVHardPostPadding: 0
    WM/WMRVActualSoftPostPadding: 0
    WM/WMRVContentProtectedPercent: 0
    WM/WMRVInBandRatingSystem: 255
    WM/WMRVInBandRatingLevel: 255
    WM/WMRVInBandRatingAttributes: 0
    WM/WMRVWatched  : 0
    WM/WMRVATSCContent: 0
    WM/WMRVDTVContent: 1
    WM/WMRVHDContent: 0
    WM/WMRVContentProtected: 0
    WM/MediaThumbTimeStamp: 1026284153
    WM/MediaThumbWidth: 360
    WM/MediaThumbHeight: 288
    WM/MediaThumbStride: 1080
    WM/MediaThumbRet: 0
    WM/MediaThumbType: 3
    WM/MediaThumbRatingSystem: 255
    WM/MediaThumbRatingLevel: 255
    WM/MediaThumbRatingAttributes: 0
    WM/MediaThumbAspectRatioX: 16
    WM/MediaThumbAspectRatioY: 9
    WMFSDKVersion   : 11.0.6002.18049
    WMFSDKNeeded    : 0.0.0.0000
    VBR Peak        : 159498240
    title           : AVRO Close-up
    IsVBR           : 1
  Duration: 00:02:01.97, start: 11.818000, bitrate: 7735 kb/s
    Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg), 200x200 [SAR 96:96 DAR 1:1], 90k tbr, 90k tbn, 90k tbc
    Metadata:
      title           : TV Thumbnail
      comment         : Movie/video screen capture
    Stream #0:1: Audio: mp2, 48000 Hz, stereo, s16p, 256 kb/s
    Stream #0:2: Video: mpeg2video (Main) (DVR  / 0x20525644), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], 6912 kb/s, 25 fps, 25 tbr, 1k tbn, 50 tbc
[libx264 @ 04193440] using SAR=64/45
[libx264 @ 04193440] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 04193440] profile High, level 3.0
[libx264 @ 04193440] 264 - core 142 r2431 ac76440 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[mp4 @ 0455e8e0] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
    Last message repeated 1 times
Output #0, mp4, to 'b.mp4':
  Metadata:
    DVR Index Granularity: 500
    WM/SubTitle     : IJSkoude passie: de geschiedenis van het consumptieijs
    WM/SubTitleDescription: Documentaireserie. In deze aflevering zien we hoe de Italianen in de 17de eeuw ontdekten hoe ze ijs konden bereiden, waarna de lekkernij zijn veroveringstocht begon.
    genre           : Varia,Muziek en kunst
    WM/MediaCredits : ;;;
    WM/OriginalReleaseTime: 0001-01-01T00:00:00Z
    service_provider: Ned 1
    service_name    : Nederland 1
    WM/MediaOriginalChannel: 1
    WM/MediaOriginalBroadcastDateTime: 0001-01-01T00:00:00Z
    WM/WMRVServiceID: 750832
    WM/WMRVProgramID: !BE18453AACCFD179BB3844D07BAC1181!
    WM/MediaOriginalRunTime: 1640261632
    WM/WMRVEncodeTime: 18446744072897685192
    WM/MediaIsStereo: 0
    WM/VideoClosedCaptioning: 0
    WM/MediaIsRepeat: 0
    WM/MediaIsLive  : 0
    WM/MediaIsTape  : 0
    WM/MediaIsDelay : 0
    WM/MediaIsSubtitled: 0
    WM/MediaIsMovie : 0
    WM/MediaIsPremiere: 0
    WM/MediaIsFinale: 0
    WM/MediaIsSAP   : 0
    WM/WMRVRequestID: 39127134
    WM/WMRVScheduleItemID: 14235578
    WM/WMRVQuality  : 3
    WM/WMRVOriginalSoftPrePadding: 18446744073709551496
    WM/WMRVOriginalSoftPostPadding: 600
    WM/WMRVActualSoftPrePadding: 0
    WM/WMRVHardPrePadding: 0
    WM/Provider     : BDS
    WM/ProviderCopyright: © 2010 Microsoft Corporation. Alle rechten voorbehouden. Servicevoorwaarden: http://go.microsoft.com/fwlink/?LinkId=8430
                    :
    WM/WMRVEndTime  : 409258576
    WM/WMRVExpirationDate: 18446744073709551591
    WM/WMRVBitrate  : 1271310320
    WM/WMRVKeepUntil: 18446744073709551615
    WM/WMRVHardPostPadding: 0
    WM/WMRVActualSoftPostPadding: 0
    WM/WMRVContentProtectedPercent: 0
    WM/WMRVInBandRatingSystem: 255
    WM/WMRVInBandRatingLevel: 255
    WM/WMRVInBandRatingAttributes: 0
    WM/WMRVWatched  : 0
    WM/WMRVATSCContent: 0
    WM/WMRVDTVContent: 1
    WM/WMRVHDContent: 0
    WM/WMRVContentProtected: 0
    WM/MediaThumbTimeStamp: 1026284153
    WM/MediaThumbWidth: 360
    WM/MediaThumbHeight: 288
    WM/MediaThumbStride: 1080
    WM/MediaThumbRet: 0
    WM/MediaThumbType: 3
    WM/MediaThumbRatingSystem: 255
    WM/MediaThumbRatingLevel: 255
    WM/MediaThumbRatingAttributes: 0
    WM/MediaThumbAspectRatioX: 16
    WM/MediaThumbAspectRatioY: 9
    WMFSDKVersion   : 11.0.6002.18049
    WMFSDKNeeded    : 0.0.0.0000
    VBR Peak        : 159498240
    title           : AVRO Close-up
    IsVBR           : 1
    encoder         : Lavf55.44.100
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc
    Metadata:
      encoder         : Lavc55.68.100 libx264
    Stream #0:1: Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16, 128 kb/s
    Metadata:
      encoder         : Lavc55.68.100 libvo_aacenc
Stream mapping:
  Stream #0:2 -> #0:0 (mpeg2video (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (mp2 (native) -> aac (libvo_aacenc))
Press [q] to stop, [?] for help
[mp2 @ 04140de0] Header missing
Error while decoding stream #0:1: Invalid data found when processing input
[mp2 @ 04140de0] incomplete frame  18080kB time=00:01:51.54 bitrate=1327.9kbits/s dup=297 drop=0
Error while decoding stream #0:1: Invalid data found when processing input
[mpeg2video @ 04194240] ac-tex damaged at 31 20
[mpeg2video @ 04194240] Warning MVs not available
[mpeg2video @ 04194240] concealing 720 DC, 720 AC, 720 MV errors in B frame
frame= 2812 fps= 73 q=-1.0 Lsize=   18664kB time=00:01:52.40 bitrate=1360.3kbits/s dup=297 drop=0
video:17011kB audio:1574kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.427659%
[libx264 @ 04193440] frame I:24    Avg QP:21.13  size: 55253
[libx264 @ 04193440] frame P:1085  Avg QP:23.94  size: 12044
[libx264 @ 04193440] frame B:1703  Avg QP:27.85  size:  1776
[libx264 @ 04193440] consecutive B-frames:  3.9% 34.9% 33.8% 27.5%
[libx264 @ 04193440] mb I  I16..4: 10.3% 77.0% 12.7%
[libx264 @ 04193440] mb P  I16..4:  1.5%  4.4%  0.5%  P16..4: 39.9% 17.3% 11.0%  0.0%  0.0%    skip:25.3%
[libx264 @ 04193440] mb B  I16..4:  0.1%  0.1%  0.0%  B16..8: 30.7%  2.9%  0.7%  direct: 1.8%  skip:63.8%  L0:36.2% L1:54.7% BI: 9.1%
[libx264 @ 04193440] 8x8 transform intra:70.2% inter:74.9%
[libx264 @ 04193440] coded y,uvDC,uvAC intra: 64.5% 63.4% 25.4% inter: 17.0% 15.8% 0.8%
[libx264 @ 04193440] i16 v,h,dc,p: 33% 30%  7% 30%
[libx264 @ 04193440] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 19% 27%  4%  5%  5%  7%  5%  7%
[libx264 @ 04193440] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 34% 11%  4%  5%  5%  6%  5%  6%
[libx264 @ 04193440] i8c dc,h,v,p: 49% 22% 24%  5%
[libx264 @ 04193440] Weighted P-Frames: Y:0.5% UV:0.2%
[libx264 @ 04193440] ref P L0: 60.8% 16.0% 16.4%  6.9%  0.0%
[libx264 @ 04193440] ref B L0: 85.4% 12.8%  1.8%
[libx264 @ 04193440] ref B L1: 95.1%  4.9%
[libx264 @ 04193440] kb/s:1238.86


comment:5 by Carl Eugen Hoyos, 10 years ago

Component: undeterminedavformat
Keywords: seek added
Reproduced by developer: set
Status: newopen
Version: unspecifiedgit-master

The following command produces a frame approximately 13 seconds from the start:

$ ffmpeg -ss 1 -i AVRO\ Close-up_Ned\ 1_07_08_2010_13_50_05.dvr-ms -vframes 1 out.jpg

The following command produces a frame approximately 72 seconds from the start:

$ ffmpeg -ss 60 -i AVRO\ Close-up_Ned\ 1_07_08_2010_13_50_05.dvr-ms -vframes 1 out.jpg

Seeking backwards by ten seconds with ffplay actually seeks forward a little, seeking by 60 seconds forward seeks >70 seconds, seeking by 60 seconds backwards seeks around 48 seconds backward.
May be related to the starttime.

comment:6 by Carl Eugen Hoyos, 10 years ago

Summary: can't seek to specified positioncan't seek to specified position in asf stream

comment:7 by hxuanyu, 10 years ago

hi, any update on this issue? Thanks :D

by Carl Eugen Hoyos, 7 years ago

Attachment: patchasfstarttime.diff added

comment:8 by Carl Eugen Hoyos, 7 years ago

Attached patch is not correct, it (for example) breaks seeking for the sample from ticket #2572.

Note: See TracTickets for help on using tickets.