ffmpeg.wasm icon indicating copy to clipboard operation
ffmpeg.wasm copied to clipboard

Screen grabbing

Open ronakkaria opened this issue 2 years ago • 3 comments

I'm new to this, so not sure if this is a bug or a feature request. I'm trying to run the following command capture the desktop screen: ffmpeg.run('-f', 'avfoundation', '-framerate', '5', '-i', '"1"', '~/Desktop/ffmpeg-test-electron.mkv')

I get an error saying Unknown input format: 'avfoundation'. The command works fine when run with ffmpeg directly in the command line (without the wasm build).

I understand that for this to work, ffmpeg uses it's library called libavdevice. Is that not part of the wasm build?

ronakkaria avatar Aug 20 '22 11:08 ronakkaria

wasm can't access to your device screen directly if you wanna capture the desktop screen, try navigator.mediaDevices.getDisplayMedia and MediaRecorder in JavaScript

yeliulee avatar Aug 26 '22 10:08 yeliulee

Actually the whole reason I came to this library was because I didn’t want to use the browser’s getDisplayMedia method as Chrome doesn’t allow an option to never capture the cursor in the recording.

So you’re saying using the ffmpeg Wasm is a dead end?

Edit: Just want to mention it’s an electron app In building.

ronakkaria avatar Aug 26 '22 10:08 ronakkaria

ffmpeg.wasm runs on wasm and can be considered virtual, isolated from the operating system, so there is no direct access to the host

use package @ffmpeg-installer/ffmpeg instead, which runs directly on host

yeliulee avatar Aug 26 '22 12:08 yeliulee