使用 FFmpeg 重新编码 Blackmagic Decklink Quad

使用 FFmpeg 重新编码 Blackmagic Decklink Quad

我在使用 FFmpeg 从 DeckLink Quad HDMI 录像机捕捉视频时遇到了麻烦。我有一台笔记本电脑连接到其中一个输入端,我想录制通过

这是我正在使用的 FFmpeg 命令:

ffmpeg -format_code wux5 -f decklink -video_input hdmi -i 'dl_input0' -y -an test.mkv

这是输出

ffmpeg version N-94264-g74d4fd0 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
  configuration: --prefix=/home/capture/ffmpeg_build --pkg-config-flags=--static --extra-cflags='-I/home/capture/ffmpeg_build/include -I/home/capture/ffmpeg_sources/BMD_SDK/include' --extra-ldflags=-L/home/capture/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/capture/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-decklink
  libavutil      56. 30.100 / 56. 30.100
  libavcodec     58. 53.101 / 58. 53.101
  libavformat    58. 28.101 / 58. 28.101
  libavdevice    58.  7.100 / 58.  7.100
  libavfilter     7. 56.101 /  7. 56.101
  libswscale      5.  4.101 /  5.  4.101
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
[decklink @ 0x5643c28b1f00] Found Decklink mode 1920 x 1200 with rate 50.00
[decklink @ 0x5643c28b1f00] Could not set mode number 0 or format code wux5 for dl_input0
dl_input0: Input/output error

我使用格式代码 wux5,因为它似乎与 Blackmagic 设置程序中列出的输入源相匹配 甲板链接 如果我使用不同的 -format_code,例如 Hp59,它会开始录制,但 FFmpeg 只会输出带有彩条的文件。这意味着 FFmpeg 没有获得任何视频输入。

使用这些设置,我可以通过 OBS 很好地看到 Decklink 的输入 观察 所以我不确定为什么我不能用 FFmpeg 录制

这是 -list_formats

ffmpeg -f decklink -list_formats 1 -i 'dl_input0'
ffmpeg version N-94264-g74d4fd0 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
  configuration: --prefix=/home/capture/ffmpeg_build --pkg-config-flags=--static --extra-cflags='-I/home/capture/ffmpeg_build/include -I/home/capture/ffmpeg_sources/BMD_SDK/include' --extra-ldflags=-L/home/capture/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/capture/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-decklink
  libavutil      56. 30.100 / 56. 30.100
  libavcodec     58. 53.101 / 58. 53.101
  libavformat    58. 28.101 / 58. 28.101
  libavdevice    58.  7.100 / 58.  7.100
  libavfilter     7. 56.101 /  7. 56.101
  libswscale      5.  4.101 /  5.  4.101
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
[decklink @ 0x55ecc53fbd80] Supported formats for 'dl_input0':
    format_code description
    ntsc        720x486 at 30000/1001 fps (interlaced, lower field first)
    pal         720x576 at 25000/1000 fps (interlaced, upper field first)
    23ps        1920x1080 at 24000/1001 fps
    24ps        1920x1080 at 24000/1000 fps
    Hp25        1920x1080 at 25000/1000 fps
    Hp29        1920x1080 at 30000/1001 fps
    Hp30        1920x1080 at 30000/1000 fps
    Hp50        1920x1080 at 50000/1000 fps
    Hp59        1920x1080 at 60000/1001 fps
    Hp60        1920x1080 at 60000/1000 fps
    Hi50        1920x1080 at 25000/1000 fps (interlaced, upper field first)
    Hi59        1920x1080 at 30000/1001 fps (interlaced, upper field first)
    Hi60        1920x1080 at 30000/1000 fps (interlaced, upper field first)
    hp50        1280x720 at 50000/1000 fps
    hp59        1280x720 at 60000/1001 fps
    hp60        1280x720 at 60000/1000 fps
    4k23        3840x2160 at 24000/1001 fps
    4k24        3840x2160 at 24000/1000 fps
    4k25        3840x2160 at 25000/1000 fps
    4k29        3840x2160 at 30000/1001 fps
    4k30        3840x2160 at 30000/1000 fps
    4k50        3840x2160 at 50000/1000 fps
    4k59        3840x2160 at 60000/1001 fps
    4k60        3840x2160 at 60000/1000 fps
    4d23        4096x2160 at 24000/1001 fps
    4d24        4096x2160 at 24000/1000 fps
    4d25        4096x2160 at 25000/1000 fps
    4d29        4096x2160 at 30000/1001 fps
    4d30        4096x2160 at 30000/1000 fps
    4d50        4096x2160 at 50000/1000 fps
    4d59        4096x2160 at 60000/1001 fps
    4d60        4096x2160 at 60000/1000 fps
    vga6        640x480 at 60000/1000 fps
    svg6        800x600 at 60000/1000 fps
    wxg5        1440x900 at 50000/1000 fps
    wxg6        1440x900 at 60000/1000 fps
    sxg5        1440x1080 at 50000/1000 fps
    sxg6        1440x1080 at 60000/1000 fps
    uxg5        1600x1200 at 50000/1000 fps
    uxg6        1600x1200 at 60000/1000 fps
    wux5        1920x1200 at 50000/1000 fps
    wux6        1920x1200 at 60000/1000 fps
    1945        1920x1440 at 50000/1000 fps
    1946        1920x1440 at 60000/1000 fps
    wqh5        2560x1440 at 50000/1000 fps
    wqh6        2560x1440 at 60000/1000 fps
    wqx5        2560x1600 at 50000/1000 fps
    wqx6        2560x1600 at 60000/1000 fps
dl_input0: Immediate exit requested

答案1

所以我找到了一个解决方案。我彻底清除了我的 ffmpeg 安装,并按照本指南重新编译 https://forum.blackmagicdesign.com/viewtopic.php?f=12&t=90511

我使用这个命令录制了我的屏幕

ffmpeg -raw_format rgb10  -f decklink -i 'dl_input0' -y test.mkv

唯一的补充是 -raw_format rgb10。我不确定如何发现要使用哪个 raw_format 选项。

相关内容