On macOS and Windows, if I pipe y4m from ffmpeg to x265, x265 runs around 4-5x slower than on Linux on the same system. If I instead use ffmpeg to decode to y4m and then run x265 as two separate steps, it runs at "full speed".
example command:
ffmpeg -loglevel verbose -y -i input.mp4 -r 30/1 -threads 4 -t 20.000000 -pix_fmt yuv420p -f yuv4mpegpipe - 2> "ffmpeg.log" | x265 --input - --y4m --input-depth=8 --keyint=60 --ref=3 --bframes=4 --profile=main --preset faster --crf 26 -o "video.hevc"
Windows and macOS on Intel Core i5:
piped: ~4-5fps (top shows ~130% x265 cpu usage)
Linux VM on same system:
+20fps
Run as separate ffmpeg, then x265 on same macOS:
+20fps (top shows ~+350% x265 cpu usage)
Separate commands:
ffmpeg -loglevel verbose -y -i input.mp4 -r 30/1 -threads 4 -t 20.000000 -pix_fmt yuv420p -f yuv4mpegpipe out.y4m
x265 --input out.y4m --y4m --input-depth=8 --keyint=60 --ref=3 --bframes=4 --profile=main --preset faster --crf 26 -o "video.hevc"
Other examples that run way too slow (4-5fps) :
cat out.y4m | x265 --input - --y4m --input-depth=8 --keyint=60 --ref=3 --bframes=4 --profile=main --preset faster --crf 26 -o "video.mkv"
cat out.yuv | x265 --input - --input-res 1920x1080 --fps 30 --input-depth=8 --keyint=60 --ref=3 --bframes=4 --profile=main --preset faster --crf 26 -o "video.mkv"
Any ideas what I should be doing differently to get the piped version to run at full speed?
EDIT: problem solved - bug in x265, patch found on
this page.