Downgrade requirements for an old Ubuntu

This commit is contained in:
Sergey Stepanov 2023-12-04 18:20:05 +03:00
parent f475dbabb7
commit 1993950cd7
No known key found for this signature in database
GPG key ID: A56B4929BAA8556B
2 changed files with 10 additions and 3 deletions

View file

@ -58,6 +58,9 @@ a better sense of performance.
, [libopus](http://opus-codec.org/), [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/)
, [sdl2](https://wiki.libsdl.org/Installation)
(If you need to use the app on an older version of Ubuntu that does not have libyuv, you can add a custom apt repository:
`add sudo add-apt-repository ppa:savoury1/graphics`)
```
# Ubuntu / Windows (WSL2)
apt-get install -y make gcc pkg-config libvpx-dev libx264-dev libopus-dev libsdl2-dev libyuv-dev libjpeg-turbo8-dev

View file

@ -33,8 +33,8 @@ type Options struct {
func NewEncoder(w, h int, th int, opts *Options) (encoder *H264, err error) {
libVersion := LibVersion()
if libVersion < 156 {
return nil, fmt.Errorf("x264: the library version should be newer than v155, you have got version %v", libVersion)
if libVersion < 150 {
return nil, fmt.Errorf("x264: the library version should be newer than v150, you have got version %v", libVersion)
}
if opts == nil {
@ -64,7 +64,11 @@ func NewEncoder(w, h int, th int, opts *Options) (encoder *H264, err error) {
ww, hh := int32(w), int32(h)
param.IBitdepth = 8
param.ICsp = CspI420
if libVersion > 155 {
param.ICsp = CspI420
} else {
param.ICsp = 1
}
param.IWidth = ww
param.IHeight = hh
param.ILogLevel = opts.LogLevel