简体   繁体   中英

fluent ffmpeg how to set X11 display as input

With command line i can easily capture an Xserver display, trying to reproduce this with fluent-ffmpeg for node

videoCommand.addInput(':99.0+0,150')
.withSize('720x480')
.withFpsInput(60)
.withFpsOutput(60)
.addInputOption('-y', '-f x11grab')
.outputOptions(['-c:v libx264', '-crf 18' , '-preset veryfast' , '-t 
 00:00:05'])
.output(base_path+'/video.mp4')
.run();

I get

Unrecognized option 'f x11grab'.

I am concerned about the syntax or way to set the input as DISPLAY :99.0 and also to tell ffmpeg that i want x11grab.

Where those has to be set ?

--- EDIT ---

changed to .addInputOptions('-y', '-f x11grab') with 's'

same error

Worked like this :

videoCommand.addInput(':99.0+0,150')
.withSize('720x480')
.withFpsInput(60)
.withFpsOutput(60)
.addInputOptions('-y', '-f' , 'x11grab')
.outputOptions(['-c:v libx264', '-crf 18' , '-preset veryfast' , '-t 
00:00:05'])
.output(base_path+'/video.mp4')
.run();

trick was here :

.addInputOptions('-y', '-f' , 'x11grab')

options needs to be separated

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM