Opened 5 months ago

Closed 5 months ago

#7583 closed defect (fixed)

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

Reported by: tanersener 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 tanersener 5 months ago.
Output video generated by this command using ffmpeg from git-master
input.jpg (858.0 KB) - added by tanersener 5 months ago.
Input file used in testing
ffmpeg-20181202-190836.log (216.4 KB) - added by tanersener 5 months ago.
ffmpeg log report
success.mp4 (90.7 KB) - added by tanersener 5 months ago.
Output video generated by this command using ffmpeg from 3.4.x branch
failure_with_threads_1.mp4 (104.1 KB) - added by tanersener 5 months ago.
Output video generated by test command and threads=1 option using ffmpeg from git-master

Download all attachments as: .zip

Change History (13)

Changed 5 months ago by tanersener

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

Changed 5 months ago by tanersener

Input file used in testing

Changed 5 months ago by tanersener

ffmpeg log report

Changed 5 months ago by tanersener

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

comment:1 Changed 5 months ago by richardpl

add threads=1 as workaround.

comment:2 follow-up: Changed 5 months ago by tanersener

add threads=1 as workaround.

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

Last edited 5 months ago by tanersener (previous) (diff)

comment:3 Changed 5 months ago by cehoyos

  • Keywords regression added
  • Priority changed from normal to important
  • Reproduced by developer set
  • Status changed from new to open

comment:4 in reply to: ↑ 2 ; follow-up: Changed 5 months ago by 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?

Changed 5 months ago by tanersener

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

comment:5 in reply to: ↑ 4 Changed 5 months ago by tanersener

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 follow-up: Changed 5 months ago by richardpl

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

comment:7 in reply to: ↑ 6 Changed 5 months ago by tanersener

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 Changed 5 months ago by richardpl

  • Resolution set to fixed
  • Status changed from open to closed
Note: See TracTickets for help on using tickets.