Commit bac6cfcb authored by Deti Fliegl's avatar Deti Fliegl Committed by Michael Niedermayer

avdevice: add decklink input support

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent a5e040ee
...@@ -309,6 +309,7 @@ libavdevice ...@@ -309,6 +309,7 @@ libavdevice
avfoundation.m Thilo Borgmann avfoundation.m Thilo Borgmann
decklink* Deti Fliegl
dshow.c Roger Pack (CC rogerdpack@gmail.com) dshow.c Roger Pack (CC rogerdpack@gmail.com)
fbdev_enc.c Lukasz Marek fbdev_enc.c Lukasz Marek
gdigrab.c Roger Pack (CC rogerdpack@gmail.com) gdigrab.c Roger Pack (CC rogerdpack@gmail.com)
......
...@@ -256,7 +256,7 @@ External library support: ...@@ -256,7 +256,7 @@ External library support:
--enable-libzmq enable message passing via libzmq [no] --enable-libzmq enable message passing via libzmq [no]
--enable-libzvbi enable teletext support via libzvbi [no] --enable-libzvbi enable teletext support via libzvbi [no]
--disable-lzma disable lzma [autodetect] --disable-lzma disable lzma [autodetect]
--enable-decklink enable Blackmagick DeckLink output [no] --enable-decklink enable Blackmagick DeckLink I/O support [no]
--enable-openal enable OpenAL 1.1 capture support [no] --enable-openal enable OpenAL 1.1 capture support [no]
--enable-opencl enable OpenCL code --enable-opencl enable OpenCL code
--enable-opengl enable OpenGL rendering [no] --enable-opengl enable OpenGL rendering [no]
...@@ -2455,6 +2455,8 @@ bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr ...@@ -2455,6 +2455,8 @@ bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr
caca_outdev_deps="libcaca" caca_outdev_deps="libcaca"
decklink_outdev_deps="decklink pthreads" decklink_outdev_deps="decklink pthreads"
decklink_outdev_extralibs="-lstdc++" decklink_outdev_extralibs="-lstdc++"
decklink_indev_deps="decklink pthreads"
decklink_indev_extralibs="-lstdc++"
dshow_indev_deps="IBaseFilter" dshow_indev_deps="IBaseFilter"
dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid" dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid"
dv1394_indev_deps="dv1394" dv1394_indev_deps="dv1394"
......
...@@ -922,4 +922,58 @@ Use the MIT-SHM extension for shared memory. Default value is @code{1}. ...@@ -922,4 +922,58 @@ Use the MIT-SHM extension for shared memory. Default value is @code{1}.
It may be necessary to disable it for remote displays. It may be necessary to disable it for remote displays.
@end table @end table
@section decklink
The decklink input device provides capture capabilities for Blackmagic
DeckLink devices.
To enable this input device, you need the Blackmagic DeckLink SDK and you
need to configure with the appropriate @code{--extra-cflags}
and @code{--extra-ldflags}.
On Windows, you need to run the IDL files through @command{widl}.
DeckLink is very picky about the formats it supports. Pixel format is always
uyvy422, framerate and video size must be determined for your device with
@command{-list_formats 1}. Audio sample rate is always 48 kHz and the number
of channels currently is limited to 2 (stereo).
@subsection Options
@table @option
@item list_devices
If set to @option{true}, print a list of devices and exit.
Defaults to @option{false}.
@item list_formats
If set to @option{true}, print a list of supported formats and exit.
Defaults to @option{false}.
@end table
@subsection Examples
@itemize
@item
List input devices:
@example
ffmpeg -f decklink -list_devices 1 -i dummy
@end example
@item
List supported formats:
@example
ffmpeg -f decklink -list_formats 1 -i 'Intensity Pro'
@end example
@item
Capture video clip at 1080i50 (format 11):
@example
ffmpeg -f decklink -i 'Intensity Pro@@11' -acodec copy -vcodec copy output.avi
@end example
@end itemize
@c man end INPUT DEVICES @c man end INPUT DEVICES
...@@ -17,6 +17,7 @@ OBJS-$(CONFIG_AVFOUNDATION_INDEV) += avfoundation.o ...@@ -17,6 +17,7 @@ OBJS-$(CONFIG_AVFOUNDATION_INDEV) += avfoundation.o
OBJS-$(CONFIG_BKTR_INDEV) += bktr.o OBJS-$(CONFIG_BKTR_INDEV) += bktr.o
OBJS-$(CONFIG_CACA_OUTDEV) += caca.o OBJS-$(CONFIG_CACA_OUTDEV) += caca.o
OBJS-$(CONFIG_DECKLINK_OUTDEV) += decklink_enc.o decklink_enc_c.o decklink_common.o OBJS-$(CONFIG_DECKLINK_OUTDEV) += decklink_enc.o decklink_enc_c.o decklink_common.o
OBJS-$(CONFIG_DECKLINK_INDEV) += decklink_dec.o decklink_dec_c.o decklink_common.o
OBJS-$(CONFIG_DSHOW_INDEV) += dshow.o dshow_enummediatypes.o \ OBJS-$(CONFIG_DSHOW_INDEV) += dshow.o dshow_enummediatypes.o \
dshow_enumpins.o dshow_filter.o \ dshow_enumpins.o dshow_filter.o \
dshow_pin.o dshow_common.o dshow_pin.o dshow_common.o
...@@ -57,7 +58,7 @@ OBJS-$(HAVE_LIBC_MSVCRT) += file_open.o ...@@ -57,7 +58,7 @@ OBJS-$(HAVE_LIBC_MSVCRT) += file_open.o
# Windows resource file # Windows resource file
SLIBOBJS-$(HAVE_GNU_WINDRES) += avdeviceres.o SLIBOBJS-$(HAVE_GNU_WINDRES) += avdeviceres.o
SKIPHEADERS-$(CONFIG_DECKLINK) += decklink_enc.h decklink_common.h SKIPHEADERS-$(CONFIG_DECKLINK) += decklink_enc.h decklink_dec.h decklink_common.h
SKIPHEADERS-$(CONFIG_DSHOW_INDEV) += dshow_capture.h SKIPHEADERS-$(CONFIG_DSHOW_INDEV) += dshow_capture.h
SKIPHEADERS-$(CONFIG_FBDEV_INDEV) += fbdev_common.h SKIPHEADERS-$(CONFIG_FBDEV_INDEV) += fbdev_common.h
SKIPHEADERS-$(CONFIG_FBDEV_OUTDEV) += fbdev_common.h SKIPHEADERS-$(CONFIG_FBDEV_OUTDEV) += fbdev_common.h
......
...@@ -50,7 +50,7 @@ void avdevice_register_all(void) ...@@ -50,7 +50,7 @@ void avdevice_register_all(void)
REGISTER_INDEV (AVFOUNDATION, avfoundation); REGISTER_INDEV (AVFOUNDATION, avfoundation);
REGISTER_INDEV (BKTR, bktr); REGISTER_INDEV (BKTR, bktr);
REGISTER_OUTDEV (CACA, caca); REGISTER_OUTDEV (CACA, caca);
REGISTER_OUTDEV (DECKLINK, decklink); REGISTER_INOUTDEV(DECKLINK, decklink);
REGISTER_INDEV (DSHOW, dshow); REGISTER_INDEV (DSHOW, dshow);
REGISTER_INDEV (DV1394, dv1394); REGISTER_INDEV (DV1394, dv1394);
REGISTER_INOUTDEV(FBDEV, fbdev); REGISTER_INOUTDEV(FBDEV, fbdev);
......
This diff is collapsed.
/*
* Blackmagic DeckLink output
* Copyright (c) 2013-2014 Ramiro Polla
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifdef __cplusplus
extern "C" {
#endif
int ff_decklink_read_header(AVFormatContext *avctx);
int ff_decklink_read_packet(AVFormatContext *avctx, AVPacket *pkt);
int ff_decklink_read_close(AVFormatContext *avctx);
#ifdef __cplusplus
} /* extern "C" */
#endif
/*
* Blackmagic DeckLink output
* Copyright (c) 2014 Deti Fliegl
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavformat/avformat.h"
#include "libavutil/opt.h"
#include "decklink_common_c.h"
#include "decklink_dec.h"
#define OFFSET(x) offsetof(struct decklink_cctx, x)
#define DEC AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = {
{ "list_devices", "list available devices" , OFFSET(list_devices), AV_OPT_TYPE_INT , { .i64 = 0 }, 0, 1, DEC },
{ "list_formats", "list supported formats" , OFFSET(list_formats), AV_OPT_TYPE_INT , { .i64 = 0 }, 0, 1, DEC },
{ NULL },
};
static const AVClass decklink_demuxer_class = {
.class_name = "Blackmagic DeckLink demuxer",
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
.category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
};
AVInputFormat ff_decklink_demuxer = {
.name = "decklink",
.long_name = NULL_IF_CONFIG_SMALL("Blackmagic DeckLink input"),
.flags = AVFMT_NOFILE | AVFMT_RAWPICTURE,
.priv_class = &decklink_demuxer_class,
.priv_data_size = sizeof(struct decklink_cctx),
.read_header = ff_decklink_read_header,
.read_packet = ff_decklink_read_packet,
.read_close = ff_decklink_read_close,
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment