Opened 4 years ago

Closed 4 years ago

#7583 closed defect (fixed)

wrong frames generated by overlay filter when y is negative and dynamic

Reported by: Taner Sener Owned by:
Priority: important Component: avfilter
Version: git-master Keywords: overlay regression
Cc: tanersener@gmail.com Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:

I want to create a vertically moving photo using overlay filter. If I start with a negative y and increase it by time, photo is expected to slide down from the top of the screen slowly. But unfortunately input photo is not rendered correctly and some parts are missing from the photo.

This technique works brilliantly when applied horizontally on x but when y is used this technique fails.

How to reproduce:

Any photo can be used as input.

% ffmpeg \
-loop 1 -i input.jpg \
-f lavfi -i color=black:s=600x600 \
-filter_complex "[0:v]scale=400:400,[1:v]overlay=0:'-h+t/1*600*2',trim=duration=1[video]" \
-map [video] -c:v mpeg4 output.mp4

ffmpeg version N-92590-gf7faaa8c18 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04)

Affected versions:

According to my analysis, commit d54014d1573ec6e958e9c9e802e613c73c7f7ba5 breaks something about overlay filter. Test command provided above works on all releases without this commit: 2.8.x, 3.4.x, 4.0.x. But 4.1 and master, which has d54014d1573ec6e958e9c9e802e613c73c7f7ba5, is not working as expected.

Attachments (5)

failure.mp4 (171.3 KB ) - added by Taner Sener 4 years ago.
Output video generated by this command using ffmpeg from git-master
input.jpg (858.0 KB ) - added by Taner Sener 4 years ago.
Input file used in testing
ffmpeg-20181202-190836.log (216.4 KB ) - added by Taner Sener 4 years ago.
ffmpeg log report
success.mp4 (90.7 KB ) - added by Taner Sener 4 years ago.
Output video generated by this command using ffmpeg from 3.4.x branch
failure_with_threads_1.mp4 (104.1 KB ) - added by Taner Sener 4 years ago.
Output video generated by test command and threads=1 option using ffmpeg from git-master

Download all attachments as: .zip

Change History (13)

by Taner Sener, 4 years ago

Attachment: failure.mp4 added

Output video generated by this command using ffmpeg from git-master

by Taner Sener, 4 years ago

Attachment: input.jpg added

Input file used in testing

by Taner Sener, 4 years ago

Attachment: ffmpeg-20181202-190836.log added

ffmpeg log report

by Taner Sener, 4 years ago

Attachment: success.mp4 added

Output video generated by this command using ffmpeg from 3.4.x branch

comment:1 by Elon Musk, 4 years ago

add threads=1 as workaround.

comment:2 by Taner Sener, 4 years ago

add threads=1 as workaround.

Adding -threads 1 didn't make any difference for me.

Last edited 4 years ago by Taner Sener (previous) (diff)

comment:3 by Carl Eugen Hoyos, 4 years ago

Keywords: regression added
Priority: normalimportant
Reproduced by developer: set
Status: newopen

in reply to:  2 ; comment:4 by Elon Musk, 4 years ago

Replying to tanersener:

add threads=1 as workaround.

Adding -threads 1 didn't make any difference for me.

threads=1 is filter option not flag.. read what i wrote would you?

by Taner Sener, 4 years ago

Attachment: failure_with_threads_1.mp4 added

Output video generated by test command and threads=1 option using ffmpeg from git-master

in reply to:  4 comment:5 by Taner Sener, 4 years ago

Replying to richardpl:

Replying to tanersener:

add threads=1 as workaround.

Adding -threads 1 didn't make any difference for me.

threads=1 is filter option not flag.. read what i wrote would you?

Using threads=1 option improves output a little but doesn't fix the issue. You can see the output file failure_with_threads_1.mp4.

By the way, thanks for trying to help me but I never used threads option before and FFmpeg Filters Documentation does not list any threads option for filters used so I googled your threads=1 recommendation. All search results from first page corrected threads=1 as -threads 1. This is why I tried using -threads 1. Just wanted to let you know.

comment:6 by Elon Musk, 4 years ago

threads=1 option works fine. Post full uncut ffmpeg output.

in reply to:  6 comment:7 by Taner Sener, 4 years ago

Replying to richardpl:

threads=1 option works fine. Post full uncut ffmpeg output.

You're right, workaround works fine, my mistake, ignore failure_with_threads_1.mp4.

comment:8 by Elon Musk, 4 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.