Opened 7 years ago

Closed 7 years ago

#6285 closed defect (fixed)

ffmpeg hangs when using framerate filter since filtering rework

Reported by: Marton Balint Owned by:
Priority: important Component: avfilter
Version: git-master Keywords: regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:

Since the recent filtering changes (around 02aa0701ae0dc2def8db640c9e3c06dc1b5de70c) ffmpeg.c hangs because always EAGAIN is returned in transcode_step when using framerate filter with certain input timestamps.

How to reproduce:

% ./ffmpeg -y -i out.mp4 -vf framerate=50 out.avi
ffmpeg version N-84804-g247d033 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 4.8 (SUSE Linux)
  configuration: --disable-vaapi --enable-vdpau --enable-gpl --enable-libfreetype --enable-libzvbi --enable-libass --enable-frei0r --enable-openssl --enable-nonfree --enable-libx264 --enable-libfdk-aac --enable-nonfree --enable-libvorbis --enable-decklink --enable-libmp3lame --enable-openal --enable-libiec61883
  libavutil      55. 52.100 / 55. 52.100
  libavcodec     57. 86.103 / 57. 86.103
  libavformat    57. 68.100 / 57. 68.100
  libavdevice    57.  3.101 / 57.  3.101
  libavfilter     6. 78.101 /  6. 78.101
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'out.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.68.100
  Duration: 00:00:02.93, start: 0.100000, bitrate: 22 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 32x32, 17 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mpeg4 (native))
Press [q] to stop, [?] for help
[Parsed_framerate_0 @ 0x356ea00] time base:1/15360 -> 1/76800 exact:1
[Parsed_framerate_0 @ 0x356ea00] fps -> fps:50/1 scene score:7.000000 interpolate start:15 end:240
[mpeg4 @ 0x349b4e0] too many threads/slices (3), reducing to 2
Output #0, avi, to 'out.avi':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    ISFT            : Lavf57.68.100
    Stream #0:0(eng): Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 32x32, q=2-31, 200 kb/s, 50 fps, 50 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc57.86.103 mpeg4
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame=  132 fps= 38 q=2.0 Lsize=      34kB time=00:00:02.64 bitrate= 105.6kbits/s speed=0.759x    
video:25kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 34.369095%
Exiting normally, received signal 2.

Attachments (1)

out.mp4 (8.2 KB ) - added by Marton Balint 7 years ago.

Download all attachments as: .zip

Change History (4)

by Marton Balint, 7 years ago

Attachment: out.mp4 added

comment:1 by Carl Eugen Hoyos, 7 years ago

Reproduced by developer: set
Status: newopen

comment:2 by Cigaes, 7 years ago

The request_frame() method of framerate returns 0 without sending a frame to its output. This is a bug in framerate. The new scheduling of filters is more strict, but it was already a break of internal API before.

The code path goes through the final line of request_frame():

return process_work_frame(ctx, 0);

and the block in process_work_frame() that starts with:

// should filter be skipping input frame (output frame rate is lower than input frame rate)

I do not know how framerate works, so I can not investigate further.

comment:3 by Marton Balint, 7 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.