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_50p,
86 M31_FILE_3840X2160_422_8_5994p,
87 M31_FILE_3840X2160_422_8_60p,
89 M31_FILE_3840X2160_422_10_2398p,
90 M31_FILE_3840X2160_422_10_24p,
91 M31_FILE_3840X2160_422_10_25p,
92 M31_FILE_3840X2160_422_10_2997p,
93 M31_FILE_3840X2160_422_10_30p,
94 M31_FILE_3840X2160_422_10_50p,
95 M31_FILE_3840X2160_422_10_5994p,
96 M31_FILE_3840X2160_422_10_60p,
114 cout <<
"M31 Presets" << endl;
118 if (!presetStr.empty())
119 cout << ndx <<
": " << presetStr << endl;
126 cout <<
"M31 Formats" << endl;
130 if (!pixFormatStr.empty())
131 cout << ndx <<
": " << pixFormatStr << endl;
142 int main (
int argc,
const char ** argv)
144 M31VideoPreset m31Preset (M31_NUMVIDEOPRESETS);
149 uint32_t channelNumber (1);
160 {
"device",
'd',
POPT_ARG_STRING, &pDeviceSpec, 0,
"device to use",
"index#, serial#, or model"},
161 {
"channel",
'c',
POPT_ARG_INT, &channelNumber, 0,
"channel to use",
"1-4"},
162 {
"format",
'f',
POPT_ARG_INT, &codecFormat, 0,
"format to use",
"use '-lf' for list"},
163 {
"preset",
'p',
POPT_ARG_INT, &codecPreset, 0,
"codec preset to use",
"use '-lp' for list"},
164 {
"list",
'l',
POPT_ARG_STRING, &pWhatToList, 0,
"list options",
"p or f (presets or formats)"},
165 {
"info",
'i',
POPT_ARG_NONE, &infoData, 0,
"write encoded info file",
""},
175 if (pWhatToList &&
string(pWhatToList) ==
"p")
177 else if (pWhatToList &&
string(pWhatToList) ==
"f")
179 else if (pWhatToList)
180 {cerr <<
"## ERROR: Invalid argument to --list option, expected 'p' or 'f'" << endl;
return 2;}
183 {cerr <<
"## ERROR: Invalid M31 format " << codecFormat <<
" -- expected 0 thru " << (
gNumCodecFormats) << endl;
return 2;}
186 {cerr <<
"## ERROR: Invalid M31 preset " << codecPreset <<
" -- expected 0 thru " << (
gNumCodecPresets) << endl;
return 2;}
193 {cerr <<
"## ERROR: Invalid channel number " << channelNumber <<
" -- expected 1 thru 4" << endl;
return 2;}
202 NTV2EncodeHEVCFile hevcFileEncoder (pDeviceSpec ?
string (pDeviceSpec) :
"0", inputChannel,
207 {cerr <<
"## ERROR: Initialization failed" << endl;
return 1;}
214 hevcFileEncoder.
Run();
216 cout <<
" Capture Capture" << endl
217 <<
" Frames Frames Buffer" << endl
218 <<
"Processed Dropped Level" << endl;
234 hevcFileEncoder.
Quit();
int main(int argc, const char **argv)
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)
Declares the NTV2EncodeHEVCFile class.
#define AJA_FAILURE(_status_)
Instances of me capture frames in real time from a video signal provided to an input of an AJA device...
static const size_t gNumCodecFormats(sizeof(kCodecFormat)/sizeof(NTV2FrameBufferFormat))
Declares the AJATime class.
virtual void Quit(void)
Gracefully stops me from running.
virtual AJAStatus Run(void)
Runs me.
void SignalHandler(int inSignal)
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
virtual M31VideoPreset GetCodecPreset(void)
Get the codec preset.
poptContext poptGetContext(const char *name, int argc, const char **argv, const struct poptOption *options, unsigned int flags)
static const size_t gNumCodecPresets(sizeof(kCodecPreset)/sizeof(M31VideoPreset))
const int kNoSelection(1000000000)
8-Bit 4:2:2 2-Plane YCbCr
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.
#define NTV2_IS_VALID_CHANNEL(__x__)
10-Bit 4:2:0 2-Plane YCbCr
virtual void GetStatus(AVHevcStatus &outStatus)
Provides status information about my input (capture) process.
const M31VideoPreset kCodecPreset[]
Declares numerous NTV2 utility functions.
#define NTV2M31VideoPresetToString(...)
std::string NTV2FrameBufferFormatToString(const NTV2FrameBufferFormat inValue, const bool inForRetailDisplay=false)
const NTV2FrameBufferFormat kCodecFormat[]
Specifies channel or FrameStore 4 (or the 4th item).
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
poptContext poptFreeContext(poptContext con)
static int printPresets(void)
int poptGetNextOpt(poptContext con)
static int printFormats(void)
8-Bit 4:2:0 2-Plane YCbCr
static bool gGlobalQuit((0))