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

ffmpeg -version #199

Closed
237dmitry opened this issue Oct 10, 2022 · 12 comments
Closed

ffmpeg -version #199

237dmitry opened this issue Oct 10, 2022 · 12 comments

Comments

@237dmitry
Copy link

Please add the official base version of ffmpeg (5.1.1, 5.1.2 etc) in order to make it easier to navigate among autobuilds. Or write this in Readme.md

PS > (ffmpeg -version)[0,1]
ffmpeg version N-108577-g6bf99f8c93-20221009 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 12.1.0 (crosstool-NG 1.25.0.55_3defb7b)
@BtbN
Copy link
Owner

BtbN commented Oct 10, 2022

N-108577 is the official version.
If you want something that's based off of a release branch, grab a build of the respective branch.
Currently 5.1 and 4.4 are available.

@237dmitry
Copy link
Author

N-108577 is the official version.

Well, if it is not clear which release the build most corresponds to, I will download it once a month.

@BtbN
Copy link
Owner

BtbN commented Oct 10, 2022

It does not correspond to any release. Not sure what exactly you're asking, but every build builds the latest commit at the time, and that N-XXXXX numbering is how ffmpeg officially versions those.

@237dmitry
Copy link
Author

Not sure what exactly you're asking

I want to update ffmpeg (by script) when the daily build is most consistent with the generally accepted version of the new release. I do not know which is newer than 5.1 or N-XXXXX. For example, on the Arch I can see and it is clear:

PS > (pacman -Qi ffmpeg | sls '(?<=Version.+:)[\d.]+').Matches.Value
5.1.2

PS > [version] '5.1.2'

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      2      -1

@BtbN
Copy link
Owner

BtbN commented Oct 10, 2022

What do you mean, "generally accepted version of the new release"?
The generally accepted version of ffmpeg is the latest version on git master, which is what all builds that don't mention a release branch are.
If you want a consistent link, you can rely on the floating "latest" release tag, that is recreated every day.

@237dmitry
Copy link
Author

What do you mean, "generally accepted version of the new release"?

A version designation that conforms to the norms of the version designation. 5.1.1, 0.3.2-rc, etc. Or at least a reference to the fact that N-12345 corresponds to the new minor release 5.1.3. How else can I find out which N-98765 and on what day should I download it?

@BtbN
Copy link
Owner

BtbN commented Oct 10, 2022

I really don't understand what you are asking.
These builds build the latest commit from git master, every day. It does not correspond to any release. The N-XXXX designation denotes the number of commits since an arbitrary "N" tag from long ago.

@zhongfly
Copy link

zhongfly commented Oct 12, 2022

Maybe he want builds for ffmpeg tags like https://github.com/FFmpeg/FFmpeg/releases/tag/n5.1.2 and ffmpeg -verson can get 5.1.2

@237dmitry
Copy link
Author

237dmitry commented Oct 12, 2022

I'm very sorry, I DIDN'T NOTICE that there are more assets under the spoiler, which indicate a clear version.
Because of this, there was a misunderstanding between us. Thank for your work and your patience!

$assets = (Invoke-WebRequest https://api.github.com/repos/BtbN/FFmpeg-Builds/releases).Content | ConvertFrom-Json
$latest = ($assets.assets | Where-Object { $_.name -match 'ffmpeg-n[\d.]+-latest-win64-gpl-[\d.]+\.zip' })[-1]

$url = $latest.browser_download_url
$file = $latest.name

Invoke-WebRequest $url -OutFile $file

But, in order to compare versions not only major and minor, could you match the name of the zip file and the ffmpeg version:

file:    ffmpeg-n5.1-latest-win64-gpl-5.1.zip
version: ffmpeg version n5.1.2-2-g79bd6a21a0-20221011 Copyright (c) 2000-2022 the FFmpeg developers
file:    ffmpeg-n5.1.2-latest-win64-gpl-5.1.2.zip

@BtbN
Copy link
Owner

BtbN commented Oct 12, 2022

Not quite sure what you mean with spoiler either. There is one floating "latest" release, which exists to have persistent URLs that just always point to the latest build.
And then there's automatically tagged daily releases, with specific versions in the filename, but in turn with rather unstable and daily changing URLs.

I do not build exact release tags, unless they happen to be the HEAD of their respective branch when the build is made.
"n5.1.2-2" means it's 5.1.2 plus two extra commits since the tag was made, specifically the commit 79bd6a21a0.
No point artificially holding back patches and fixes.

Unless you have some obscure reason to need a specific release, just use latest master.
It is exceptionally rare that a day goes by without new commits either, so specifically checking for that isn't really worth it either.

@237dmitry
Copy link
Author

Not quite sure what you mean with spoiler either

Spoiler on release page "Show all 38 assets". I want a clear version display. Nothing more than that. I need this to compare versions when updating if the version has changed. For me, "Build" token is not too important, but it would be nice to have it.

PS > [version] '5.1.1'

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      1      -1

At the moment I'm only comparing Major and Minor tokens of versions:

$assets = (Invoke-WebRequest https://api.github.com/repos/BtbN/FFmpeg-Builds/releases).Content | ConvertFrom-Json
$latest = ($assets.assets | Where-Object { $_.name -match 'ffmpeg-n[\d.]+-latest-win64-gpl-[\d.]+\.zip' })[-1]

$url = $latest.browser_download_url
$file = $latest.name
$file_version = $latest.name -replace '.+-|\.zip'                       # 5.1, It would be better 5.1.2
$ffmpeg_version = (ffmpeg -version)[0] -replace '.+n(\d+\.\d+).+','$1'  # 5.1, '.+n([\d.]+).+', '$1' for 5.1.2

if ([version] $file_version -gt [version] $ffmpeg_version)
{
    Invoke-WebRequest $url -OutFile $file
    # Unpack zip to the ffmpeg location 
}

else { 'ffmpeg is up to date' }

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

No branches or pull requests

4 participants
@BtbN @zhongfly @237dmitry and others