[FFmpeg-user] Can transpose and between done in one command

Cecil Westerhof Cecil at decebal.nl
Tue Sep 26 21:01:42 EEST 2023

Moritz Barsnick <barsnick at gmx.net> writes:

>> In principle that would lead to a little better output video I think,
>> because it is processed one time less. Or would it not make much
>> difference?
> Oh, yes, absolutely it would make a difference. Each (lossy) reencoding
> is a loss in quality. Also, you could save a lot of time.

I do not see a difference, but maybe I have not the sharpest eye.
Beside: if there is now not a visible difference, it will not mean
that there will never be a visible difference.

There is certainly a difference: the old way generates a video of
89.9 MB while the combined way in both cases give a video of 105.2 MB.

> As the ffmpeg-filters docs say,
>> Filters in the same linear chain are separated by commas, [...]
> You're already doing this with "select,(a)setpts".
> I would suggest selecting first, then transposing (which saves you from
> transposing content which is later discarded), but it shouldn't matter.

I have run it the old way, then first transposing and then first
selecting. The results are (in my opinion) a bit strange.

Values are real time, user time and sys time. (User time is higher as
real time because several cores are used.)

The old way:
transpose:          2:34 6:08 0:04
select:             1:38 4:04 0:03

transpose first:    1:34 4:06 0:03
select first:       1:32 4:05 0:03

At this moment there is no difference between transpose first and
select first. (But I keep the select first.)
But what I find very strange is the following:
Original transpose took 50% more time as the select. But when the
select and the transpose are combined it takes about as much time the
select on the transposed file took.
How is this possible?

By the way I do not need the transpose before selecting the parts to
be used. For mpv I added to input.conf:
    r cycle_values video-rotate  90 180 270 0
    R cycle_values video-rotate 270 180  90 0

and now I can rotate in mpv and do not need a rotated video anymore.

Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

More information about the ffmpeg-user mailing list