Skip to content

Commit

Permalink
Revert "expose NVMPI num_capture_buffers (Jetson specific)"
Browse files Browse the repository at this point in the history
This reverts commit e934d2f.
  • Loading branch information
bmegli committed Mar 29, 2023
1 parent e934d2f commit b738ccf
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 15 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ cd hardware-video-encoder
mkdir build
cd build
cmake ..
# alternatively specify FFMPEG_MODULE_PATH pointing to LGPL FFMPEG
# cmake .. -DFFMPEG_MODULE_PATH=[directory_with_FindFFMPEG.cmake]
make
```

Expand Down Expand Up @@ -126,8 +124,7 @@ There are just 4 functions and 3 user-visible data types:
DEVICE, ENCODER, PIXEL_FORMAT, PROFILE, BFRAMES,
BITRATE, QP, GOP_SIZE, COMPRESSION_LEVEL,
VAAPI_LOW_POWER
NVENC_PRESET, NVENC_DELAY, NVENC_ZEROLATENCY,
NVMPI_NUM_CAPTURE_BUFFERS};
NVENC_PRESET, NVENC_DELAY, NVENC_ZEROLATENCY};

struct hve *hardware_encoder=hve_init(&hardware_config);
struct hve_frame frame = { 0 };
Expand Down
4 changes: 1 addition & 3 deletions examples/hve_encode_raw_h264.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const int VAAPI_LOW_POWER=0; //alternative VAAPI limited low-power encoding path
const char *NVENC_PRESET=NULL; //NVENC and codec specific, NULL / "" or like "default", "slow", "medium", "fast", "hp", "hq", "bd", "ll", "llhq", "llhp", "lossless", "losslesshp"
const int NVENC_DELAY=0; //NVENC specific delay of frame output, 0 for default, -1 for 0 or positive value, set -1 to minimize latency
const int NVENC_ZEROLATENCY=0; //NVENC specific no reordering delay if non-zero, enable to minimize latency
const int NVMPI_NUM_CAPTURE_BUFFERS=0; //NVMPI specific number of buffers in the capture context if non-zero, smaller values may improve latency

int encoding_loop(struct hve *hardware_encoder, FILE *output_file);
int process_user_input(int argc, char* argv[]);
Expand All @@ -51,8 +50,7 @@ int main(int argc, char* argv[])
DEVICE, ENCODER, PIXEL_FORMAT, PROFILE, BFRAMES,
BITRATE, QP, GOP_SIZE, COMPRESSION_LEVEL,
VAAPI_LOW_POWER,
NVENC_PRESET, NVENC_DELAY, NVENC_ZEROLATENCY,
NVMPI_NUM_CAPTURE_BUFFERS};
NVENC_PRESET, NVENC_DELAY, NVENC_ZEROLATENCY};

struct hve *hardware_encoder;

Expand Down
5 changes: 1 addition & 4 deletions examples/hve_encode_raw_hevc10.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const int VAAPI_LOW_POWER=0; //alternative VAAPI limited low-power encoding path
const char *NVENC_PRESET=NULL; //NVENC and codec specific, NULL / "" or like "default", "slow", "medium", "fast", "hp", "hq", "bd", "ll", "llhq", "llhp", "lossless", "losslesshp"
const int NVENC_DELAY=0; //NVENC specific delay of frame output, 0 for default, -1 for 0 or positive value, set -1 to minimize latency
const int NVENC_ZEROLATENCY=0; //NVENC specific no reordering delay if non-zero, enable to minimize latency
const int NVMPI_NUM_CAPTURE_BUFFERS=0; //NVMPI specific number of buffers in the capture context if non-zero, smaller values may improve latency

int encoding_loop(struct hve *hardware_encoder, FILE *output_file);
int process_user_input(int argc, char* argv[]);
Expand All @@ -51,9 +50,7 @@ int main(int argc, char* argv[])
DEVICE, ENCODER, PIXEL_FORMAT, PROFILE, BFRAMES,
BITRATE, QP, GOP_SIZE, COMPRESSION_LEVEL,
VAAPI_LOW_POWER,
NVENC_PRESET, NVENC_DELAY, NVENC_ZEROLATENCY,
NVMPI_NUM_CAPTURE_BUFFERS};

NVENC_PRESET, NVENC_DELAY, NVENC_ZEROLATENCY};
struct hve *hardware_encoder;

//prepare file for raw HEVC output
Expand Down
3 changes: 0 additions & 3 deletions hve.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@ struct hve *hve_init(const struct hve_config *config)
if(config->nvenc_zerolatency && (av_dict_set_int(&opts, "zerolatency", config->nvenc_zerolatency != 0 , 0) < 0))
return hve_close_and_return_null(h, "failed to initialize option dictionary (NVENC zerolatency)");

if(config->nvmpi_num_capture_buffers && (av_dict_set_int(&opts, "num_capture_buffers", config->nvmpi_num_capture_buffers, 0) < 0))
return hve_close_and_return_null(h, "failed to initialize option dictionary (NVMPI num_capture_buffers)");

if((err = avcodec_open2(h->avctx, codec, &opts)) < 0)
{
av_dict_free(&opts);
Expand Down
1 change: 0 additions & 1 deletion hve.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ struct hve_config
const char *nvenc_preset; //!< NVENC and codec specific, NULL / "" or like "default", "slow", "medium", "fast", "hp", "hq", "bd", "ll", "llhq", "llhp", "lossless", "losslesshp"
int nvenc_delay; //NVENC specific delay of frame output, 0 for default, -1 for 0 or positive value, set -1 to minimize latency
int nvenc_zerolatency; //NVENC specific no reordering delay if non-zero, enable to minimize latency
int nvmpi_num_capture_buffers; //NVMPI specific number of buffers in the capture context if non-zero, smaller values may improve latency
};

/**
Expand Down

0 comments on commit b738ccf

Please sign in to comment.