I have the next scheme of tracks. I need to render that tracks to one track with ffmpeg.
After rendering it's should looks like
I want to use the next scheme:
- Rendering Track 001 to file.
- Rendering Track 002 to file.
- Overlay Track 002 on Track 001.
For the "Track 001" I can "concat" clips to one track without any problem.
But the question is how I should concat clips for the "Track 002"? The "Empty" places must be transparent for the overlaying on the 3 step.
I already tried to use for the Empty places input with transparent color. But on the overlaying step transparent doesn't work.
ffmpeg -f lavfi -i [email protected]:s=1920x1080:r=25:d=1 \
-i Clip004.mp4 \
-i Rendered_track_001.mp4 \
-filter_complex "[0:v] [1:v] xfade=transition=fade:duration=2:offset=0.5[trak]; \
[2:v][trak]overlay[out]" \
-map "[out]" -c:v vp9 -c:a copy test.webm
I also tried to use alphaextract and alphamerge like this
ffmpeg -f lavfi -i [email protected]:s=1920x1080:r=25:d=1 \
-i Clip004.mp4 \
-i Rendered_track_001.mp4 \
-filter_complex "[0:v] [1:v] xfade=transition=fade:duration=2:offset=0.5[out]; \
[out]alphaextract[alpha];[2:v][alpha]alphamerge[out1]" \
-map "[out1]" -c:v vp9 -c:a copy test.webm
But it's fail with error
[AVFilterGraph @ 0x556557d3ce00] The following filters could not choose their formats:
Parsed_alphaextract_1
Consider inserting the (a)format filter near their input or output.
Error reinitializing filters!
Failed to inject frame into filter network: Input/output error
Error while processing the decoded data for stream #2:0
Any help would be appreciated.