Opened 18 months ago

Last modified 18 months ago

#5450 new defect

MPEG2 -ss X with -frames:v 1 result in duplicate images

Reported by: kolpax Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I noticed that when exporting specific frames from a mpeg2video files, I get the same frame multiple times even though I specify different seeks. Only after exporting about a second worth of frames do I get a new image.

How to reproduce:

% ffmpeg -ss 7.000 -i input.mov -frames:v 1 output-1.jpeg
% ffmpeg -ss 7.040 -i input.mov -frames:v 1 output-2.jpeg
% ffmpeg -ss 7.080 -i input.mov -frames:v 1 output-3.jpeg

Output when rendering:

ffmpeg version 3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 7.3.0 (clang-703.0.29)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/3.0.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-libsnappy --enable-libfontconfig --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfaac --enable-libass --enable-ffplay --enable-libssh --enable-libspeex --enable-libschroedinger --enable-libfdk-aac --enable-openssl --enable-libopus --enable-frei0r --enable-libvidstab --enable-libx265 --enable-libwebp --enable-libzmq --enable-libdcadec --enable-librubberband --enable-libzimg --enable-libopenh264 --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-nonfree --enable-vda
  libavutil      55. 17.103 / 55. 17.103
  libavcodec     57. 24.102 / 57. 24.102
  libavformat    57. 25.100 / 57. 25.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 31.100 /  6. 31.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[mxf @ 0x7fb5b2000800] broken or empty index
[mxf @ 0x7fb5b2000800] Estimating duration from bitrate, this may be inaccurate
Guessed Channel Layout for  Input Stream #0.1 : 7.1
Input #0, mxf, from '/Users/kolpax/input.mxf':
  Metadata:
    uid             : adab4424-2f25-4dc7-92ff-29bd000c0000
    generation_uid  : adab4424-2f25-4dc7-92ff-29bd000c0001
    company_name    : FFmpeg
    product_name    : OP1a Muxer
    product_version : 56.40.101
    product_uid     : adab4424-2f25-4dc7-92ff-29bd000c0002
    modification_date: 0000-01-01 00:00:00
    material_package_umid: 0x060A2B340101010501010D00137EC7E9529471341F7EC7E900529471341F7E00
    timecode        : 13:16:19:19
  Duration: 00:00:33.38, start: 0.000000, bitrate: 59217 kb/s
    Stream #0:0: Video: mpeg2video (4:2:2), yuv422p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 50000 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
    Metadata:
      file_package_umid: 0x060A2B340101010501010D00137EC7E9529471341F7EC7E900529471341F7E01
    Stream #0:1: Audio: pcm_s24le, 48000 Hz, 8 channels, s32 (24 bit), 9216 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D00137EC7E9529471341F7EC7E900529471341F7E01
[swscaler @ 0x7fb5b3000600] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to 'output-1.jpeg':
  Metadata:
    uid             : adab4424-2f25-4dc7-92ff-29bd000c0000
    generation_uid  : adab4424-2f25-4dc7-92ff-29bd000c0001
    company_name    : FFmpeg
    product_name    : OP1a Muxer
    product_version : 56.40.101
    product_uid     : adab4424-2f25-4dc7-92ff-29bd000c0002
    modification_date: 0000-01-01 00:00:00
    material_package_umid: 0x060A2B340101010501010D00137EC7E9529471341F7EC7E900529471341F7E00
    timecode        : 13:16:19:19
    encoder         : Lavf57.25.100
    Stream #0:0: Video: mjpeg, yuvj422p(pc), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      file_package_umid: 0x060A2B340101010501010D00137EC7E9529471341F7EC7E900529471341F7E01
      encoder         : Lavc57.24.102 mjpeg
    Side data:
      unknown side data type 10 (24 bytes)
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (native) -> mjpeg (native))
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=9.1 Lsize=N/A time=00:00:00.04 bitrate=N/A dup=1 drop=1 speed=0.955x
video:128kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Change History (9)

comment:1 Changed 18 months ago by cehoyos

  • Component changed from ffmpeg to undetermined
  • Keywords frames:v -ss MPEG2 MXF removed
  • Priority changed from important to normal

Is this reproducible with current FFmpeg git head?

Aren't you just testing that your input stream contains I- and non-I-frames?

comment:2 Changed 18 months ago by kolpax

I will check with current git head.

It does look like it only outputs the I-frames, but when I put seek after input I get the correct frame. As far as I know seeking before input should return the same result.

comment:3 follow-up: Changed 18 months ago by kolpax

Here is one of the files I'm testing with: https://s3-eu-west-1.amazonaws.com/ffmpeg-ticket-5450/input.mxf

comment:4 Changed 18 months ago by ronag

Putting -ss before or after -i should give the same result. However, in this case it does not.

comment:5 Changed 18 months ago by cehoyos

Please provide an input sample.

comment:6 Changed 18 months ago by kolpax

The sample is provided in comment:3. Do I need to attach it to the issue instead?

comment:7 in reply to: ↑ 3 ; follow-up: Changed 18 months ago by cehoyos

Replying to kolpax:

Here is one of the files I'm testing with: https://s3-eu-west-1.amazonaws.com/ffmpeg-ticket-5450/input.mxf

403 Access denied

comment:8 Changed 18 months ago by kolpax

The 403 error has been fixed.

Last edited 18 months ago by kolpax (previous) (diff)

comment:9 in reply to: ↑ 7 Changed 18 months ago by kolpax

Replying to cehoyos:

Replying to kolpax:

Here is one of the files I'm testing with: https://s3-eu-west-1.amazonaws.com/ffmpeg-ticket-5450/input.mxf

403 Access denied

I have fixed the 403 issue, if you could take a look.

Note: See TracTickets for help on using tickets.