Opened 6 years ago

Closed 5 years ago

Last modified 5 years 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: Marton Balint 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 by Marton Balint, 6 years ago

Analyzed by developer: set
Cc: Marton Balint added
Component: undeterminedavfilter
Reproduced by developer: set
Version: unspecifiedgit-master

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

comment:2 by daneelveloper, 6 years ago

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 by Elon Musk, 6 years ago

Can you please give example for split filter?

comment:4 by daneelveloper, 6 years ago

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 6 years ago by daneelveloper (previous) (diff)

comment:5 by Elon Musk, 6 years ago

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

in reply to:  5 comment:6 by daneelveloper, 6 years ago

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 by Carl Eugen Hoyos, 5 years ago

Resolution: fixed
Status: newclosed

comment:8 by Carl Eugen Hoyos, 5 years ago

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