ffmpeg-build-script icon indicating copy to clipboard operation
ffmpeg-build-script copied to clipboard

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

Open amit2maha1 opened this issue 2 years ago • 9 comments

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

amit2maha1 avatar Aug 24 '21 06:08 amit2maha1

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.

rokibhasansagar avatar Sep 02 '21 06:09 rokibhasansagar

image Try to change this?

wolf-yuan-6115 avatar Sep 11 '21 13:09 wolf-yuan-6115

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.

Media182 avatar Sep 24 '21 04:09 Media182

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

RealTehreal avatar Jan 04 '22 22:01 RealTehreal

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 avatar Sep 28 '22 21:09 rob-smallshire

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 avatar Sep 29 '22 07:09 rob-smallshire

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
...

rob-smallshire avatar Sep 29 '22 09:09 rob-smallshire

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

SaschaEbelt avatar Sep 29 '22 18:09 SaschaEbelt

@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.

markus-perl avatar Sep 30 '22 09:09 markus-perl