fluent-ffmpeg / node-fluent-ffmpeg

A fluent API to FFMPEG (http://www.ffmpeg.org)
MIT License
7.85k stars 874 forks source link

Audio Missing in Screen Recording #1186

Open fb13 opened 2 years ago

fb13 commented 2 years ago

Version information

Code to reproduce

Source 1 is my screen and source 0 is my microphone.


let command = ffmpeg({ source: '1:0' })
command.inputFormat('avfoundation')
command.fps(60)
command.videoCodec('libx264')
command.audioBitrate('320k')
command.audioCodec('libmp3lame')
command.addOption('-pix_fmt', 'yuv420p')
command.save('output.mp4')

Expected results

Both screen and audio should be in the output video.

Observed results

Only the screen is recorded - no audio in the output file.

When I try '':0" as a source, it records the audio. Interestingly, if I try "0:0" (basically my webcam and my mic) it records both webcam video and mic audio correctly. If I put "1:0" it records the screen, but not the mic audio. Strange bug

Tested it also using ffmpeg in the terminal - works successfully! Example: ffmpeg -f avfoundation -i "1:0" -c:v libx264 -c:a aac -filter:v fps=60 -pix_fmt yuv420p ~/output.mp4

seemrcola commented 6 months ago

have the same problem now. Have you solved it ?