[FFmpeg-user] FFmpeg DeckLink capture doesn't work
Ted Park
kumowoon1025 at gmail.com
Thu Aug 1 14:08:08 EEST 2019
Hey there,
> Apologies if i'm breaking any rules or do anything wrong, first time I've
> joined and posted to a mailing list.
> 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.
For starters, you can leave it there if you’d like but on a public mailing list signatures like this have little significance.
> 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)
><><>snip<><><><
>
> 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.
Are you sure it’s “running" though? Is there like mad disk I/O from ffmpeg after it seemingly falls into zombie mode?
I assume what’s happening is it takes too long or too much memory (probably the time is the bigger factor) for that first full “frame” comes in with the format you specified, for reasons I can only guess at right now. Maybe PCIe lanes not being allocated right so low throughput, etc?
For now I’d try leaving out the logging lest it causes any more delay, and increasing the buffer size for sync and the mux pre delay length to see if you can get any kind of success at all.
> 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.
That sounds a bit contradictory to me :P But if you're thinking ffmpeg is gobbling up all those frames (or would it be slices for interlaced? Maybe deinterlacing has a lot to do with it) just because it shows up on the monitor you’d be very mistaken. I mean it’s a freaking monitor, it’s doing what it’s supposed to be doing, it doesn’t tell you anything about how ffmpeg is holding up on its end.
Also, I probably should have brought this up first, but try compiling a more recent build. I searched the some of the commits and it looks like there have been several enhancements made to mitigate this very issue. Also you could add avresample, make some adjustments to the compiler flags (leave some libs out, enable lto, etc) and have it optimized to take in multiple streams of high-bit-rate video without a hiccup.
P.S. Did you attach a link to an image because I didn't get that.
More information about the ffmpeg-user
mailing list