57 cout <<
"M31 Presets" << endl;
60 if (!presetStr.empty())
61 cout << ndx <<
": " << presetStr << endl;
68 cout <<
"M31 Formats" << endl;
71 if (!pixFormatStr.empty())
72 cout << ndx <<
": " << pixFormatStr << endl;
78 int main (
int argc,
const char ** argv)
88 int audioChannels (0);
96 {
"audio",
'a',
POPT_ARG_INT, &audioChannels, 0,
"number of audio channels",
"1-16"},
97 {
"device",
'd',
POPT_ARG_STRING, &pDeviceSpec, 0,
"device to use",
"index#, serial#, or model"},
98 {
"format",
'f',
POPT_ARG_INT, &codecFormat, 0,
"format to use",
"use '-lf' for list"},
99 {
"preset",
'p',
POPT_ARG_INT, &codecPreset, 0,
"codec preset to use",
"use '-lp' for list"},
100 {
"list",
'l',
POPT_ARG_STRING, &pWhatToList, 0,
"list options",
"p or f (presets or formats)"},
101 {
"info",
'i',
POPT_ARG_NONE, &infoData, 0,
"write encoded info file",
""},
113 if (pWhatToList &&
string(pWhatToList) ==
"p")
115 else if (pWhatToList &&
string(pWhatToList) ==
"f")
117 else if (pWhatToList)
118 {cerr <<
"## ERROR: Invalid argument to --list option, expected 'p' or 'f'" << endl;
return 2;}
121 {cerr <<
"## ERROR: Invalid M31 format " << codecFormat <<
" -- expected 0 thru " << (
gNumCodecFormats) << endl;
return 2;}
127 {cerr <<
"## ERROR: Invalid M31 preset " << codecPreset <<
" -- expected 0 thru " << (
gNumCodecPresets) << endl;
return 2;}
139 const bool infoMode (infoData ?
true :
false);
140 const uint32_t hevcMaxFrames (maxFrames >=
kNoSelection ? 0xffffffff : uint32_t(maxFrames));
142 m31Preset, pixelFormat,
UWord(audioChannels),
143 infoMode, hevcMaxFrames);
147 {cerr <<
"## ERROR: Initialization failed" << endl;
return 1;}
157 hevcVifEncoder.
Run();
159 cout <<
" Capture Capture" << endl
160 <<
" Frames Frames Buffer" << endl
161 <<
"Processed Dropped Level" << endl;
177 hevcVifEncoder.
Quit();
Instances of me capture frames in real time from a video signal provided to an input of an AJA device...
int main(int argc, const char **argv)
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
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 const size_t gNumCodecFormats(sizeof(kCodecFormat)/sizeof(NTV2FrameBufferFormat))
static AJAStatus Open(bool incrementRefCount=false)
#define AJA_FAILURE(_status_)
Declares the AJATime class.
void SignalHandler(int inSignal)
static const size_t gNumCodecPresets(sizeof(kCodecPreset)/sizeof(M31VideoPreset))
poptContext poptGetContext(const char *name, int argc, const char **argv, const struct poptOption *options, unsigned int flags)
virtual M31VideoPreset GetCodecPreset(void)
Get the codec preset.
virtual void Quit(void)
Gracefully stops me from running.
const int kNoSelection(1000000000)
virtual void GetStatus(AVHevcStatus *outInputStatus)
Provides status information about my input (capture) process.
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.
static int printFormats(void)
virtual AJAStatus Run(void)
Runs me.
static int printPresets(void)
#define POPT_ARGFLAG_OPTIONAL
10-Bit 4:2:0 2-Plane YCbCr
const M31VideoPreset kCodecPreset[]
std::string NTV2M31VideoPresetToString(const M31VideoPreset val, const bool retailDisplay=false)
Declares numerous NTV2 utility functions.
static bool gGlobalQuit((0))
std::string NTV2FrameBufferFormatToString(const NTV2FrameBufferFormat inValue, const bool inForRetailDisplay=false)
const NTV2FrameBufferFormat kCodecFormat[]
poptContext poptFreeContext(poptContext con)
Declares the NTV2EncodeHEVCVif class.
int poptGetNextOpt(poptContext con)
8-Bit 4:2:0 2-Plane YCbCr