#8990 closed defect (invalid)
Filter Complex does not respect filter_complex_threads
Reported by: | shravan2x | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | undetermined |
Version: | git-master | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
I'm trying to generate a strip of thumbnails using FFmpeg. The requirements for this strip are:
- N thumbnails at even intervals (10 in the example below)
- 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.
Change History (2)
comment:1 by , 4 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 4 years ago
Keywords: | filter_complex_threads removed |
---|
Nothing to do with filter complex threads. You are still decoding with multiple threads.
Add threads also before first and each input.