More storage for media : organize files using ChatGPT : part4, processing on Gentoo

Main article

Introduction

Let’s get the maximum performance and install ImageMagick and ffmpeg on Gentoo.
I will use WSL for demo, hence some functionalities will be limited.

Setup Gentoo

Let’s get the latest stage3 tarball from …


This content originally appeared on DEV Community and was authored by hexfloor

Main article

Introduction

Let's get the maximum performance and install ImageMagick and ffmpeg on Gentoo.
I will use WSL for demo, hence some functionalities will be limited.

Setup Gentoo

Let's get the latest stage3 tarball from the Gentoo Downloads
powershell:

Invoke-WebRequest -Uri "https://distfiles.gentoo.org/releases/amd64/autobuilds/20241027T164832Z/stage3-amd64-openrc-20241027T164832Z.tar.xz" -OutFile "$env:USERPROFILE\Downloads\stage3-amd64-openrc-20241027T164832Z.tar.xz"

mkdir "$env:LOCALAPPDATA\WSL\Gentoo" -Force

wsl --import Gentoo "$env:LOCALAPPDATA\WSL\Gentoo" "$env:USERPROFILE\Downloads\stage3-amd64-openrc-20241027T164832Z.tar.xz"

Let's enter Gentoo:

wsl -d Gentoo

Follow the Gentoo in WSL to setup a user! I will skip this part and will continue with root (not secure).

Hi ChatGPT, could you please suggest the compiler flags and USE flags for Gentoo to have the maximum performance, my use case is ffmpeg with HEVC and ImageMagick with HEIC. Short answer, thank you !

Image description

Image description

Image description

Now let's set compiler and USE flags, I have entered as root:

cat /etc/portage/make.conf

Image description

A bit of magic:

echo -e "COMMON_FLAGS=\"-O2 -pipe\"\nCFLAGS=\"-march=native \${COMMON_FLAGS}\"\nCXXFLAGS=\"\${CFLAGS}\"\nFCFLAGS=\"\${COMMON_FLAGS}\"\nFFLAGS=\"\${COMMON_FLAGS}\"\nLC_MESSAGES=C.utf8" | tee /etc/portage/make.conf > /dev/null

Setting USE flags:

echo 'USE="ffmpeg hevc imagemagick heic x264 vaapi vdpau opencl threads jpeg png tiff gpl libx264 libx265 libfdk-aac libmp3lame libopus libvpx nonfree"' | tee -a /etc/portage/make.conf > /dev/null

echo "media-gfx/imagemagick heic libheif" | tee /etc/portage/package.use/imagemagick > /dev/null

echo "media-video/ffmpeg gpl libx264 libx265 libfdk-aac libmp3lame libopus libvpx nonfree" | tee /etc/portage/package.use/ffmpeg > /dev/null

Image description

Let's sync and update, at this point you will likely embrace the philosophy of Gentoo:

emerge --sync
emerge --update --deep --newuse @world
emerge --depclean
emerge dev-vcs/git

At this point we have a media server, let's pack it.

ImageMagick on Gentoo

With the USE flags set from the setup:

emerge media-libs/libheif media-libs/libpng gnome-base/librsvg
git clone https://github.com/ImageMagick/ImageMagick.git
cd ImageMagick
./configure --with-heic=yes
make
make install
ldconfig

magick -list format | grep HEIC

Image description

ffmpeg on Gentoo

With the USE flags set from the setup:

emerge media-libs/x264 media-libs/x265 media-libs/fdk-aac media-sound/lame media-libs/opus media-libs/libvpx

git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libvpx --enable-nonfree
make
make install

ffmpeg -codecs | grep hevc

Image description

Final step

It is the time you have wasted for your Gentoo that makes your Gentoo so important.
Let's add new user:

useradd -m -G users -s /bin/bash <username>
passwd <username>

And reboot Gentoo, now you can enter as <username>:

wsl -u <username> -d Gentoo

Summary

If you are afraid to use Gentoo, come back when you are not afraid or use it while being afraid.
Image description

Image description


This content originally appeared on DEV Community and was authored by hexfloor


Print Share Comment Cite Upload Translate Updates
APA

hexfloor | Sciencx (2024-10-31T22:57:56+00:00) More storage for media : organize files using ChatGPT : part4, processing on Gentoo. Retrieved from https://www.scien.cx/2024/10/31/more-storage-for-media-organize-files-using-chatgpt-part4-processing-on-gentoo/

MLA
" » More storage for media : organize files using ChatGPT : part4, processing on Gentoo." hexfloor | Sciencx - Thursday October 31, 2024, https://www.scien.cx/2024/10/31/more-storage-for-media-organize-files-using-chatgpt-part4-processing-on-gentoo/
HARVARD
hexfloor | Sciencx Thursday October 31, 2024 » More storage for media : organize files using ChatGPT : part4, processing on Gentoo., viewed ,<https://www.scien.cx/2024/10/31/more-storage-for-media-organize-files-using-chatgpt-part4-processing-on-gentoo/>
VANCOUVER
hexfloor | Sciencx - » More storage for media : organize files using ChatGPT : part4, processing on Gentoo. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/10/31/more-storage-for-media-organize-files-using-chatgpt-part4-processing-on-gentoo/
CHICAGO
" » More storage for media : organize files using ChatGPT : part4, processing on Gentoo." hexfloor | Sciencx - Accessed . https://www.scien.cx/2024/10/31/more-storage-for-media-organize-files-using-chatgpt-part4-processing-on-gentoo/
IEEE
" » More storage for media : organize files using ChatGPT : part4, processing on Gentoo." hexfloor | Sciencx [Online]. Available: https://www.scien.cx/2024/10/31/more-storage-for-media-organize-files-using-chatgpt-part4-processing-on-gentoo/. [Accessed: ]
rf:citation
» More storage for media : organize files using ChatGPT : part4, processing on Gentoo | hexfloor | Sciencx | https://www.scien.cx/2024/10/31/more-storage-for-media-organize-files-using-chatgpt-part4-processing-on-gentoo/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.