<p>I managed to fix this. It turns out the card was active, but had frozen for some reason. rebooting the machine, something I should have done in the beginning sorted out the problem. Thinks are still not perfect. But my issue is solved. Thanks</p>

CC BY-SA 4.0
2019-08-01T10:32:08.237Z
2019-08-01T10:32:08.237Z
Rik Roukens
<p>I've been spending the 24 hours troubleshooting this problem, but am getting a bit stuck.</p>

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

<p><strong>Goal:</strong> Capture video from the DeckLink Duo 2 and write it to output.avi</p>

<p><strong>What I've tried so far:</strong> </p>

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

<pre><code>redacted@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
</code></pre>

<p>I've compiled ffmpeg with decklink and the following configuration:</p>

<pre><code>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
</code></pre>

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

<pre><code>[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
</code></pre>

<p>This confirms the card is seen by ffmpeg.</p>

<p>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: </p>

<pre><code>"ffmpeg -format_code Hi50 -f decklink -i 'DeckLink Duo (1)' out.avi"
</code></pre>

<p>returns</p>

<pre><code>redacted@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)
</code></pre>

<p>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.</p>

<p>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.</p>

<p>I can confirm that a normal re-encoding command such as:</p>

<pre><code>redacted@redacted:~$ ffmpeg -i video.mov out.avi
</code></pre>

<p>works just fine. So FFmpeg at a basic level works.</p>

<p>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.</p>

<p><a href="https://i.sstatic.net/Nprn6.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Nprn6.jpg" alt="image showing on loopout"></a></p>

<p>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.</p>

<p>Any suggestions are much appreciated.</p>

<p>Thanks,</p>

<p>Rik</p>

<p><strong><em>EDIT: Running the command with -loglevel trace as requested</em></strong></p>

<pre><code>redacted@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
</code></pre>

CC BY-SA 4.0
2019-08-01T08:23:44.833Z
Run the command with -loglevel trace and share full log.
Gyan
CC BY-SA 4.0
2019-08-01T08:37:18.097Z
@Gyan Thanks for looking into this, see original edit
Rik Roukens
CC BY-SA 4.0
2019-08-01T09:34:12.270Z
Full log, please.
Gyan
CC BY-SA 4.0
2019-08-01T09:42:01.130Z
@Gyan full log this time. apologies.
Rik Roukens
<ffmpeg><video-capture><blackmagic>
DeckLink recording using ffmpeg on Ubuntu 18.04 doesn't start
Rik Roukens
# DeckLink recording using ffmpeg on Ubuntu 18.04 doesn't start

(Asked by: username_0 on 2019-08-01)

I've been spending the 24 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@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@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)

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@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
EDIT: Running the command with -loglevel trace as requested
redacted@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

**Tags:** ffmpeg, video-capture, blackmagic

> **Comments:**
> **username_1**: Run the command with -loglevel trace and share full log.  
> **username_0**: @username_1 Thanks for looking into this, see original edit  
> **username_1**: Full log, please.  
> **username_0**: @username_1 full log this time. apologies.  

---

## 1 answers

### Answer by username_0 on 2019-08-01. Score: 1 | Accepted answer

I managed to fix this. It turns out the card was active, but had frozen for some reason. rebooting the machine, something I should have done in the beginning sorted out the problem. Thinks are still not perfect. But my issue is solved. Thanks


---

