Update FFCodec structure for ffmpeg 7.1+#283
Open
cincodenada wants to merge 3 commits into
Open
Conversation
A field was removed above the union, which broke things quite a bit. There wasn't an internal version change for this, so there are a handful of commits that this will still break against, but it should be fine against all release versions. Specifically, the internal version was bumped to 13 in this ffmpeg commit: 3305767560 commit 2024-04-03 - avcodec: add avcodec_get_supported_config() And init_static_data was actually removed here: 4524d527bf avcodec/codec_internal: nuke init_static_data()
It was throwing errors, and it doesn't seem like we need it
Author
|
Thanks for all your work on this project, by the way - this version was much easier to build than the original, and I could have saved myself that by just reading the README closer and trying building against 3.3.9 :) The build targets for various versions also made tracking down the problem MUCH easier, so thank you for that as well! |
Author
|
Also, it might be worth checking with recent issue-openers to see what version of FFmpeg they were building against - in my case, when it was broken, it still recovered the first few seconds of video, but no more than that, which fits what e.g. #282 is describing. |
This was referenced May 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Short version
It looks like a field was removed above the union in FFCodec, which seems to have broken things quite a bit.
There wasn't an internal version change for this, so there are a handful of commits that this will still break against, but it should be fine against all release versions.
Specifically, the internal version was bumped to 13 in this ffmpeg commit, and and
init_static_datawas actually removed a few commits later.I've also added targets for 7.x releases to the Makefile, and added
--disable-libdrmto the build flags for versions > 6, because I was getting build errors from the drm bits, and it seemed unlikely that we needed that bit just based on the name (and it still works on my test videos, at least).Background
I tried to build this
untruncagainst my Ubuntu shared libraries, which has ffmpeg 7.1, and it didn't work very well at all - recovered a few seconds of a video, if it worked at all. So I tried building the original version, and it worked fine.After some investigation, I determined that the likely difference was that the original had a baked-in version of ffmpeg. And indeed, building this fork of
untruncwith various ffmpeg versions worked just fine. After some bisecting of releases I determined that the problem was introduced between 7.0 and 7.1, and then further bisecting with the git repo pointed to the above commit (4524d527bf), where a field was removed fromFFCodec.I don't know enough about how all this works to know for sure what effect that had, but I know enough about how C works to suspect that having our copy of the internal headers differ from the actual internal headers is likely to cause all kinds of strange problems. So I made that field conditional on the internal
AVCODEC_VERSION(as closely as I could), and nowuntruncruns with 7.1 just fine - both my shared libraries, and the release version.I don't have a clear enough understanding of everything involved to know if this is the best fix for this or not, but it does seem to fix the issue for me, it's a very simple change, and seems safe as it's quite unlikely to affect building with previous versions of ffmpeg due to the version gating involved.