Skip to content
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

statically built ffmpeg shows ver v1.28 even though it was built from 4.4 #104

Open
amit2maha1 opened this issue Aug 24, 2021 · 9 comments

Comments

@amit2maha1
Copy link

amit2maha1 commented Aug 24, 2021

image

Because of this ffprobe is also old.

I know the question is vague but can you choose the version you build statically?

the build command used was:
./build-ffmpeg --build --enable-gpl-and-non-free --full-static
thanks

@rokibhasansagar
Copy link
Contributor

The build script has been fetching the Latest snapshot of ffmpeg. I've never seen this type of result before, neither in this repository's Actions Tabs nor in my personal scratch script.
There may be some environment variable interfering with your build system. It's the only thing I can explain.

@wolf-yuan-6115
Copy link

image
Try to change this?

@Media182
Copy link

Same problem with 1.31. I've even replaced 1.31 with 4.4 in "SCRIPT_VERSION=1.31" inside build-ffmpeg script, but final ffmpeg binary still 1.31 instead of 4.4. Weird this that there's no 1.31 text anywhere else in distributive.

@RealTehreal
Copy link

Same for me. Mine got version number 1.33, the current script version.

@rob-smallshire
Copy link

Same here I have ffmpeg-build-script version 1.4 and the built ffmpeg is reporting,

ffmpeg version v1.40 Copyright (c) 2000-2022 the FFmpeg developers

when it should be 5.1 which the version of ffmpeg being downloaded and built.

@rob-smallshire
Copy link

rob-smallshire commented Sep 29, 2022

If I modify the build-ffmpeg script to rename the SCRIPT_VERSION variable to BUILD_SCRIPT_VERSION, then instead of the built ffmpeg reporting the version of build-ffmpeg (e.g. 1.40), it now reports a version containing a hash:

ffmpeg version fb979f1 Copyright (c) 2000-2022 the FFmpeg developers

This is the hash of the most recent commit in my fork of the ffmpeg-build-script repo, so something in the ffmpeg build is being (too) clever about determining the version number.

@rob-smallshire
Copy link

rob-smallshire commented Sep 29, 2022

After further investigation I can report that the problem with the reported version number occurs because of the way the ffmpeg build determines the version number to incorporate into the built artifact. In the ffmpeg source, version determination is performed by a shell script ffbuild/version.sh which looks for the presence of various files, and also determines whether the source is being built inside a cloned git repository.

If this repository (ffmpeg-build-script) is cloned, and the build performed within that clone, the ffmpeg build mistakenly picks up version information from the ffmpeg-build-script Git repository, rather than from the ffmpeg Git repository as it was designed to do.

The solution then, is to not execute build-ffmpeg from within a clone of the ffmpeg-build-script repository, but instead from a non-git repo directory. One way to do this is to stop the clone being a clone by deleting the .git directory after cloning:

$ git clone https://github.com/markus-perl/ffmpeg-build-script.git
$ cd ffmpeg-build-script
$ rm -rf .git/
$ ./build-ffmpeg --build --enable-gpl-and-non-free

After the build is complete, invocations of ffmpeg -version should now report the correct release version number:

$ ./workspace/bin/ffmpeg -version
ffmpeg version 5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
...
@SaschaEbelt
Copy link

Thanks for investigating this issue.
I'd like to recommend renaming the .git folder instead of deleting it. This way, it would be easier to update the cloned repo in the future by renaming the folder back again instead of repeatedly cloning:

$ git clone https://github.com/markus-perl/ffmpeg-build-script.git
$ cd ffmpeg-build-script
$ mv .git .git.bak
$ ./build-ffmpeg --build --build --enable-gpl-and-non-free

Rename back to update the repo

$ mv .git.bak .git
$ git pull
@markus-perl
Copy link
Owner

@rob-smallshire Thank you for investigating this issue. Depending on your use the easiest workaround is clearly to rename/delete the .git folder. In a future version of the build script we may can patch the version.sh file to just ignore the .git folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
8 participants