You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

MacOS下FFmpeg Decklink采集BlackMagic设备,如何实现本地预览?

Nice to hear your DeckLink to YouTube stream is working smoothly—adding a local preview is a common need, and FFmpeg has a couple of solid ways to pull this off. Let’s walk through two methods tailored for your macOS setup:

Method 1: Single Command with the Tee Muxer

The tee muxer lets you route your processed video to both YouTube and a local preview window in one go. This keeps things clean and avoids running separate FFmpeg instances. Update your command to this:

ffmpeg -f decklink -format_code 'Hi50' -i 'UltraStudio Express' -deinterlace \
  -b:v 1M -vcodec h264 -pix_fmt yuv420p -color_range 1 -acodec aac \
  -f tee "[f=flv]rtmp://a.rtmp.youtube.com/live2/*******|[f=nut]pipe:1" | ffplay -f nut -

Breakdown of the changes:

  • The tee muxer splits the stream into two destinations: your existing YouTube RTMP endpoint, and a pipe using the lightweight NUT container (ideal for real-time streaming).
  • ffplay reads directly from the pipe and opens a preview window instantly.
  • This works on macOS as long as you have ffplay installed (it’s included with most DeckLink-enabled FFmpeg builds—verify with ffplay -version if you’re unsure).

Method 2: Separate SDL Preview Output

If you prefer a more straightforward setup without pipes, you can add a second output that sends the video to a local SDL window. Here’s how to adjust your command:

ffmpeg -f decklink -format_code 'Hi50' -i 'UltraStudio Express' -deinterlace \
  # YouTube stream (unchanged from your original command)
  -b:v 1M -vcodec h264 -pix_fmt yuv420p -color_range 1 -acodec aac -f flv rtmp://a.rtmp.youtube.com/live2/******* \
  # Local preview output
  -vcodec rawvideo -pix_fmt uyvy422 -f sdl "BlackMagic Capture Preview"

Breakdown:

  • The first output block is exactly your working YouTube stream—no changes needed here.
  • The second output uses rawvideo (no compression, minimal latency) with uyvy422 (a pixel format that plays nicely with DeckLink captures) and sends it to an SDL window labeled "BlackMagic Capture Preview".
  • SDL is lightweight, so the preview will pop up quickly with very little delay, perfect for monitoring your feed.

Quick macOS Tips:

  • Ensure your FFmpeg build has SDL support: run ffmpeg -formats | grep sdl—if you see SDL listed, you’re good to go.
  • If you notice preview latency, try temporarily removing -deinterlace to test (you can re-add it once you confirm the preview works, since Hi50 requires deinterlacing for proper playback).
  • For the tee method, if pipes give you trouble, replace pipe:1 with a temporary file path like /tmp/preview_stream.nut and run ffplay /tmp/preview_stream.nut in a separate terminal window—pipes are cleaner, but this is a reliable fallback.

内容的提问来源于stack exchange,提问作者Манаф Иракский

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 08:52:20