Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > High Efficiency Video Coding (HEVC)

Reply
 
Thread Tools Search this Thread Display Modes
Old 30th November 2023, 07:18   #1  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,812
x265 only single threaded running in Wine on Linux

I thought I'd ask in case there's a fix for this problem. I'm running Avisynth in Wine (8.12) so I'm also using the Windows version of x265 (64 bit).
The problem is x265's log displays "no thread pools created", or something similar, and only wants to run in single threaded mode. The x264 encoder runs normally.

So I'm wondering if there's a way to fix this, or force x265 to use multiple threads in Wine?

Cheers.

Last edited by hello_hello; 30th November 2023 at 14:35.
hello_hello is offline   Reply With Quote
Old 30th November 2023, 20:15   #2  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,239
Not a fix, but last time I used Avisynth through wine, I could use avs2yuv and pipe to a native encoder like x264, x265,.. so assuming this still works, there should be no need to use x265 through wine.
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 2nd December 2023, 08:27   #3  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,812
Thanks. I'll give it a shot.
hello_hello is offline   Reply With Quote
Old 3rd December 2023, 02:41   #4  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,841
Yeah either avs2yuv or FFMpeg and then it's a pipe to the Linux version of x264 and x265 and you're pretty much good to go.
Avisynth made some progress in the Linux direction, though, so perhaps, in let's say 10 years from now we're gonna have a set of filters working in the native Linux version (Fedora user here).
FranceBB is offline   Reply With Quote
Old 4th December 2023, 16:49   #5  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,812
Would one of you guys be able to provide a sample command line for piping from ffmpeg to the native linux x265? I don't seem to be able to get it to work.

Cheers.
hello_hello is offline   Reply With Quote
Old 7th December 2023, 02:59   #6  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,812
Well I worked out how to do it via the Terminal. For anyone else who might need help getting started and doesn't use the default Wine prefix, this is the command line I'm using for a 1080p encode:

WINEPREFIX="/home/UserName/.local/share/wineprefixes/Win64" wine "C:\\Encoders\\ffmpeg\\ffmpeg.exe" -i "M:\\SSD2\\xxx.avs" -strict -1 -f yuv4mpegpipe - | x265 --profile main10 --crf 20.0 --colorprim bt709 --transfer bt709 --colormatrix bt709 --sar 1:1 --output "/media/SSD2/xxx.hevc" --y4m -

What I'd really like to know if there's a way to pipe from Wine, from within Wine, if that makes sense. As x264 runs fine in Wine, everything works from within Wine and I can use AnotherGUI to create custom command lines and queue a bunch of scripts to encode. I don't know if there's a way to use the native linux version of x265 when encoding scripts that way though.
hello_hello is offline   Reply With Quote
Old 7th December 2023, 15:12   #7  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,239
I doubt that you can start native Linux apps from within an app that is run by wine.
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 7th December 2023, 17:15   #8  |  Link
microchip8
ffx264/ffhevc author
 
microchip8's Avatar
 
Join Date: May 2007
Location: /dev/video0
Posts: 1,840
Might as well go back to Windows...
__________________
ffx264 || ffhevc || ffxvid || microenc
microchip8 is offline   Reply With Quote
Old 10th December 2023, 03:16   #9  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,812
Quote:
Originally Posted by Selur View Post
I doubt that you can start native Linux apps from within an app that is run by wine.
I don't suppose you know if there's a Linux equivalent of AnotherGUI?
I've created AnotherGUI/x264 command line presets so I can open a bunch of Avisynth scripts and leave AnotherGUI to run them. It looks like I need to find a way to do something similar for the native Linux version of x265. I assume it's do-able using a bash script, but I'd have to learn how.
hello_hello is offline   Reply With Quote
Old 9th January 2024, 17:14   #10  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,812
Well for anyone else who might need help doing it, this is my first attempt to get a form of batch encoding to work with Avisynth running in Wine and piping to the Linux x265 encoder. I still know stuff-all about writing bash scripts.
As best as I can tell batch encoding requires a bash script and a .desktop file to run it. The bash script needs to be marked as executable. If it's on the desktop there should be a right click option "Execute" to run the script directly, but running it via the desktop file will open it in a Terminal so you can see what's happening.

My desktop file is simply this. I've named it "x265 Encoding.desktop".
The blue text is the path to the bash script.

Quote:
[Desktop Entry]
Name=x265 Encoding
Type=Application
Terminal=true
Exec="'/home/UserName/Desktop/x265 Encoding.sh'"
My bash script is called "x265 Encoding.sh". It'll encode any files in the specified folder with an avs extension. The output files will have the same names as the Avisynth scripts, but with a hevc extension. If an output file already exists, the encoding of the corresponding script is skipped rather than the output file being over-written. The scripts should be encoded in alphabetical order.

Quote:
#! /bin/bash

while read filename; do
if [ -f "${filename%.avs}.hevc" ]
then
echo -e "\033[1;31mFile Already Exists:\033[1;33m ${filename%.avs}.hevc\033[1;39m"
else
WINEPREFIX="/home/UserName/.local/share/wineprefixes/Win64" wine "C:\\Encoders\\ffmpeg\\ffmpeg.exe" -i "${filename%}" -strict -1 -f yuv4mpegpipe - | x265 --crf 20.0 --profile main10 --preset slow --colorprim bt709 --transfer bt709 --colormatrix bt709 --output "${filename%.avs}.hevc" --y4m -
fi
done < <(find "/media/Drive2/Scripts/" -maxdepth 1 -type f -name '*.avs' | sort -t'/')

read -p "Press any key to exit" -rn1
Blue text: Path to the Wine prefix if it's not in the default location.
Green text: Path to the Windows version of ffmpeg in your Wine prefix.
Brown text: Path to the folder containing the Avisynth scripts.
Red text: "-maxdepth 1" prevents the bash script looking for Avisynth scripts to encode in sub-folders.

If anyone has better ideas for batch encoding Avisynth scripts on Linux, I'm open to suggestions.

Last edited by hello_hello; 10th January 2024 at 13:14.
hello_hello is offline   Reply With Quote
Old 9th January 2024, 17:31   #11  |  Link
StvG
Registered User
 
Join Date: Jul 2018
Posts: 436
Did you try running Avisynth natively (without wine)? If you're on Arch, AUR has a buch of the plugins packages, otherwise you have to compile the plugins yourself. Some more info.
StvG is offline   Reply With Quote
Old 10th January 2024, 11:23   #12  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,812
Quote:
Originally Posted by StvG View Post
Did you try running Avisynth natively (without wine)?
Not yet. Partly because Avisynth runs quite well in Wine, and partly due to the availability of plugins.

Quote:
Originally Posted by StvG View Post
If you're on Arch, AUR has a buch of the plugins packages, otherwise you have to compile the plugins yourself. Some more info.
I'm not on Arch, but I'll check it out.

Cheers.
hello_hello is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 13:28.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.