Commit 2634927f authored by Maksym Veremeyenko's avatar Maksym Veremeyenko Committed by Marton Balint

lavd: implement NewTek NDI input/output device support

Signed-off-by: 's avatarMarton Balint <cus@passwd.hu>
parent 84ee6512
...@@ -34,6 +34,7 @@ version <next>: ...@@ -34,6 +34,7 @@ version <next>:
- floodfill video filter - floodfill video filter
- pseudocolor video filter - pseudocolor video filter
- raw G.726 muxer and demuxer, left- and right-justified - raw G.726 muxer and demuxer, left- and right-justified
- NewTek NDI input/output device
version 3.3: version 3.3:
- CrystalHD decoder moved to new decode API - CrystalHD decoder moved to new decode API
......
...@@ -277,6 +277,7 @@ External library support: ...@@ -277,6 +277,7 @@ External library support:
--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 Blackmagic DeckLink I/O support [no] --enable-decklink enable Blackmagic DeckLink I/O support [no]
--enable-libndi_newtek enable Newteck NDI I/O support [no]
--enable-mediacodec enable Android MediaCodec support [no] --enable-mediacodec enable Android MediaCodec support [no]
--enable-libmysofa enable libmysofa, needed for sofalizer filter [no] --enable-libmysofa enable libmysofa, needed for sofalizer filter [no]
--enable-openal enable OpenAL 1.1 capture support [no] --enable-openal enable OpenAL 1.1 capture support [no]
...@@ -1508,6 +1509,7 @@ EXTERNAL_LIBRARY_GPL_LIST=" ...@@ -1508,6 +1509,7 @@ EXTERNAL_LIBRARY_GPL_LIST="
EXTERNAL_LIBRARY_NONFREE_LIST=" EXTERNAL_LIBRARY_NONFREE_LIST="
decklink decklink
libndi_newtek
libfdk_aac libfdk_aac
openssl openssl
" "
...@@ -3014,6 +3016,10 @@ decklink_indev_deps="decklink threads" ...@@ -3014,6 +3016,10 @@ decklink_indev_deps="decklink threads"
decklink_indev_extralibs="-lstdc++" decklink_indev_extralibs="-lstdc++"
decklink_outdev_deps="decklink threads" decklink_outdev_deps="decklink threads"
decklink_outdev_extralibs="-lstdc++" decklink_outdev_extralibs="-lstdc++"
libndi_newtek_indev_deps="libndi_newtek"
libndi_newtek_indev_extralibs="-lndi"
libndi_newtek_outdev_deps="libndi_newtek"
libndi_newtek_outdev_extralibs="-lndi"
dshow_indev_deps="IBaseFilter" dshow_indev_deps="IBaseFilter"
dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid -loleaut32 -lshlwapi" dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid -loleaut32 -lshlwapi"
dv1394_indev_deps="dv1394" dv1394_indev_deps="dv1394"
...@@ -5567,6 +5573,8 @@ avisynth_demuxer_extralibs='$ldl' ...@@ -5567,6 +5573,8 @@ avisynth_demuxer_extralibs='$ldl'
cuda_extralibs='$ldl' cuda_extralibs='$ldl'
decklink_outdev_extralibs="$decklink_outdev_extralibs $ldl" decklink_outdev_extralibs="$decklink_outdev_extralibs $ldl"
decklink_indev_extralibs="$decklink_indev_extralibs $ldl" decklink_indev_extralibs="$decklink_indev_extralibs $ldl"
libndi_newtek_outdev_extralibs="$libndi_newtek_outdev_extralibs $ldl"
libndi_newtek_indev_extralibs="$libndi_newtek_indev_extralibs $ldl"
frei0r_filter_extralibs='$ldl' frei0r_filter_extralibs='$ldl'
frei0r_src_filter_extralibs='$ldl' frei0r_src_filter_extralibs='$ldl'
ladspa_filter_extralibs='$ldl' ladspa_filter_extralibs='$ldl'
...@@ -5825,6 +5833,7 @@ enabled coreimage_filter && { check_header_objcc QuartzCore/CoreImage.h || disa ...@@ -5825,6 +5833,7 @@ enabled coreimage_filter && { check_header_objcc QuartzCore/CoreImage.h || disa
enabled coreimagesrc_filter && { check_header_objcc QuartzCore/CoreImage.h || disable coreimagesrc_filter; } enabled coreimagesrc_filter && { check_header_objcc QuartzCore/CoreImage.h || disable coreimagesrc_filter; }
enabled decklink && { { check_header DeckLinkAPI.h || die "ERROR: DeckLinkAPI.h header not found"; } && enabled decklink && { { check_header DeckLinkAPI.h || die "ERROR: DeckLinkAPI.h header not found"; } &&
{ check_cpp_condition DeckLinkAPIVersion.h "BLACKMAGIC_DECKLINK_API_VERSION >= 0x0a060100" || die "ERROR: Decklink API version must be >= 10.6.1."; } } { check_cpp_condition DeckLinkAPIVersion.h "BLACKMAGIC_DECKLINK_API_VERSION >= 0x0a060100" || die "ERROR: Decklink API version must be >= 10.6.1."; } }
enabled libndi_newtek && { check_header Processing.NDI.Lib.h || die "ERROR: Processing.NDI.Lib.h header not found"; }
enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; } enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
enabled gmp && require gmp gmp.h mpz_export -lgmp enabled gmp && require gmp gmp.h mpz_export -lgmp
enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
......
...@@ -332,6 +332,54 @@ ffmpeg -channels 16 -format_code Hi50 -f decklink -i 'UltraStudio Mini Recorder' ...@@ -332,6 +332,54 @@ ffmpeg -channels 16 -format_code Hi50 -f decklink -i 'UltraStudio Mini Recorder'
@end itemize @end itemize
@section libndi_newtek
The libndi_newtek input device provides capture capabilities for using NDI (Network
Device Interface, standard created by NewTek).
Input filename is a NDI source name that could be found by sending -find_sources 1
to command line - it has no specific syntax but human-readable formatted.
To enable this input device, you need the NDI SDK and you
need to configure with the appropriate @code{--extra-cflags}
and @code{--extra-ldflags}.
@subsection Options
@table @option
@item find_sources
If set to @option{true}, print a list of found/available NDI sources and exit.
Defaults to @option{false}.
@item wait_sources
Override time to wait until the number of online sources have changed.
Defaults to @option{0.5}.
@item allow_video_fields
When this flag is @option{false}, all video that you receive will be progressive.
Defaults to @option{true}.
@end table
@subsection Examples
@itemize
@item
List input devices:
@example
ffmpeg -f libndi_newtek -find_sources 1 -i dummy
@end example
@item
Restream to NDI:
@example
ffmpeg -f libndi_newtek -i "DEV-5.INTERNAL.M1STEREO.TV (NDI_SOURCE_NAME_1)" -f libndi_newtek -y NDI_SOURCE_NAME_2
@end example
@end itemize
@section dshow @section dshow
Windows DirectShow input device. Windows DirectShow input device.
......
...@@ -182,6 +182,51 @@ ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 -s 720x486 -r 24000/1001 'DeckLi ...@@ -182,6 +182,51 @@ ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 -s 720x486 -r 24000/1001 'DeckLi
@end itemize @end itemize
@section libndi_newtek
The libndi_newtek output device provides playback capabilities for using NDI (Network
Device Interface, standard created by NewTek).
Output filename is a NDI name.
To enable this output device, you need the NDI SDK and you
need to configure with the appropriate @code{--extra-cflags}
and @code{--extra-ldflags}.
NDI uses uyvy422 pixel format natively, but also supports bgra, bgr0, rgba and
rgb0.
@subsection Options
@table @option
@item reference_level
The audio reference level in dB. This specifies how many dB above the
reference level (+4dBU) is the full range of 16 bit audio.
Defaults to @option{0}.
@item clock_video
These specify whether video "clock" themselves.
Defaults to @option{false}.
@item clock_audio
These specify whether audio "clock" themselves.
Defaults to @option{false}.
@end table
@subsection Examples
@itemize
@item
Play video clip:
@example
ffmpeg -i "udp://@@239.1.1.1:10480?fifo_size=1000000&overrun_nonfatal=1" -vf "scale=720:576,fps=fps=25,setdar=dar=16/9,format=pix_fmts=uyvy422" -f libndi_newtek NEW_NDI1
@end example
@end itemize
@section fbdev @section fbdev
Linux framebuffer output device. Linux framebuffer output device.
......
...@@ -19,6 +19,8 @@ OBJS-$(CONFIG_BKTR_INDEV) += bktr.o ...@@ -19,6 +19,8 @@ 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_DECKLINK_INDEV) += decklink_dec.o decklink_dec_c.o decklink_common.o
OBJS-$(CONFIG_LIBNDI_NEWTEK_OUTDEV) += libndi_newtek_enc.o
OBJS-$(CONFIG_LIBNDI_NEWTEK_INDEV) += libndi_newtek_dec.o
OBJS-$(CONFIG_DSHOW_INDEV) += dshow_crossbar.o dshow.o dshow_enummediatypes.o \ OBJS-$(CONFIG_DSHOW_INDEV) += dshow_crossbar.o 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
...@@ -60,6 +62,8 @@ SLIBOBJS-$(HAVE_GNU_WINDRES) += avdeviceres.o ...@@ -60,6 +62,8 @@ SLIBOBJS-$(HAVE_GNU_WINDRES) += avdeviceres.o
SKIPHEADERS += decklink_common.h SKIPHEADERS += decklink_common.h
SKIPHEADERS-$(CONFIG_DECKLINK) += decklink_enc.h decklink_dec.h \ SKIPHEADERS-$(CONFIG_DECKLINK) += decklink_enc.h decklink_dec.h \
decklink_common_c.h decklink_common_c.h
SKIPHEADERS-$(CONFIG_LIBNDI_NEWTEK_INDEV) += libndi_newtek_common.h
SKIPHEADERS-$(CONFIG_LIBNDI_NEWTEK_OUTDEV) += libndi_newtek_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
......
...@@ -46,6 +46,7 @@ static void register_all(void) ...@@ -46,6 +46,7 @@ static void register_all(void)
REGISTER_INDEV (BKTR, bktr); REGISTER_INDEV (BKTR, bktr);
REGISTER_OUTDEV (CACA, caca); REGISTER_OUTDEV (CACA, caca);
REGISTER_INOUTDEV(DECKLINK, decklink); REGISTER_INOUTDEV(DECKLINK, decklink);
REGISTER_INOUTDEV(LIBNDI_NEWTEK, libndi_newtek);
REGISTER_INDEV (DSHOW, dshow); REGISTER_INDEV (DSHOW, dshow);
REGISTER_INDEV (DV1394, dv1394); REGISTER_INDEV (DV1394, dv1394);
REGISTER_INOUTDEV(FBDEV, fbdev); REGISTER_INOUTDEV(FBDEV, fbdev);
......
/*
* NewTek NDI common code
* Copyright (c) 2017 Maksym Veremeyenko
*
* 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
*/
#ifndef AVDEVICE_LIBNDI_NEWTEK_COMMON_H
#define AVDEVICE_LIBNDI_NEWTEK_COMMON_H
#include <Processing.NDI.Lib.h>
#define NDI_TIME_BASE 10000000
#define NDI_TIME_BASE_Q (AVRational){1, NDI_TIME_BASE}
#endif
This diff is collapsed.
This diff is collapsed.
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
#include "libavutil/version.h" #include "libavutil/version.h"
#define LIBAVDEVICE_VERSION_MAJOR 57 #define LIBAVDEVICE_VERSION_MAJOR 57
#define LIBAVDEVICE_VERSION_MINOR 7 #define LIBAVDEVICE_VERSION_MINOR 8
#define LIBAVDEVICE_VERSION_MICRO 101 #define LIBAVDEVICE_VERSION_MICRO 100
#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \ #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
LIBAVDEVICE_VERSION_MINOR, \ LIBAVDEVICE_VERSION_MINOR, \
......
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