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

How to record screen on Mac? #1270

Open
Nquq opened this issue May 2, 2024 · 0 comments
Open

How to record screen on Mac? #1270

Nquq opened this issue May 2, 2024 · 0 comments

Comments

@Nquq
Copy link

Nquq commented May 2, 2024

Version information

  • fluent-ffmpeg version: ^2.1.2
  • ffmpeg version: 6.1.1
  • OS: MacOS Sonoma 14.4.1

Code to reproduce

const { createWriteStream } = require('fs')
const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path
const ffmpeg = require('fluent-ffmpeg')
ffmpeg.setFfmpegPath(ffmpegPath)

const cropArea = '3600:1980:0:400'
const screenID = 2

const outStream = createWriteStream('../videos/test.mp4')

const stop = movie => {
	return movie.ffmpegProc.stdin.write('q')
}

const recordingProcessVideo = ffmpeg(`${screenID}:1`)
	.inputFormat('avfoundation')
	.videoFilter(`crop=${cropArea}`)
	.format('matroska')
	.on('error', error => console.log(`Encoding Error: ${error.message}`))
	.on('exit', () => console.log('Video recorder exited'))
	.on('close', () => console.log('Video recorder closed'))
	.on('end', () => console.log('Video Transcoding succeeded !'))
	.on('start', () => console.log('Video Transcoding Started !'))
	.on('progress', progress => console.log(progress))

recordingProcessVideo.pipe(outStream, { end: true })

setTimeout(() => {
	stop(recordingProcessVideo)
}, 3000)

1-2 months ago its works fine, but now its dont work. Only 'start' event work. Nothing happend after timeout
image

@Nquq Nquq changed the title How to record screen on Mac How to record screen on Mac? May 2, 2024
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

1 participant