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

It/no http #2051

Merged
merged 4 commits into from
Dec 8, 2021
Merged

It/no http #2051

merged 4 commits into from
Dec 8, 2021

Conversation

darkdarkdragon
Copy link
Contributor

What does this pull request do? Explain your changes. (required)
Removes HTTP and HTTPS protocols from FFmpeg build.

Specific updates (required)

How did you test each of these updates (required)

Does this pull request close any open issues?
Fixes #2040

Checklist:

prepare_mingw64.sh Outdated Show resolved Hide resolved
Copy link
Member

@iameli iameli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No opinion on the Go changes, one comment on the build

done
# And one more dynamic library to remove, this one in the system itself...
rm -rfv /mingw64/x86_64-w64-mingw32/lib/libwinpthread.dll.a
echo "removing all dlls"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. I guess I just assumed that something would break when you did this, but I guess .dll.a files are only needed for making new dynamic binaries, which we're not doing? Cool.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it 😄 Without that it was linking some dynamic libs, and it was not clear where it finds those .dll.a so I've just removed everything. And it works 😃

@@ -37,8 +44,7 @@ if [ $(uname) != "Darwin" ]; then
fi
fi

# Static linking of gnutls on Linux/Mac
if [[ $(uname) != *"MSYS"* ]]; then
if [[ $(uname) != *"MSYS"* ]] && [[ ! $IS_M1 ]]; then
if [ ! -e "$ROOT/nasm-2.14.02" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So how do we handle NASM on the M1? Homebrew? Is it only a build-time dependency?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it only a build-time dependency?

If I understand it correctly, nasm only needed to build x264. And newest x264 builds correctly on M1 without nasm installed (I suspect it uses MacOs native assembler - at least configure of x264 showed that it found assembler).

Copy link
Member

@victorges victorges left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No opinion about the go changes either as I don't think I have context on the code. Wasn't able to tell if it was just a refactor or a functional change, or if it is related to the HTTP(S) removal from ffmpeg.

The ffmpeg part LGTM with a small suggestion

install_ffmpeg.sh Outdated Show resolved Hide resolved
Copy link
Contributor

@leszko leszko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Added some minor comments, other than that, it looks good.

@@ -13,7 +13,7 @@ RUN apt-get update \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv 15CF4D18AF4F7421 \
&& add-apt-repository "deb [arch=amd64] http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main" \
&& apt-get update \
&& apt-get -y install clang-8 clang-tools-8 build-essential pkg-config autoconf gnutls-dev sudo git python docker-ce-cli
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you need to also update the official Livepeer doc that gnutls is not needed anymore?

https://livepeer.org/docs/installation/install-livepeer


md, err := coreSegMetadata(notify.SegData)
if err != nil {
glog.Error("Unable to parse segData err=", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you changed some error handling. E.g. here, before the md struct was sent to n.Transcoder.Transcode(md) and now, in case of this error, we don't even call n.Transcoder.Transcode(md). I guess the change is good. Just wanted to point it out.

server/ot_rpc.go Outdated
}
// Create input file from segment. Removed after transcoding done
fname = path.Join(n.WorkDir, common.RandName()+".tempfile")
if err = ioutil.WriteFile(fname, data, 0644); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't 0600 be enough, do we need other users to access this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed


DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

export MINGW_INSTALLS=mingw64
pacman -S --noconfirm --noprogressbar --ask=20 --needed mingw-w64-x86_64-binutils mingw-w64-x86_64-gcc mingw-w64-x86_64-pkg-config mingw-w64-x86_64-go mingw-w64-x86_64-nasm mingw-w64-x86_64-clang git make autoconf automake patch libtool texinfo gtk-doc zip
pacman -S --noconfirm --noprogressbar --ask=20 --needed mingw-w64-x86_64-binutils mingw-w64-x86_64-gcc mingw-w64-x86_64-pkg-config mingw-w64-x86_64-go mingw-w64-x86_64-nasm mingw-w64-x86_64-clang git make autoconf automake patch libtool texinfo gtk-doc zip zlib
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need zlib now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't remember 😄 Removed.

@iameli
Copy link
Member

iameli commented Dec 8, 2021

Tested on Windows 10 with split O/T and NVENC enabled, looking good! No zlib required apparently.

image

in Go code instead of providing direct http url to lpms.
Remove http and https protocols from FFmpeg configuration in install_ffmpeg.sh
Use newer x264 lib on Apple Silicon
@darkdarkdragon darkdarkdragon merged commit 9b40b94 into master Dec 8, 2021
@darkdarkdragon darkdarkdragon deleted the it/no-http branch December 8, 2021 22:38
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

Successfully merging this pull request may close these issues.

remove http and https protocols from compiled ffmpeg
4 participants