11 #include "ntv2m31publicinterface.h" 24 M31_FILE_1280X720_420_8_50p,
25 M31_FILE_1280X720_420_8_5994p,
26 M31_FILE_1280X720_420_8_60p,
28 M31_FILE_1280X720_422_10_50p,
29 M31_FILE_1280X720_422_10_5994p,
30 M31_FILE_1280X720_422_10_60p,
32 M31_FILE_1920X1080_420_8_2398p,
33 M31_FILE_1920X1080_420_8_24p,
34 M31_FILE_1920X1080_420_8_25p,
35 M31_FILE_1920X1080_420_8_2997p,
36 M31_FILE_1920X1080_420_8_30p,
37 M31_FILE_1920X1080_420_8_50i,
38 M31_FILE_1920X1080_420_8_5994i,
39 M31_FILE_1920X1080_420_8_50p,
40 M31_FILE_1920X1080_420_8_5994p,
41 M31_FILE_1920X1080_420_8_60p,
43 M31_FILE_1920X1080_422_10_2398p,
44 M31_FILE_1920X1080_422_10_24p,
45 M31_FILE_1920X1080_422_10_25p,
46 M31_FILE_1920X1080_422_10_2997p,
47 M31_FILE_1920X1080_422_10_30p,
48 M31_FILE_1920X1080_422_10_50i,
49 M31_FILE_1920X1080_422_10_5994i,
50 M31_FILE_1920X1080_422_10_50p,
51 M31_FILE_1920X1080_422_10_5994p,
52 M31_FILE_1920X1080_422_10_60p,
54 M31_FILE_2048X1080_420_8_2398p,
55 M31_FILE_2048X1080_420_8_24p,
56 M31_FILE_2048X1080_420_8_25p,
57 M31_FILE_2048X1080_420_8_2997p,
58 M31_FILE_2048X1080_420_8_30p,
59 M31_FILE_2048X1080_420_8_50p,
60 M31_FILE_2048X1080_420_8_5994p,
61 M31_FILE_2048X1080_420_8_60p,
63 M31_FILE_2048X1080_422_10_2398p,
64 M31_FILE_2048X1080_422_10_24p,
65 M31_FILE_2048X1080_422_10_25p,
66 M31_FILE_2048X1080_422_10_2997p,
67 M31_FILE_2048X1080_422_10_30p,
68 M31_FILE_2048X1080_422_10_50p,
69 M31_FILE_2048X1080_422_10_5994p,
70 M31_FILE_2048X1080_422_10_60p,
72 M31_FILE_3840X2160_420_8_2398p,
73 M31_FILE_3840X2160_420_8_24p,
74 M31_FILE_3840X2160_420_8_25p,
75 M31_FILE_3840X2160_420_8_2997p,
76 M31_FILE_3840X2160_420_8_30p,
77 M31_FILE_3840X2160_420_8_50p,
78 M31_FILE_3840X2160_420_8_5994p,
79 M31_FILE_3840X2160_420_8_60p,
81 M31_FILE_3840X2160_420_10_50p,
82 M31_FILE_3840X2160_420_10_5994p,
83 M31_FILE_3840X2160_420_10_60p,
85 M31_FILE_3840X2160_422_8_2398p,
86 M31_FILE_3840X2160_422_8_24p,
87 M31_FILE_3840X2160_422_8_25p,
88 M31_FILE_3840X2160_422_8_2997p,
89 M31_FILE_3840X2160_422_8_30p,
90 M31_FILE_3840X2160_422_8_50p,
91 M31_FILE_3840X2160_422_8_5994p,
92 M31_FILE_3840X2160_422_8_60p,
94 M31_FILE_3840X2160_422_10_2398p,
95 M31_FILE_3840X2160_422_10_24p,
96 M31_FILE_3840X2160_422_10_25p,
97 M31_FILE_3840X2160_422_10_2997p,
98 M31_FILE_3840X2160_422_10_30p,
99 M31_FILE_3840X2160_422_10_50p,
100 M31_FILE_3840X2160_422_10_5994p,
101 M31_FILE_3840X2160_422_10_60p,
103 M31_FILE_4096X2160_420_10_5994p,
104 M31_FILE_4096X2160_420_10_60p,
105 M31_FILE_4096X2160_422_10_50p,
106 M31_FILE_4096X2160_422_10_5994p_IF,
107 M31_FILE_4096X2160_422_10_60p_IF,
109 M31_VIF_1280X720_420_8_50p,
110 M31_VIF_1280X720_420_8_5994p,
111 M31_VIF_1280X720_420_8_60p,
113 M31_VIF_1280X720_422_10_50p,
114 M31_VIF_1280X720_422_10_5994p,
115 M31_VIF_1280X720_422_10_60p,
117 M31_VIF_1920X1080_420_8_50p,
118 M31_VIF_1920X1080_420_8_5994p,
119 M31_VIF_1920X1080_420_10_60p,
121 M31_VIF_1920X1080_422_10_5994p,
122 M31_VIF_1920X1080_422_10_60p,
124 M31_VIF_3840X2160_420_8_50p,
125 M31_VIF_3840X2160_420_8_5994p,
126 M31_VIF_3840X2160_420_8_60p,
128 M31_VIF_3840X2160_420_10_50p,
129 M31_VIF_3840X2160_420_10_5994p,
130 M31_VIF_3840X2160_420_10_60p,
132 M31_VIF_3840X2160_422_10_50p,
133 M31_VIF_3840X2160_422_10_5994p,
134 M31_VIF_3840X2160_422_10_60p,
158 cout <<
"M31 Presets" << endl;
162 if (!presetStr.empty())
163 cout << ndx <<
": " << presetStr << endl;
170 cout <<
"M31 Formats" << endl;
174 if (!pixFormatStr.empty())
175 cout << ndx <<
": " << pixFormatStr << endl;
181 int main (
int argc,
const char ** argv)
183 M31VideoPreset m31Preset (M31_NUMVIDEOPRESETS);
195 UWord audioChannels (0);
203 {
"audio",
'a',
POPT_ARG_SHORT, &audioChannels, 0,
"number of audio channels",
"1-16"},
204 {
"device",
'd',
POPT_ARG_STRING, &pDeviceSpec, 0,
"device to use",
"index#, serial#, or model"},
205 {
"channel",
'c',
POPT_ARG_INT, &channelNumber, 0,
"channel to use",
"1-4"},
206 {
"format",
'f',
POPT_ARG_INT, &codecFormat, 0,
"format to use",
"use '-lf' for list"},
207 {
"preset",
'p',
POPT_ARG_INT, &codecPreset, 0,
"codec preset to use",
"use '-lp' for list"},
208 {
"quad",
'q',
POPT_ARG_NONE, &codecQuad, 0,
"interpret 4 inputs as UHD",
""},
209 {
"list",
'l',
POPT_ARG_STRING, &pWhatToList, 0,
"list options",
"p or f (presets or formats)"},
210 {
"tcb",
'b',
POPT_ARG_NONE, &timeCode, 0,
"add timecode burn to video",
""},
211 {
"tsi",
't',
POPT_ARG_NONE, &tsiData, 0,
"two sample interleave mode",
""},
212 {
"info",
'i',
POPT_ARG_NONE, &infoData, 0,
"write encoded info file",
""},
224 if (pWhatToList &&
string(pWhatToList) ==
"p")
226 else if (pWhatToList &&
string(pWhatToList) ==
"f")
228 else if (pWhatToList)
229 {cerr <<
"## ERROR: Invalid argument to --list option, expected 'p' or 'f'" << endl;
return 2;}
232 {cerr <<
"## ERROR: Invalid M31 format " << codecFormat <<
" -- expected 0 thru " << (
gNumCodecFormats) << endl;
return 2;}
238 {cerr <<
"## ERROR: Invalid M31 preset " << codecPreset <<
" -- expected 0 thru " << (
gNumCodecPresets) << endl;
return 2;}
245 {cerr <<
"## ERROR: Invalid channel number " << channelNumber <<
" -- expected 1 thru 4" << endl;
return 2;}
254 const uint32_t hevcMaxFrames (maxFrames >=
kNoSelection ? 0xffffffff : uint32_t(maxFrames));
255 NTV2EncodeHEVC hevcEncoder (pDeviceSpec ?
string (pDeviceSpec) :
"0", inputChannel,
256 m31Preset, pixelFormat, codecQuad ?
true :
false,
257 audioChannels, timeCode ?
true :
false,
258 infoData ?
true :
false, tsiData ?
true :
false, hevcMaxFrames);
262 {cerr <<
"## ERROR: Initialization failed" << endl;
return 1;}
271 cout <<
" Capture Capture" << endl
272 <<
" Frames Frames Buffer" << endl
273 <<
"Processed Dropped Level" << endl;
int main(int argc, const char **argv)
static const M31VideoPreset kCodecPreset[]
NTV2Channel GetNTV2ChannelForIndex(const ULWord inIndex0)
NTV2FrameBufferFormat
Identifies a particular video frame buffer pixel format. See Device Frame Buffer Formats for details...
10-Bit 4:2:2 2-Plane YCbCr
static AJAStatus Open(bool incrementRefCount=false)
#define AJA_FAILURE(_status_)
Declares the AJATime class.
virtual M31VideoPreset GetCodecPreset(void)
Get the codec preset.
void SignalHandler(int inSignal)
Declares the NTV2EncodeHEVC class.
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
poptContext poptGetContext(const char *name, int argc, const char **argv, const struct poptOption *options, unsigned int flags)
8-Bit 4:2:2 2-Plane YCbCr
static int printFormats(void)
Declares the most fundamental data types used by NTV2. Since Windows NT was the first principal devel...
static void Sleep(const int32_t inMilliseconds)
Suspends execution of the current thread for a given number of milliseconds.
virtual void Quit(void)
Gracefully stops me from running.
virtual void GetStatus(AVHevcStatus &outStatus)
Provides status information about my input (capture) process.
#define POPT_ARGFLAG_OPTIONAL
static const NTV2FrameBufferFormat kCodecFormat[]
#define NTV2_IS_VALID_CHANNEL(__x__)
static int printPresets(void)
10-Bit 4:2:0 2-Plane YCbCr
virtual AJAStatus Run(void)
Runs me.
static const size_t gNumCodecFormats(sizeof(kCodecFormat)/sizeof(NTV2FrameBufferFormat))
Declares numerous NTV2 utility functions.
Instances of me capture frames in real time from a video signal provided to an input of an AJA device...
#define NTV2M31VideoPresetToString(...)
std::string NTV2FrameBufferFormatToString(const NTV2FrameBufferFormat inValue, const bool inForRetailDisplay=false)
Specifies channel or FrameStore 4 (or the 4th item).
poptContext poptFreeContext(poptContext con)
int poptGetNextOpt(poptContext con)
static const size_t kNoSelection(1000000000)
static bool gGlobalQuit((0))
8-Bit 4:2:0 2-Plane YCbCr
static const size_t gNumCodecPresets(sizeof(kCodecPreset)/sizeof(M31VideoPreset))
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.