Implement ffmpeg version 5 support #5
Merged
SlavekB
merged 1 commits from ffmpeg5-support
into master
2 years ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'ffmpeg5-support'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Version 5.0 of ffmpeg drops a load of deprecated API functions causing k9copy to fail its build. The necessary changes have been made to enable k9copy to build against ffmpeg 5.0 as well as retaining support for older versions. Support for older pre-0.5.1 versions has been dropped as has runtime linking of the ffmpeg libraries. libswscale is now mandatory.
Signed-off-by: aneejit1 aneejit1@gmail.com
The following will trigger the running of the ffmpeg code:
The thumbnail that gets added to the "Video files" list does appear to depend upon the file used. It appears to select the first image it can get and if that image is a black screen or incomplete then the results can look a little off.
This needs to be run against an older distribution version. k9copy calls out to drkonqi. I don't seem to be able to build tdelibs on Debian 9 at the moment as "make" just does nothing, so k9copy bombs out because drkonqi isn't there.
In Debian we now build using ninja, if you use the tde-packaging files.
I did try with ninja but it did the same only with the message "No work to do".
in you use the tde-packaging repo files, after you setup your source folder code (repo + packaging file), you can build locally with
debian/rules binary
. This will do all the work for you in a local build. Of course if you want a build in a clean environment you should use pbuilder or similar programs.You can also look at these scripts, they may help you :-)
Yeah, I've found the problem.
Missing "-DBUILD_ALL=ON".
8-)
I've got tdebase/drkonqi sorted but there's a problem in the readFrame method with it failing the "av_read_frame" call, so it ain't quite working on Debian 9.
Implement ffmpeg version 5 supportto WIP: Implement ffmpeg version 5 support 2 years agoc897f17660
to1d8a9637b3
2 years agoOK, that's got it. Problem was to do with the freeing or unrefing of the packet that needed to happen with each pass through the loop before the next av_read_frame. It's now working on my setup and under Debian 9.
WIP: Implement ffmpeg version 5 supportto Implement ffmpeg version 5 support 2 years agoCommit
1d8a9637b3
works for me, amended for 14.0.12.k9copy builds and the thumbnail is displayed for ffmpeg versions 3.1.2, 3.4.11, 4.4.2, and 5.0.1.
Good to see such team cooperation.
I guess at this point we need a test on old distros from @SlavekB :-)
FTBFS during test on old distribution:
Which distro?
The "av_rescale_q" one is interesting...
I've not changed anything around that particular call other than removing the "dlsym" functionality. The function has been in the public API since ~0.5.1, so anything earlier and the built code wouldn't run, anything since should build OK. I've checked to make sure that "mathematics.h" is brought in by "avutil.h" and it's not that as the relelevant "#include" is there back to 0.5.1.
Puzzling.
I use Jessie to test for a very old distribution, although we no longer build packages for this distro 😉
1d8a9637b3
toe71518b16c
2 years agoThat's avutil 54.3.0 which puts it somewhere between 2.3.6 (52.92.100) and 2.4 (54.7.100), so probably a pre-release version.
The problem comes from the fact that "avutil.h" seems to have been modified. The Debian 8 version has
and the 2.3.6/2.4 versions have
Quite why this is, I don't know, but the lack of "mathematics.h" is the cause of the problem.
I've implemented the obvious solution which is to specifically include "libavutil/mathematics.h" in "k9avidecode.h". It's protected against being included multiple times so shouldn't cause any duplication issues.
Please give it another go.
Tested on old distribution and also on testing – both built without problems.
e71518b16c
into master 2 years agoThis is an ffmpeg version issue for me.
All the builds I did were with libavformat >= 57, 33, 100.
If I build with ffmpeg-3.0.9, libavformat == 57, 25, 100, I get the same failure.
With commit
e71518b16c
, the build completes and k9copy runs, but crashes at selecting the .avi.If it's any help, there is one of two konsole messages at the point of crashing:
double free or corruption (!prev)
or
corrupted size vs. prev_size while consolidating
.This is just feedback and not an issue for Slackware builds as ffmpeg was introduced to the distro at release 3.2.3, for which the latest patch works.
means a pointer to an object allocated with
new
is beingdelete
d twice, so it definitely highlights an issue there if we use such version of ffmeg.@Ray-V: do akode and k3b build and works fine with ffmpeg-3.0.9 on your system?
If so, I would suggest we adjust the code of this PR to make k9copy also work fine.
If not, then maybe we don't need any extra work here.
I'll have a dig around and see if I can find anything. I've got an old ffmpeg building so hopefully I can reproduce the problem.
OK, I think I see the problem and it's down to what ffmpeg is doing when it closes the AVFormat_Context as part of closing the input file. I've just got to work out which version it changed in and it should be easy enough to fix.
Got it! Pull request #6 raised to fix the problem.
I'd linked the calling of avcodec_free_context to when it appeared in the API rather than when the "codec" field in AVStream was replaced by "codecpar". As "avformat_close_input" cleans up the AVCodecContext in prior versions, the additional avcodec_free_context call caused the exception.
I've got it wrong in k3b as well, so I'll need to revisit that one shortly. akode needs changing too.
I suggest we wait for @Ray-V to confirm it works fine with ffmpeg-3.0.9 before fixing up k3b and akode. What do you think?
akode - no
k3b - no
@Ray-V how about k9copy #6?
I don't know what case you have, but mine case on Debian 9.x (Stretch) as well as on Debian 10.x (Buster) is:
This occurs independent of the patch in this PR => I tried downgrade to the version R14.0.12 and it crashes the same way.
I've got that too. Looks like a different problem unrelated to the ffmpeg issues. It's going over in "k9copy.cpp" and there's no ffmpeg code in there.
There's a k3b #16 that should sort out the build problem there. I'll hold off on akode for now as that will be the same again.
Reviewers
e71518b16c
.