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

Need help in coverting ffmpeg command #826

Open
srinusonly opened this issue Jun 20, 2018 · 1 comment
Open

Need help in coverting ffmpeg command #826

srinusonly opened this issue Jun 20, 2018 · 1 comment

Comments

@srinusonly
Copy link

srinusonly commented Jun 20, 2018

Hi,

I am new to this library and want to execute my existing ffmpeg command using this library, could you please help in write a right query? Thanks in advance.

Version information

  • fluent-ffmpeg version: 2.1.2
  • ffmpeg version: 4.0.1
  • OS: Mac Version (for converting the command, then later will move to cloud functions)

Code to reproduce

Very bad try from my side:

var p = ffmpeg()
    .input(background_1080).loop(1).fps(24).inputOptions('-t 5')
    .input(inputMovie)
    .input(background_1080).loop(1).fps(24).inputOptions('-t 5')
    .input(background_1080).loop(1).fps(24).inputOptions('-t 5')
    .complexFilter(['[0:v]scale=1080:1080[sar]; [sar]split[base][text]; [text]drawtext=fontfile=Lato-Regular.ttf:text='First quote comes here':fontsize=30: fontcolor=0x28abe3: x=(w-text_w)/2:y=(h-text_h)/2,format=yuva444p,fade=t=in:st=0:d=1:alpha=1,fade=t=out:st=4:d=1:alpha=1[subtitles]; [base][subtitles]overlay[v0]; [4:a]afade=t=in:st=0:d=0,afade=t=out:st=5:d=0[v1]; [1:v]scale=1080:1080,fade=t=in:st=0:d=0[v2]; [1:a]afade=t=in:st=0:d=0[v3]; [2:v]scale=1080:1080[sar1]; [sar1]split[base2][text2]; [text2]drawtext=fontfile=Lato-Regular.ttf:text='Second quote comes here':fontsize=30: fontcolor=0x28abe3: x=(w-text_w)/2:y=(h-text_h)/2,format=yuva444p,fade=t=in:st=0:d=1:alpha=1,fade=t=out:st=4:d=1:alpha=1[subtitles2]; [base2][subtitles2]overlay[v4]; [4:a]afade=t=in:st=0:d=0,afade=t=out:st=5:d=0[v5]; [3:v]scale=1080:1080[sar2]; [sar2]split[base3][text3]; [text3]drawtext=fontfile=Lato-Regular.ttf:text='Third quote comes here':fontsize=30: fontcolor=0x28abe3: x=(w-text_w)/2:y=(h-text_h)/2,format=yuva444p,fade=t=in:st=0:d=1:alpha=1,fade=t=out:st=4:d=1:alpha=1[subtitles3]; [base3][subtitles3]overlay[v6]; [4:a]afade=t=in:st=0:d=0,afade=t=out:st=5:d=0[v7]; [v0][v1][v2][v3][v4][v5][v6][v7]concat=n=4:v=1:a=1[output]; [output]scale=1080:1080[scaledoutput]; [scaledoutput]split[fv][ft]; [ft]drawtext=fontfile=Lato-Regular.ttf:text='BeuniQ':fontsize=25: fontcolor=0x28abe3: x=w-tw-40:y=h-th-30,format=yuva444p[fft]; [fv][fft]overlay'], 'output')
    .on('error', function(err) {
      console.log('An error occurred: ' + err.message);
    })
    .on('end', function() {
      console.log('Merging finished !');
    })
  • Raw ffmpeg command
ffmpeg \
-loop 1 -framerate 24 -t 5 -i background_1080.jpg \
-i input.MOV \
-loop 1 -framerate 24 -t 5 -i background_1080.jpg \
-loop 1 -framerate 24 -t 5 -i background_1080.jpg \
-f lavfi -t 0.1 -i anullsrc=channel_layout=stereo:sample_rate=44100 \
-filter_complex \
"[0:v]scale=1080:1080[sar];\
  [sar]split[base][text]; \
  [text]drawtext=fontfile=Lato-Regular.ttf:text='First quote comes here':fontsize=30: fontcolor=0x28abe3: x=(w-text_w)/2:y=(h-text_h)/2,format=yuva444p,fade=t=in:st=0:d=1:alpha=1,fade=t=out:st=4:d=1:alpha=1[subtitles]; [base][subtitles]overlay[v0]; \
 [4:a]afade=t=in:st=0:d=0,afade=t=out:st=5:d=0[v1];\
 [1:v]scale=1080:1080,fade=t=in:st=0:d=0[v2];\
 [1:a]afade=t=in:st=0:d=0[v3];\
 [2:v]scale=1080:1080[sar1]; \
 [sar1]split[base2][text2]; \
 [text2]drawtext=fontfile=Lato-Regular.ttf:text='Second quote comes here':fontsize=30: fontcolor=0x28abe3: x=(w-text_w)/2:y=(h-text_h)/2,format=yuva444p,fade=t=in:st=0:d=1:alpha=1,fade=t=out:st=4:d=1:alpha=1[subtitles2]; [base2][subtitles2]overlay[v4]; \
 [4:a]afade=t=in:st=0:d=0,afade=t=out:st=5:d=0[v5];\
 [3:v]scale=1080:1080[sar2]; \
 [sar2]split[base3][text3]; \
 [text3]drawtext=fontfile=Lato-Regular.ttf:text='Third quote comes here':fontsize=30: fontcolor=0x28abe3: x=(w-text_w)/2:y=(h-text_h)/2,format=yuva444p,fade=t=in:st=0:d=1:alpha=1,fade=t=out:st=4:d=1:alpha=1[subtitles3]; [base3][subtitles3]overlay[v6]; \
 [4:a]afade=t=in:st=0:d=0,afade=t=out:st=5:d=0[v7];\
 [v0][v1][v2][v3][v4][v5][v6][v7]concat=n=4:v=1:a=1[output]; \
 [output]scale=1080:1080[scaledoutput]; \
 [scaledoutput]split[fv][ft]; \
 [ft]drawtext=fontfile=Lato-Regular.ttf:text='BeuniQ':fontsize=25: fontcolor=0x28abe3: x=w-tw-40:y=h-th-30,format=yuva444p[fft]; \
 [fv][fft]overlay" output.mp4;

@stepin
Copy link

stepin commented Oct 9, 2024

-f lavfi is related to #1282

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

No branches or pull requests

2 participants