Opened 19 months ago

Closed 8 months ago

Last modified 8 months ago

#7542 closed defect (fixed)

Low encoding performance depending on input method with filter complex

Reported by: daneelveloper Owned by:
Priority: normal Component: avfilter
Version: git-master Keywords: movie
Cc: cus Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description

For testing video encoding performance (audio is negligible) I'm using command line ffmpeg.exe (4.0.2) and a single video clip. 1920x1080, 29.97 fps, h264 video, aac audio 48000khz stereo.

The following command encodes at an average 4.5x speed:

ffmpeg -i input.mp4 -filter_complex "negate" -c:v mpeg4 -y output.mpeg

But the next command only gets to 1.7x speed:

ffmpeg -filter_complex "movie=input.mp4,negate" -c:v mpeg4 -y output.mpeg

The difference is quite remarkable considering both are basically the same process. Maybe movie filter could be improved to speed encoding up.

Thank you.

Change History (8)

comment:1 Changed 19 months ago by cus

  • Analyzed by developer set
  • Cc cus added
  • Component changed from undetermined to avfilter
  • Reproduced by developer set
  • Version changed from unspecified to git-master

The movie source does not set the thread count to auto, therefore it uses a single threaded video decoder.

comment:2 Changed 19 months ago by daneelveloper

Let me add that split filter derived sources seems to be also single threaded. It be great if both input methods could be multithreaded as -i ones.

comment:3 Changed 19 months ago by richardpl

Can you please give example for split filter?

comment:4 Changed 19 months ago by daneelveloper

In this examples I'm splitting the input clip (1920x1080, 29.97 fps, h264 video, aac audio 48000khz stereo. Audio negligible) into two separate inputs.

Speed values as reported by ffmpeg.exe (4.0.2)

This one runs at 4.15x speed.

ffmpeg -i input.mp4 -filter_complex "split[v0][v1],[v0][v1]blend=extremity" -c:v mpeg4 -y output.mp4

And the next just goes up to 1.65x speed.

ffmpeg -filter_complex "movie=input.mp4,split[v0][v1];[v0][v1]blend=extremity" -c:v mpeg4 -y output.mp4

In the second example it's obvious the slowness comes from movie filter but it also states that split filter derived inputs won't improve speed.

Thank you.

Last edited 19 months ago by daneelveloper (previous) (diff)

comment:5 follow-up: Changed 19 months ago by richardpl

Sorry, but how split filter could improve speed over movie slowness?

comment:6 in reply to: ↑ 5 Changed 19 months ago by daneelveloper

Replying to richardpl:

Sorry, but how split filter could improve speed over movie slowness?

As you point out, I agree it seems split filter is not a bottleneck but the non-optimized operation of movie filter source compared to -i input alternative.

comment:7 Changed 8 months ago by cehoyos

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

comment:8 Changed 8 months ago by cehoyos

  • Keywords movie added
Note: See TracTickets for help on using tickets.