Opened 5 years ago

Closed 5 years ago

#389 closed defect (fixed)

Problem seeking in MPEG TS/H.264 files

Reported by: takis Owned by:
Priority: normal Component: avformat
Version: git Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

When seeking to a specific time in a MPEG-TS file, seeking silently fails.

Thus, av_seek_frame( format_context, videostream, pts, AVSEEK_FLAG_ANY ); results in a seek to the first timestamp in the file (126000), and av_seek_frame returns 0 indicating that the seek succeeded.

The sample was generated with FFmpeg+libx264.

ffprobe version N-31788-g0d4ea7b, Copyright (c) 2007-2011 the FFmpeg developers

built on Aug 10 2011 15:46:07 with gcc 4.5.2
configuration:
libavutil 51. 11. 1 / 51. 11. 1
libavcodec 53. 10. 0 / 53. 10. 0
libavformat 53. 6. 0 / 53. 6. 0
libavdevice 53. 2. 0 / 53. 2. 0
libavfilter 2. 28. 1 / 2. 28. 1
libswscale 2. 0. 0 / 2. 0. 0

Continuity Check Failed
Continuity Check Failed
Continuity Check Failed
Continuity Check Failed
Input #0, mpegts, from '/srv/files/videos/seekbug01min.ts':

Duration: 00:00:00.45, start: 1.400000, bitrate: 178 kb/s
Program 1

Metadata:

service_name : Big Buck Bunny
service_provider: FFmpeg

Stream #0.0[0x100]: Video: h264 (Constrained Baseline), yuv420p, 320x180 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 90k tbn, 48 tbc
Stream #0.1[0x101](und): Audio: mp2, 48000 Hz, stereo, s16, 64 kb/s

PS: The bugreport page indicates that one should upload samples to the incoming dir on the ffmpeg ftp server, but there is no incoming dir.

Attachments (2)

seekbug01min.ts (10.0 KB) - added by takis 5 years ago.
MPEG-TS file containing H.264 and MPEG layer 2 audio
ffseekbug.c (2.6 KB) - added by takis 5 years ago.
Sample C code

Download all attachments as: .zip

Change History (6)

Changed 5 years ago by takis

MPEG-TS file containing H.264 and MPEG layer 2 audio

Changed 5 years ago by takis

Sample C code

comment:1 Changed 5 years ago by takis

The file was encoded using the "fastdecode" and "ultrafast" x264 settings, thus
no B-frames are used.

comment:2 Changed 5 years ago by cehoyos

Could you test if this issue is still reproducible with current git head?

comment:3 Changed 5 years ago by takis

I've just tested this, and it appears to work in git head.

Using git bisect I found the commit which appears to have fixed it:
commit 27f7589ab1ad0f6d2694d713e176dfa234662e60
Author: Michael Niedermayer <michaelni@gmx.at>
Date: Fri Oct 21 20:45:00 2011 +0200

seek: Fix av_gen_search() so that seeks outside max/min do not successfully seek to random
points but rather seek to the min/max.

comment:4 Changed 5 years ago by cehoyos

  • Resolution set to fixed
  • Status changed from new to closed

Thank you for testing!

Note: See TracTickets for help on using tickets.