[FFmpeg-user] FFmpeg DeckLink capture doesn't work

Rik Roukens rik.roukens at theoceanrace.com
Thu Aug 1 12:45:44 EEST 2019


Hi all,

Apologies if i'm breaking any rules or do anything wrong, first time I've
joined and posted to a mailing list.

I've been spending the last 48 hours troubleshooting this problem, but am
getting a bit stuck.

Pre-info: I'm running an Ubuntu 18.04 server with a DeckLink Duo 2 card
inside.

Goal: Capture video from the DeckLink Duo 2 and write it to output.avi

What I've tried so far:

I've installed BMD DeckLink drivers 10.11.4 on my Ubuntu Server and
verified they server can see the card:

    redacted at redacted:~$ BlackmagicFirmwareUpdater status
    0: /dev/blackmagic/io0 [DeckLink Duo 2] 0xd5 OK
    1: /dev/blackmagic/io2 [DeckLink Duo 2] 0xd5 OK
    2: /dev/blackmagic/io1 [DeckLink Duo 2] 0xd5 OK
    3: /dev/blackmagic/io3 [DeckLink Duo 2] 0xd5 OK

I've compiled ffmpeg with decklink and the following configuration:

    ffmpeg version 4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
    built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
    configuration:
    --prefix=/home/redacted/ffmpeg_build
    --pkg-config-flags=--static
    --extra-cflags='-I/home/redacted/ffmpeg_build/include
-I/home/redacted/ffmpeg_sources/BMD_SDK/include'
    --extra-ldflags=-L/home/redacted/ffmpeg_build/lib
    --extra-libs='-lpthread -lm'
    --bindir=/home/redacted/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

Next I do a basic check to see if my DeckLink Duo 2 shows up in ffmpeg:

    [decklink @ 0x5574cc33ef00] Blackmagic DeckLink input devices:
    [decklink @ 0x5574cc33ef00] 'DeckLink Duo (1)'
    [decklink @ 0x5574cc33ef00] 'DeckLink Duo (2)'
    [decklink @ 0x5574cc33ef00] 'DeckLink Duo (3)'
    [decklink @ 0x5574cc33ef00] 'DeckLink Duo (4)'
    dummy: Immediate exit requested

This confirms the card is seen by ffmpeg.

So now I want to run a capture command, however, it does not matter what
command I run, FFmpeg does not start capturing. For example, running a very
basic:

    "ffmpeg -format_code Hi50 -f decklink -i 'DeckLink Duo (1)' out.avi"

returns:

    redacted at redacted:~$ ffmpeg -format_code Hi50 -f decklink -i 'DeckLink
    Duo (1)' out.avi
    ffmpeg version 4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
    built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
    configuration: --prefix=/home/redacted/ffmpeg_build
--pkg-config-flags=--static -
    -extra-cflags='-I/home/redacted/ffmpeg_build/include -
    I/home/redacted/ffmpeg_sources/BMD_SDK/include' --extra-ldflags=-
    L/home/redacted/ffmpeg_build/lib --extra-libs='-lpthread -lm' --
    bindir=/home/redacted/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. 22.100 / 56. 22.100
    libavcodec     58. 35.100 / 58. 35.100
    libavformat    58. 20.100 / 58. 20.100
    libavdevice    58.  5.100 / 58.  5.100
    libavfilter     7. 40.101 /  7. 40.101
    libswscale      5.  3.100 /  5.  3.100
    libswresample   3.  3.100 /  3.  3.100
    libpostproc    55.  3.100 / 55.  3.100
    [decklink @ 0x5638a755d000] Found Decklink mode 1920 x 1080 with rate
25.00(i)

running the command with -loglevel trace gives me the following output:

redacted at redacted:~$ ffmpeg -loglevel trace -raw_format yuv422p10 1 -an
    -
    format_code Hp25 -f decklink -i 'DeckLink Duo (2)' output.avi
    ffmpeg version 4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
    built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
    configuration: --prefix=/home/redacted/ffmpeg_build
--pkg-config-flags=--static
    -
    -extra-cflags='-I/home/redacted/ffmpeg_build/include -
    I/home/redacted/ffmpeg_sources/BMD_SDK/include' --extra-ldflags=-
    L/home/redacted/ffmpeg_build/lib --extra-libs='-lpthread -lm' --
    bindir=/home/redacted/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. 22.100 / 56. 22.100
    libavcodec     58. 35.100 / 58. 35.100
    libavformat    58. 20.100 / 58. 20.100
    libavdevice    58.  5.100 / 58.  5.100
    libavfilter     7. 40.101 /  7. 40.101
    libswscale      5.  3.100 /  5.  3.100
    libswresample   3.  3.100 /  3.  3.100
    libpostproc    55.  3.100 / 55.  3.100
    Splitting the commandline.
    Reading option '-loglevel' ... matched as option 'loglevel' (set
logging
    level) with argument 'trace'.
    Reading option '-raw_format' ... matched as AVOption 'raw_format' with
    argument 'yuv422p10'.
    Reading option '1' ... matched as output url.
    Reading option '-ac' ... matched as option 'ac' (set number of audio
    channels) with argument '2'.
    Reading option '-format_code' ... matched as AVOption 'format_code'
with
    argument 'Hp25'.
    Reading option '-f' ... matched as option 'f' (force format) with
argument
    'decklink'.
    Reading option '-i' ... matched as input url with argument 'DeckLink
Duo
    (2)'.
    Reading option 'output.avi' ... matched as output url.
    Finished splitting the commandline.
    Parsing a group of options: global .
    Applying option loglevel (set logging level) with argument trace.
    Successfully parsed a group of options.
    Parsing a group of options: input url DeckLink Duo (2).
    Applying option ac (set number of audio channels) with argument 2.
    Applying option f (force format) with argument decklink.
    Successfully parsed a group of options.
    Opening an input file: DeckLink Duo (2).
    [decklink @ 0x55cef7de7300] Trying to find mode for frame size 0x0,
frame
    timing 0/0, field order 0, direction 0, mode number 0, format code Hp25
    [decklink @ 0x55cef7de7300] Found Decklink mode 1920 x 1080 with rate
25.00
    [decklink @ 0x55cef7de7300] Using 2 input audio channels

It doesn't matter how complicated I make the initial command, with video
formats, audio formats, custom sizes, codecs, etc. It all returns the same.

It essentially stays stuck in this position, with the command still running
forever. To the best of my knowledge, FFmpeg is supposed to start the
encoding process straight after. It does not.

I can confirm that a normal re-encoding command such as:

    redacted at redacted:~$ ffmpeg -i video.mov out.avi

works just fine. So FFmpeg at a basic level works.

I can also confirm FFmpeg can 'talk to the DeckLink and set the right mode,
I can confirm a picture 'flows' through the card as I can see it showing up
on the output loop on my monitor(see image) as soon as I put any of the
FFmpeg commands in, however, FFmpeg does not start encoding/capturing.

I think I've done something wrong with the configuration/compiling of
FFmpeg, perhaps during compiling, but I cannot figure out what I've done
wrong.

Any suggestions are much appreciated.

Thanks,

Rik

-- 










The information in this email and in any attachments is 
confidential and may be privileged. If you are not the intended recipient, 
please destroy this message, delete any copies held on your systems and 
notify the sender immediately. You should not retain, copy or use this 
email for any purpose, nor disclose all or any part of its contents to any 
other person. Atlant Ocean Racing Spain SL, a company registered in Spain. 
B76239177.


More information about the ffmpeg-user mailing list