[FFmpeg-trac] #8990(undetermined:new): Filter Complex does not respect filter_complex_threads

FFmpeg trac at avcodec.org
Tue Nov 17 06:28:09 EET 2020


#8990: Filter Complex does not respect filter_complex_threads
-------------------------------------+-------------------------------------
             Reporter:  shravan2x    |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:  git-
  undetermined                       |  master
             Keywords:               |               Blocked By:
  filter_complex_threads             |
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:
 I'm trying to generate a strip of thumbnails using FFmpeg. The
 requirements for this strip are:
 1. N thumbnails at even intervals (10 in the example below)
 2. Aspect ratio of each thumbnail preserved, but bounded by some fixed
 size maxW, maxH (480:270 in the example below)

 To do this I calculate the video duration and target resolution in my
 program, then generate the command below and run it as a child process.
 Since I do this in parallel, I need each instance to run in a single CPU
 core. I tried to use -threads 1 and -filter_complex_threads 1 to do this
 but it doesn't seem to work (I monitored CPU usage using htop). It runs on
 a single core until the "vstack -> Stream #0:0 (mjpeg)" output line
 prints, and then all CPUs run at ~20-30%.

 {{{
 ./ffmpeg
 -ss 00:00:57.6363636 -i "bbb_sunflower_2160p_60fps_normal.mp4"
 -ss 00:01:55.2727272 -i "bbb_sunflower_2160p_60fps_normal.mp4"
 -ss 00:02:52.9090908 -i "bbb_sunflower_2160p_60fps_normal.mp4"
 -ss 00:03:50.5454544 -i "bbb_sunflower_2160p_60fps_normal.mp4"
 -ss 00:04:48.1818180 -i "bbb_sunflower_2160p_60fps_normal.mp4"
 -ss 00:05:45.8181816 -i "bbb_sunflower_2160p_60fps_normal.mp4"
 -ss 00:06:43.4545452 -i "bbb_sunflower_2160p_60fps_normal.mp4"
 -ss 00:07:41.0909088 -i "bbb_sunflower_2160p_60fps_normal.mp4"
 -ss 00:08:38.7272724 -i "bbb_sunflower_2160p_60fps_normal.mp4"
 -ss 00:09:36.3636360 -i "bbb_sunflower_2160p_60fps_normal.mp4"
 -threads 1 -filter_complex_threads 1 -filter_complex "
 [0]trim=end_frame=1,scale=480:270,setpts=N[v0];
 [1]trim=end_frame=1,scale=480:270,setpts=N[v1];
 [2]trim=end_frame=1,scale=480:270,setpts=N[v2];
 [3]trim=end_frame=1,scale=480:270,setpts=N[v3];
 [4]trim=end_frame=1,scale=480:270,setpts=N[v4];
 [5]trim=end_frame=1,scale=480:270,setpts=N[v5];
 [6]trim=end_frame=1,scale=480:270,setpts=N[v6];
 [7]trim=end_frame=1,scale=480:270,setpts=N[v7];
 [8]trim=end_frame=1,scale=480:270,setpts=N[v8];
 [9]trim=end_frame=1,scale=480:270,setpts=N[v9];
 [v0][v1][v2][v3][v4][v5][v6][v7][v8][v9]vstack=10"
 -threads 1 "thumb_strip.jpg" -y
 }}}

 I was able to repro this on the latest Git build.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/8990>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list