Skip to content

Commit

Permalink
Downgrade requirements for an old Ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
sergystepanov committed Dec 4, 2023
1 parent f475dba commit 1993950
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions pkg/encoder/h264/x264.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1993950

Please sign in to comment.