To stream your current desktop screen without including the Windows taskbar using FFmpeg, you need to:
- Determine your screen dimensions (excluding the taskbar).
- Use the
gdigrabinput device in FFmpeg. - Crop the capture area to exclude the taskbar.
Example Command:
Explanation:
-f gdigrab→ Use Windows screen capture.-framerate 30→ Set frame rate to 30 FPS (adjust as needed).-offset_x 0 -offset_y 0→ Start capturing from the top-left corner (you can adjust this if needed).-video_size 1920x1010→ Adjust this to match your screen resolution minus the taskbar height (usually 40px or 70px, depending on settings).-i desktop→ Capture the full desktop.-f flv rtmp://your-stream-url→ Stream to an RTMP server.
How to Determine Correct video_size:
- Find your screen resolution (
1920x1080,2560x1440, etc.). - Subtract the taskbar height (usually ~40px in default mode, ~70px in larger mode).
- Example:
- 1080p screen (1920×1080) →
1920x1040(if taskbar height is 40px) - 1440p screen (2560×1440) →
2560x1400
- 1080p screen (1920×1080) →