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);
}
are you sure, you're using your updated opencv_videoio.dll ? did you (re)build the INSTALL project ? look at timestamps
(if you edit some header in the src tree -- it's not the same as in the final install, so you need to retake all those steps as in your original build)
I have rebuild the INSTALL project but it didn't help. I am currently using cmake-gui. o I have to mention CMAKE_INSTALL_PREFIX=/modules/videoio/ into the configuration?
I have also checked the timestamps and they belong to new built.
imho you should leave CMAKE_INSTALL_PREFIX as is (opencv/build/install), you probably have the PATH env already pointing at it (where it will look for dlls)
Yes, I have done that but it didnot help. Do I have to build ffmpeg libraries from Scratch?
Just now, tried compiling with an empty opencv_ffmpeg_impl.hpp but still compiles. is it because of FFMPEG prebuilt binaries?