-
-
Notifications
You must be signed in to change notification settings - Fork 55.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix build with FFmpeg master. Some deprecated APIs have been removed. #10011
Conversation
Proposed changes break MacOS builder videoio tests (with most fresh FFMPEG version installed):
|
Tests passing again. |
Are you able to run OpenCV's videoio tests with master branch of FFMPEG? (you need opencv_extra repository and setup |
This patch works with the FFmpeg 3.3 and 3.4 branches, but not with current master (git
The rest of the tests pass. |
Thanks! I have the same observations about current master FFmpeg branch. |
if (oc->oformat->flags & AVFMT_RAWPICTURE) { | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AVFMT_RAWPICTURE
have been deprecated/eliminated completely (there is no replacement for this), so code block under this "if" is not used at all anymore.
Please disable these code block completely:
#if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(57, 0, 0)
if (oc->oformat->flags & AVFMT_RAWPICTURE) {
/* raw video case. The API will change slightly in the near
futur for that */
AVPacket pkt;
av_init_packet(&pkt);
#ifndef PKT_FLAG_KEY
#define PKT_FLAG_KEY AV_PKT_FLAG_KEY
#endif
pkt.flags |= PKT_FLAG_KEY;
pkt.stream_index= video_st->index;
pkt.data= (uint8_t *)picture;
pkt.size= sizeof(AVPicture);
ret = av_write_frame(oc, &pkt);
} else
#endif
{
/* encode the image */
AVPacket pkt;
av_init_packet(&pkt);
...
}
Please apply similar changes for other AVFMT_RAWPICTURE
entries (condition is negative).
#if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(57, 0, 0)
if (!(oc->oformat->flags & AVFMT_RAWPICTURE))
#endif
{
... code ...
}
* Adjust build environment as per https://docs.opencv.org/3.1.0/d5/de5/tutorial_py_setup_in_windows.html and https://wiki.python.org/moin/WindowsCompilers#Which_Microsoft_Visual_C.2B-.2B-_compiler_to_use_with_a_specific_Python_version_.3F * The best practice is to only use requirements.txt for deployments, not for packaging * ignore PyCharm metadata * refactor to be more modular * the warnings are irrelevant in older versions * v110 toolset might introduce dependency on older runtime not likely to be present in newer systems, potentially breaking upgrade * build locally with scikit-build * adjust appveyor config to local build * cleanup * DLL load works without * fail appveyor build immediately when one job fails * * cmd doesn't expand globs * - diplication * - WinXP-related bits * pip erroneously considers cv2/ as installed package when in sourceroot * require CMake output entries to be found * 3.5+ uses different .pyd naming scheme * .pyd is placed differently in Linux * DLL is only in Windows * ignore temporary config files * Yet another .pyd naming convention in Py35 Linux. Screw checking. * Update setup.py file to flag compatibility with Python 2.7-3.4-3.5-3.6 (#57) # Conflicts: # setup.py * Adjust build environment as per https://docs.opencv.org/3.1.0/d5/de5/tutorial_py_setup_in_windows.html and https://wiki.python.org/moin/WindowsCompilers#Which_Microsoft_Visual_C.2B-.2B-_compiler_to_use_with_a_specific_Python_version_.3F * The best practice is to only use requirements.txt for deployments, not for packaging * ignore PyCharm metadata * refactor to be more modular * the warnings are irrelevant in older versions * v110 toolset might introduce dependency on older runtime not likely to be present in newer systems, potentially breaking upgrade * build locally with scikit-build * adjust appveyor config to local build * cleanup * DLL load works without * fail appveyor build immediately when one job fails * * cmd doesn't expand globs * - diplication * - WinXP-related bits * pip erroneously considers cv2/ as installed package when in sourceroot * require CMake output entries to be found * 3.5+ uses different .pyd naming scheme * .pyd is placed differently in Linux * DLL is only in Windows * ignore temporary config files * fail fast on error * * custom build logic should be unneeded now, will uncomment as needed * use the latest upstream multibuild * enable tracing - more suspicious things * save some build time * these somehow cause "Server does not allow request for unadvertised object" for GitHub * Revert "use the latest upstream multibuild" This reverts commit 915ba42. * Yet another .pyd naming convention in Py35 Linux. Screw checking. * Update setup.py file to flag compatibility with Python 2.7-3.4-3.5-3.6 (#57) # Conflicts: # setup.py * add diagnostics * * Use upstream multubuild due to the forked one abusing prebuild as build * save some time * looks like clean_code() isn't required * * Don't make CMake try Ninja first * MacOS LAPACK on Travis is still broken * See build progress as it goes * update submodules on demand * fetch source in time for find_version.py * use custom docker image * use custom multibuild * bump submodule * Linux/OSX are supposed to build with Qt support * * make shallow copies to save on download time * manylinux git is an old version * * clean up redundant syntax * reformat codeas YML multiline with dedent * IPP IW broken in Linux * + ffmpeg patch * additional deps required due to multibuild bug * +cv2.data * Use upstream multibuild with monkey patch * don't do anything if upload not needed * filter out irrelevant debug output * * clean up unused scripts * inline the remaining standalone scripts * https://github.com/matthew-brett/multibuild/issues/106 fixed * * bump OpenCV version to 3.4.0 * * opencv/opencv#10011 is available in 3.4.0 * allow for if the sourcetree is a submodule * * don't reinstall whatever happens to be preinstalled * re-add workaround for travis-ci/travis-ci#9055 * * rearrange custom CMake flags * -DWITH_GTK=OFF proved to be unneeded, gthread is among manylinux requirements * fix linux detection to work in 3.3+, too * fix data path for other OSes * don't do anything unless deployment is requested * use upstream ``devel`` multibuild * restore from backup after rebase * catch fetch error * use `devel` multibuild * comment not using --depth * remove redundant command after merge
@jviney @alalek will this be backported to the 2.4 branch? opencv@2 now fails to build with ffmpeg 4.0.
|
Backport of opencv#10011.
OpenCV currently does not build with FFmpeg master. This is because 2 of their deprecated APIs have been removed.
AVFMT_RAWPICTURE
removedAV_
prefixed avcodec flags have been removed