Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] multiple transitions not taking effect in single filter chain #4

Closed
drlukacs opened this issue Dec 27, 2017 · 3 comments
Closed
Labels

Comments

@drlukacs
Copy link

I would like to patch together three segments, and use one type of transition between the first and the second, and another one between the second and the third.

This appears to be impossible. The last "source=" command determines the transition being used for each occurrence of the filter.

EXAMPLE:

ffmpeg
-i file1.mp4
-i file2.mp4
-filter_complex "
[0:v]split=4[v000][v010][v020][v030];
[0:a]asplit=2[a000][a020];
[v000]trim=27.2:28.55[v001t];
[a000]atrim=27.2:28.55[a001t];
[v001t]setpts=PTS-STARTPTS[v001];
[a001t]asetpts=PTS-STARTPTS[a001];
[v010]trim=28.55:29.55[v011t];
[v011t]setpts=PTS-STARTPTS[v011]; \
[v020]trim=33:34.35[v021t]; \
[a020]atrim=33:34.35[a021t];
[v021t]setpts=PTS-STARTPTS[v021];
[a021t]asetpts=PTS-STARTPTS[a021];
[v030]trim=34.35:34.75[v031t];
[v031t]setpts=PTS-STARTPTS[v031];
[1:v]trim=0:8[v100t];
[1:a]atrim=0:8[a100t];
[v100t]setpts=PTS-STARTPTS[v100];
[a100t]asetpts=PTS-STARTPTS[a100]; \
[v011][v021]gltransition=duration=0.15:source=transitions/fade.glsl[vt1];
[v031][v100]gltransition=duration=0.35:source=transitions/luma.glsl[vt2];
[v001][vt1][vt2]concat=n=3[outv];
[a001][a021][a100]concat=n=3:v=0:a=1[outa]"
-map "[outv]"
-map "[outa]"
-y -q:v 1 tmp/out.mp4

This code will result in luma.glsl being applied to both transitions.

@transitive-bullshit
Copy link
Owner

Great catch! I can reproduce this on my end. Will work on a fix and should be able to get back to you by end of day.

@transitive-bullshit
Copy link
Owner

I just pushed a commit which should resolve this issue. I tested it successfully locally with three different transitions in a single filter chain.

@drlukacs lemme know if this resolves your issue, and please star this repo to help other people find it :)

@transitive-bullshit transitive-bullshit changed the title Multiple transitions is not possible in single command [bug] multiple transitions not taking effect in single filter chain Dec 27, 2017
@drlukacs
Copy link
Author

Thank you @transitive-bullshit for the quick fix. I checked, and it works on my end too.

I starred this repo; however, I would strongly recommend that you propose it for ffmpeg as well. These features should be part of the standard ffmpeg package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants