Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#4028 closed defect (invalid)

Videofilter "fps" to extract images each minute starts at 30 seconds offset

Reported by: peter_b Owned by:
Priority: normal Component: avfilter
Version: git-master Keywords: fps
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

I wanted to extract an image at exactly every minute from a video, as described in the wiki article "Create a thumbnail image every X seconds of the video".

I expected to get images for positions 0s, 60s, 120s, etc.
But the result is: 0s, 30s, 90s, 150s, etc.

How to reproduce:
1) Generate a testvideo with time-information (seconds) in the image:

ffmpeg -t 300 -f lavfi -i testsrc -an -y -c:v ffv1 test.avi

2) Extract images using the "fps" video filter:

ffmpeg_git -i test.avi -vf fps=fps=1/60 -f image2 image%03d.jpg

Complete, uncut console output:

ffmpeg version N-66851-gd58fa94 Copyright (c) 2000-2014 the FFmpeg developers
  built on Oct 14 2014 11:43:57 with gcc 4.4.5 (Debian 4.4.5-8)
  configuration: --prefix=/usr/local --enable-gpl --enable-nonfree --enable-version3 --enable-postproc --enable-swscale --enable-avfilter --enable-pthreads --enable-bzlib --enable-zlib --enable-libvorbis --enable-libopenjpeg --enable-decoder=png --enable-encoder=png --disable-decoder=jpeg2000 --enable-libfreetype --enable-libschroedinger --enable-libx264 --enable-libfaac --enable-libmp3lame
  libavutil      54. 10.100 / 54. 10.100
  libavcodec     56.  5.100 / 56.  5.100
  libavformat    56.  9.100 / 56.  9.100
  libavdevice    56.  1.100 / 56.  1.100
  libavfilter     5.  1.105 /  5.  1.105
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, avi, from 'test.avi':
  Metadata:
    encoder         : Lavf56.9.100
  Duration: 00:05:00.00, start: 0.000000, bitrate: 886 kb/s
    Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), bgr0, 320x240, 881 kb/s, SAR 1:1 DAR 4:3, 25 fps, 25 tbr, 25 tbn, 25 tbc
[swscaler @ 0x9abf040] deprecated pixel format used, make sure you did set range correctly
[mjpeg @ 0x9ad5180] bitrate tolerance 4000000 too small for bitrate 200000, overriding
Output #0, image2, to 'image%03d.jpg':
  Metadata:
    encoder         : Lavf56.9.100
    Stream #0:0: Video: mjpeg, yuvj444p(pc), 320x240 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 0.02 fps, 0.02 tbn, 0.02 tbc
    Metadata:
      encoder         : Lavc56.5.100 mjpeg
Stream mapping:
  Stream #0:0 -> #0:0 (ffv1 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
frame=    6 fps=0.3 q=1.6 Lsize=N/A time=00:06:00.00 bitrate=N/A
video:84kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

The images are taken from the following positions (in seconds):
0, 30, 90, 150, 210, 270

It should be:
0, 60, 120, 180, 240, 300

Change History (6)

comment:1 Changed 5 years ago by Cigaes

Look at the round option to fps. If down fixes your problem, please close this bug as “invalid”.

comment:2 Changed 5 years ago by peter_b

Will try that. Thank you very much :)

comment:3 Changed 5 years ago by peter_b

Using "-vf fps=fps=1/60:round=down" worked:
The images exported are now from the expected seconds: 0, 60, 120, 180, 240, etc.

Thanks :)

comment:4 Changed 5 years ago by peter_b

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

comment:5 Changed 5 years ago by cehoyos

  • Keywords fps added; thumbnail images removed

comment:6 Changed 5 years ago by cehoyos

Could you also comment on ticket #3339?

Note: See TracTickets for help on using tickets.