[FFmpeg-trac] #2674(avfilter:new): fps filter changes video length
FFmpeg
trac at avcodec.org
Sun Jun 16 13:43:30 CEST 2013
#2674: fps filter changes video length
--------------------------------------+----------------------------------
Reporter: cehoyos | Owner:
Type: defect | Status: new
Priority: normal | Component: avfilter
Version: git-master | Keywords: fps
Blocked By: | Blocking:
Reproduced by developer: 0 | Analyzed by developer: 0
--------------------------------------+----------------------------------
The fps filter fails for the last frame and changes video length.
{{{$ ffmpeg -f lavfi -i testsrc=r=24 -t 1 -qscale 2 24fps.avi}}}
{{{
$ ffmpeg -loglevel verbose -i 24fps.avi -vf fps=48 48fps.avi
ffmpeg version N-54036-g6c4516d Copyright (c) 2000-2013 the FFmpeg
developers
built on Jun 15 2013 18:04:13 with gcc 4.7 (SUSE Linux)
configuration: --enable-gpl --disable-indev=jack
libavutil 52. 35.101 / 52. 35.101
libavcodec 55. 16.100 / 55. 16.100
libavformat 55. 8.102 / 55. 8.102
libavdevice 55. 2.100 / 55. 2.100
libavfilter 3. 77.101 / 3. 77.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100
Input #0, avi, from '24fps.avi':
Metadata:
encoder : Lavf55.8.102
Duration: 00:00:01.00, start: 0.000000, bitrate: 363 kb/s
Stream #0:0: Video: mpeg4 (Simple Profile) (FMP4 / 0x34504D46),
yuv420p, 320x240 [SAR 1:1 DAR 4:3], 24 tbr, 24 tbn, 24 tbc
[Parsed_fps_0 @ 0x2c7cfe0] fps=48/1
[graph 0 input from stream 0:0 @ 0x2c7d9c0] w:320 h:240 pixfmt:yuv420p
tb:1/24 fr:24/1 sar:1/1 sws_param:flags=2
Output #0, avi, to '48fps.avi':
Metadata:
ISFT : Lavf55.8.102
Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 320x240 [SAR
1:1 DAR 4:3], q=2-31, 200 kb/s, 48 tbn, 48 tbc
Stream mapping:
Stream #0:0 -> #0:0 (mpeg4 -> mpeg4)
Press [q] to stop, [?] for help
No more output streams to write to, finishing.
frame= 47 fps=0.0 q=2.0 Lsize= 66kB time=00:00:00.97 bitrate=
553.6kbits/s
video:59kB audio:0kB subtitle:0 global headers:0kB muxing overhead
11.355420%
[Parsed_fps_0 @ 0x2c7cfe0] 24 frames in, 47 frames out; 0 frames dropped,
23 frames duplicated.
}}}
{{{
$ ffmpeg -loglevel verbose -i 24fps.avi -vf fps=12 12fps.avi
ffmpeg version N-54036-g6c4516d Copyright (c) 2000-2013 the FFmpeg
developers
built on Jun 15 2013 18:04:13 with gcc 4.7 (SUSE Linux)
configuration: --enable-gpl --disable-indev=jack
libavutil 52. 35.101 / 52. 35.101
libavcodec 55. 16.100 / 55. 16.100
libavformat 55. 8.102 / 55. 8.102
libavdevice 55. 2.100 / 55. 2.100
libavfilter 3. 77.101 / 3. 77.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100
Input #0, avi, from '24fps.avi':
Metadata:
encoder : Lavf55.8.102
Duration: 00:00:01.00, start: 0.000000, bitrate: 363 kb/s
Stream #0:0: Video: mpeg4 (Simple Profile) (FMP4 / 0x34504D46),
yuv420p, 320x240 [SAR 1:1 DAR 4:3], 24 tbr, 24 tbn, 24 tbc
[Parsed_fps_0 @ 0x1c24fe0] fps=12/1
[graph 0 input from stream 0:0 @ 0x1c259c0] w:320 h:240 pixfmt:yuv420p
tb:1/24 fr:24/1 sar:1/1 sws_param:flags=2
Output #0, avi, to '12fps.avi':
Metadata:
ISFT : Lavf55.8.102
Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 320x240 [SAR
1:1 DAR 4:3], q=2-31, 200 kb/s, 12 tbn, 12 tbc
Stream mapping:
Stream #0:0 -> #0:0 (mpeg4 -> mpeg4)
Press [q] to stop, [?] for help
No more output streams to write to, finishing.
frame= 13 fps=0.0 q=1.6 Lsize= 37kB time=00:00:01.08 bitrate=
277.6kbits/s
video:31kB audio:0kB subtitle:0 global headers:0kB muxing overhead
19.286666%
[Parsed_fps_0 @ 0x1c24fe0] 24 frames in, 13 frames out; 11 frames dropped,
0 frames duplicated.
}}}
The second case - {{{-vf fps=12}}} - can be fixed by using {{{-vf
fps=12:zero}}} (and {{{-vf fps=12:down}}}) but I wonder why this is
necessary when dividing an even frame-rate by two.
--
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2674>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list