[FFmpeg-user] screen cast windows 10 desktop with audio

Lance Bermudez lancebermudez at gmail.com
Mon Mar 16 21:52:25 EET 2020


How do i screen cast a windows 10 desktop with audio?

PS C:\Users\lance> ffmpeg -list_devices true -f dshow -i dummy

                  ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg
developers
  built with gcc 9.2.1 (GCC) 20200122
  configuration: --disable-static --enable-shared --enable-gpl
--enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls
--enable-iconv --enable-libass --enable-libdav1d --enable-libbluray
--enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus
--enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora
--enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg
--enable-lzma --enable-zlib --enable-gmp --enable-libvidstab
--enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa
--enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx
--enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va
--enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
--enable-libopenmpt
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[dshow @ 03261400] DirectShow video devices (some may be both video and
audio devices)
[dshow @ 03261400]  "HD WebCam"
[dshow @ 03261400]     Alternative name
"@device_pnp_\\?\usb#vid_04f2&pid_b452&mi_00#7&a554dbd&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global"
[dshow @ 03261400] DirectShow audio devices
[dshow @ 03261400]  "Microphone (Realtek High Definition Audio)"
[dshow @ 03261400]     Alternative name
"@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\wave_{634C03E2-5FAF-41B6-8FDE-76EA6186F1B1}"

I have been using this.
PS C:\Users\lance> ffmpeg -rtbufsize 1500M -f gdigrab -framerate ntsc
-draw_mouse 1 -probesize 20M -video_size 1366x768 -thread_queue_size 512 -i
desktop -f dshow -thread_queue_size 512 -i audio="Microphone (Realtek High
Definition Audio)" -preset ultrafast -r 15 -vcodec libx264 -acodec aac -ac
1 -ar 44100 -async 15 "C:\Users\lance\Videos\Captures\out13.mp4"

                                                            ffmpeg version
4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.2.1 (GCC) 20200122
  configuration: --disable-static --enable-shared --enable-gpl
--enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls
--enable-iconv --enable-libass --enable-libdav1d --enable-libbluray
--enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus
--enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora
--enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg
--enable-lzma --enable-zlib --enable-gmp --enable-libvidstab
--enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa
--enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx
--enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va
--enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
--enable-libopenmpt
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[gdigrab @ 039b1c00] Capturing whole desktop as 1366x768x32 at (0,0)
Input #0, gdigrab, from 'desktop':
  Duration: N/A, start: 1584387532.163434, bitrate: 1006131 kb/s
    Stream #0:0: Video: bmp, bgra, 1366x768, 1006131 kb/s, 29.97 fps, 29.25
tbr, 1000k tbn, 1000k tbc
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, dshow, from 'audio=Microphone (Realtek High Definition Audio)':
  Duration: N/A, start: 123897.214000, bitrate: 1411 kb/s
    Stream #1:0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s
File 'C:\Users\lance\Videos\Captures\out13.mp4' already exists. Overwrite ?
[y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (bmp (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 03a27500] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
BMI1 SlowPshufb
[libx264 @ 03a27500] profile High 4:4:4 Predictive, level 3.2, 4:4:4, 8-bit
[libx264 @ 03a27500] 264 - core 159 - H.264/MPEG-4 AVC codec - Copyleft
2003-2019 - http://www.videolan.org/x264.html - options: cabac=0 ref=1
deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0
me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11
fast_pskip=1 chroma_qp_offset=6 threads=6 lookahead_threads=1
sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0
constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=15 scenecut=0
intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69
qpstep=4 ip_ratio=1.40 aq=0
-async is forwarded to lavfi similarly to -af
aresample=async=15:min_hard_comp=0.100000:first_pts=0.
Output #0, mp4, to 'C:\Users\lance\Videos\Captures\out13.mp4':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661),
yuv444p(progressive), 1366x768, q=-1--1, 15 fps, 15360 tbn, 15 tbc
    Metadata:
      encoder         : Lavc58.54.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp,
69 kb/s
    Metadata:
      encoder         : Lavc58.54.100 aac
[aac @ 03a290c0] Queue input is backward in time
[mp4 @ 03a25d80] Non-monotonous DTS in output stream 0:1; previous: 21504,
current: 478; changing to 21505. This may result in incorrect timestamps in
the output file.
[mp4 @ 03a25d80] Non-monotonous DTS in output stream 0:1; previous: 21505,
current: 1502; changing to 21506. This may result in incorrect timestamps
in the output file.
[mp4 @ 03a25d80] Non-monotonous DTS in output stream 0:1; previous: 21506,
current: 2526; changing to 21507. This may result in incorrect timestamps
in the output file.
[mp4 @ 03a25d80] Non-monotonous DTS in output stream 0:1; previous: 21507,
current: 3550; changing to 21508. This may result in incorrect timestamps
in the output file.
[mp4 @ 03a25d80] Non-monotonous DTS in output stream 0:1; previous: 21508,
current: 4574; changing to 21509. This may result in incorrect timestamps
in the output file.
[mp4 @ 03a25d80] Non-monotonous DTS in output stream 0:1; previous: 21509,
current: 5598; changing to 21510. This may result in incorrect timestamps
in the output file.
[mp4 @ 03a25d80] Non-monotonous DTS in output stream 0:1; previous: 21510,
current: 6622; changing to 21511. This may result in incorrect timestamps
in the output file.
[mp4 @ 03a25d80] Non-monotonous DTS in output stream 0:1; previous: 21511,
current: 7646; changing to 21512. This may result in incorrect timestamps
in the output file.
[mp4 @ 03a25d80] Non-monotonous DTS in output stream 0:1; previous: 21512,
current: 8670; changing to 21513. This may result in incorrect timestamps
in the output file.
[mp4 @ 03a25d80] Non-monotonous DTS in output stream 0:1; previous: 21513,
current: 9694; changing to 21514. This may result in incorrect timestamps
in the output file.
[mp4 @ 03a25d80] Non-monotonous DTS in output stream 0:1; previous: 21514,
current: 10718; changing to 21515. This may result in incorrect timestamps
in the output file.
[mp4 @ 03a25d80] Non-monotonous DTS in output stream 0:1; previous: 21515,
current: 11742; changing to 21516. This may result in incorrect timestamps
in the output file.
[mp4 @ 03a25d80] Non-monotonous DTS in output stream 0:1; previous: 21516,
current: 12766; changing to 21517. This may result in incorrect timestamps
in the output file.
[mp4 @ 03a25d80] Non-monotonous DTS in output stream 0:1; previous: 21517,
current: 13790; changing to 21518. This may result in incorrect timestamps
in the output file.
[mp4 @ 03a25d80] Non-monotonous DTS in output stream 0:1; previous: 21518,
current: 14814; changing to 21519. This may result in incorrect timestamps
in the output file.
[mp4 @ 03a25d80] Non-monotonous DTS in output stream 0:1; previous: 21519,
current: 15838; changing to 21520. This may result in incorrect timestamps
in the output file.
[mp4 @ 03a25d80] Non-monotonous DTS in output stream 0:1; previous: 21520,
current: 16862; changing to 21521. This may result in incorrect timestamps
in the output file.
[mp4 @ 03a25d80] Non-monotonous DTS in output stream 0:1; previous: 21521,
current: 17886; changing to 21522. This may result in incorrect timestamps
in the output file.
[mp4 @ 03a25d80] Non-monotonous DTS in output stream 0:1; previous: 21522,
current: 18910; changing to 21523. This may result in incorrect timestamps
in the output file.
[mp4 @ 03a25d80] Non-monotonous DTS in output stream 0:1; previous: 21523,
current: 19934; changing to 21524. This may result in incorrect timestamps
in the output file.
[mp4 @ 03a25d80] Non-monotonous DTS in output stream 0:1; previous: 21524,
current: 20958; changing to 21525. This may result in incorrect timestamps
in the output file.
frame=  264 fps= 18 q=-1.0 Lsize=    4143kB time=00:00:17.53
bitrate=1935.9kbits/s dup=57 drop=129 speed=1.22x
video:3972kB audio:163kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.200574%
[libx264 @ 03a27500] frame I:2     Avg QP:14.00  size:546606
[libx264 @ 03a27500] frame P:262   Avg QP:12.16  size: 11351
[libx264 @ 03a27500] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 03a27500] mb P  I16..4:  1.1%  0.0%  0.0%  P16..4: 11.5%  0.0%
 0.0%  0.0%  0.0%    skip:87.4%
[libx264 @ 03a27500] coded y,u,v intra: 37.3% 33.8% 33.1% inter: 4.6% 1.9%
1.8%
[libx264 @ 03a27500] i16 v,h,dc,p: 67% 30%  2%  1%
[libx264 @ 03a27500] kb/s:1848.72
[aac @ 03a290c0] Qavg: 2132.466


More information about the ffmpeg-user mailing list