vendredi 6 mars 2015

ffmpeg blackmagic

we assume the blackmagic module and SDK are properly installed

1-download the ffmpeg source from http://www.ffmpeg.org/download.html
2-configure for blackmagic and h264

./configure --enable-decklink --enable-shared \
--extra-cflags="-I/usr/include/blackmagic" \
–-extra-ldflags="-L/usr/include/blackmagic" \
--enable-libx264 –enable-gpl

make
sudo make install

export LD_LIBRARY_PATH=/usr/local/lib

To check the name of your device
ffmpeg -f decklink -list_devices 1 -i dummy


you  get something like
[decklink @ 0x260d3c0] Blackmagic DeckLink devices:
[decklink @ 0x260d3c0]     'DeckLink Mini Recorder'
Then

you can read and stream your camera e.g.

ffmpeg  -f decklink -i 'DeckLink Mini Recorder@11' -threads 4 -vcodec libx264  -preset ultrafast -pix_fmt yuv420p  -b 20000k  -tune zerolatency -an -f rtp rtp://10.10.0.2:1234/


There will be minimal latency (~1s in my case) using a wifi-n connection and rtp
as expected, udp gives more latency several seconds


https://www.ffmpeg.org/ffmpeg-devices.html#Examples-6