woonizzooni

[Windows] ffmpeg으로 화면캡처(capture desktop)해서 rtmp송출 본문

FFmpeg

[Windows] ffmpeg으로 화면캡처(capture desktop)해서 rtmp송출

woonizzooni 2020. 11. 8. 16:19

[관련글]

    "FFmpeg Visual Studio 2019 컴파일-1"

    "[macos]ffmpeg으로 화면캡처(capture desktop)해서 rtmp송출"

 

 

[참고]

    Capturing your Desktop / Screen Recording

    : Windows

    trac.ffmpeg.org/wiki/Capture/Desktop#Windows

 

기존에 컴파일해서 설치되어 있는 버전으로...

 

Use DirectShow : dshow 장치 확인

> ffmpeg -list_devices true -f dshow -i dummy
ffmpeg version 2.8.git Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 5.2.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 11.100 / 55. 11.100
  libavcodec     57. 17.100 / 57. 17.100
  libavformat    57. 20.100 / 57. 20.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 21.100 /  6. 21.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[dshow @ 000002015362a7c0] DirectShow video devices (some may be both video and audio devices)
[dshow @ 000002015362a7c0]  "OBS Virtual Camera"
[dshow @ 000002015362a7c0]     Alternative name "@device_sw_{860BB310-5D01-11D0-BD3B-00A0C911CE86}\{A3FCE0F5-3493-419F-958A-ABA1250EC20B}"
[dshow @ 000002015362a7c0] DirectShow audio devices
[dshow @ 000002015362a7c0] Could not enumerate audio only devices (or none found).
dummy: Immediate exit requested

MacOS에서는 AVFoundation 장치목록에 'Capture screen'으로 device식별이 되던데, 얘는 아니네 ...

 

 

Use built-in GDI screengrabber

 

이걸로 하면 됨. 비디오만 있는 상태로 나간다. 대충 이렇게 하면 되겠네 ㅎ

ffmpeg -f gdigrab -i desktop \
-c:v libx264 -deinterlace -r 24 -s 1280x720 \
  -b:v 2400k -minrate 2400k -maxrate 2400k -bufsize 2400k -pix_fmt yuv420p \
  -profile:v baseline -x264-params keyint=48:keyint_min=24:scenecut=0:bframes=0 \
-f flv rtmp://localhost:1935/live/test

 

ex) 송출 화면 캡처

 

 

 

Comments