Log in

View Full Version : segfault using x262 with asm


Blue_MiSfit
31st August 2021, 04:31
So I've got some renewed interest in MPEG-2 encoding and I thought I'd give x262 a whirl.

I'm using the latest code from http://git.videolan.org/git/x262.git and building in a simple Dockerfile per below:


FROM buildpack-deps:focal as builder

ARG MAKEFLAGS="-j4"

RUN apt-get update && apt-get install -y --no-install-recommends \
yasm \
&& rm -rf /var/lib/apt/lists/*

RUN git clone http://git.videolan.org/git/x262.git && \
cd x262 && \
./configure --enable static --enable-pic && \
make && \
make install


No matter what I encode, I get a segfault (using simple YUV files for now as input). Any ideas?

Looks like the package manager in buildpack-deps:focal pulls in YASM 1.3.0 and gcc 9.3.0 which seems to work fine for x264 (I use this same base image to build that)

Blue_MiSfit
31st August 2021, 04:38
Example without ASM:


/x262/x262 --demuxer raw --input-csp i420 --input-depth 8 --input-range tv --input-res 1280x720 --fps 60000/1001 30sec.yuv --mpeg2 -o 01.m2v --no-asm
raw [info]: 1280x720p 0:0 @ 60000/1001 fps (cfr)
x262 [info]: using SAR=1/1
x262 [info]: using cpu capabilities: none!
x262 [info]: Main profile @ High-1440 level
x262 [info]: frame I:8 Avg QP:16.39 size: 29854
x262 [info]: frame P:622 Avg QP:20.40 size: 5544
x262 [info]: frame B:1168 Avg QP:21.93 size: 4563
x262 [info]: consecutive B-frames: 0.7% 25.9% 36.7% 36.7%
x262 [info]: mb I I16..4: 100.0% 0.0% 0.0%
x262 [info]: mb P I16..4: 0.0% 0.0% 0.0% P16..4: 70.0% 0.0% 0.0% 0.0% 0.0% skip:30.0%
x262 [info]: mb B I16..4: 0.0% 0.0% 0.0% B16..8: 22.2% 0.0% 0.0% direct: 0.0% skip:77.8% L0:43.0% L1:45.1% BI:11.9%
x262 [info]: coded y,uvDC,uvAC intra: 100.0% 100.0% 100.0% inter: 4.2% 4.1% 3.4%
x262 [info]: kb/s:2404.73


Example with ASM:


x262 --demuxer raw --input-csp i420 --input-depth 8 --input-range tv --input-res 1280x720 --fps 60000/1001 30sec.yuv --mpeg2 -o 02.m2v
raw [info]: 1280x720p 0:0 @ 60000/1001 fps (cfr)
x262 [info]: using SAR=1/1
x262 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
x262 [info]: Main profile @ High-1440 level
Segmentation fault


details:


x262 --version
x264 0.142.2633 bb887aa
built on Aug 31 2021, gcc: 9.3.0
configuration: --bit-depth=8 --chroma-format=all
--enabled-mpeg2
x264 license: GPL version 2 or later


With some additional testing it looks like I can actually go as far as using --asm avx but --asm avx2 breaks things.

Jamaika
31st August 2021, 09:15
untested
https://github.com/pld-linux/x262