Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Compiling custom cap_ffmpeg_impl.hpp

I have edited cap_ffmpeg_impl.hpp by setting some parameters and print statements. I am compiling the libraries from the souce files. The compilation was successful but the changes in the file are not registered. I am wondering if any one could guide me on this?

Platform Windows 32-bit Opencv 4.2.0

FFMPEG:                      YES (prebuilt binaries)
  avcodec:                   YES (58.54.100)
  avformat:                  YES (58.29.100)
  avutil:                    YES (56.31.100)
  swscale:                   YES (5.5.100)
  avresample:                YES (4.0.0)

Compiling custom cap_ffmpeg_impl.hpp

I have edited cap_ffmpeg_impl.hpp by setting some parameters and print statements. I am compiling the libraries from the souce files. The compilation was successful but the changes in the file are not registered. I am wondering if any one could guide me on this?

Platform Windows 32-bit Opencv 4.2.0

FFMPEG:                      YES (prebuilt binaries)
  avcodec:                   YES (58.54.100)
  avformat:                  YES (58.29.100)
  avutil:                    YES (56.31.100)
  swscale:                   YES (5.5.100)
  avresample:                YES (4.0.0)

Here is the change that I wish to add:

if LIBAVUTIL_BUILD > CALC_FFMPEG_VERSION(51,11,0)

/* Some settings for libx264 encoding, restore dummy values for gop_size
 and qmin since they will be set to reasonable defaults by the libx264
 preset system. Also, use a crf encode with the default quality rating,
 this seems easier than finding an appropriate default bitrate. */
if (c->codec_id == AV_CODEC_ID_H264) {
  c->gop_size = -1;
  c->qmin = -1;

  c->bit_rate = 500;
  if (c->priv_data)
  {
    av_opt_set(c->priv_data,"crf","0", 0);
    av_opt_set(c->priv_data,"preset","ultrafast", 0);
  }
     // av_opt_set(c->priv_data,"crf","23", 0);
}

endif

Compiling custom cap_ffmpeg_impl.hpp

I have edited cap_ffmpeg_impl.hpp by setting some parameters and print statements. I am compiling the libraries from the souce files. The compilation was successful but the changes in the file are not registered. I am wondering if any one could guide me on this?

Platform Windows 32-bit Opencv 4.2.0

FFMPEG:                      YES (prebuilt binaries)
  avcodec:                   YES (58.54.100)
  avformat:                  YES (58.29.100)
  avutil:                    YES (56.31.100)
  swscale:                   YES (5.5.100)
  avresample:                YES (4.0.0)

Here is the change that I wish to add:

if LIBAVUTIL_BUILD > CALC_FFMPEG_VERSION(51,11,0)

/* Some settings for libx264 encoding, restore dummy values for gop_size
 and qmin since they will be set to reasonable defaults by the libx264
 preset system. Also, use a crf encode with the default quality rating,
 this seems easier than finding an appropriate default bitrate. */
if (c->codec_id == AV_CODEC_ID_H264) {
  c->gop_size = -1;
  c->qmin = -1;

  c->bit_rate = 500;
  if (c->priv_data)
  {
    av_opt_set(c->priv_data,"crf","0", 0);
    av_opt_set(c->priv_data,"preset","ultrafast", 0);
  }
     // av_opt_set(c->priv_data,"crf","23", 0);
}

endif