Log in

View Full Version : x262 hangs and produces a 0 KB file if intrinsics are turned on


FranceBB
30th October 2021, 15:22
ffmpeg.exe -i "D:\Temp\AVS Script.avs" -pix_fmt yuv422p -strict -1 -an -f yuv4mpegpipe - |x262_64.exe --stdin y4m - --mpeg2 --preset medium --level high --profile 422 --bitrate 50000 --vbv-maxrate 50000 --vbv-bufsize 17825792 --keyint 12 --bframes 2 --no-scenecut --open-gop --deblock -1:-1 --overscan show --colormatrix bt709 --range tv --transfer bt709 --colorprim bt709 --videoformat component --nal-hrd cbr --output-csp i422 --output "\\mibctvan000\Ingest\MEDIA\temp\raw_video.m2v"

this makes it hang and eventually crash the pipe, while this:

x262_64.exe "D:\Temp\AVS Script.avs" --mpeg2 --preset medium --level high --profile 422 --bitrate 50000 --vbv-maxrate 50000 --vbv-bufsize 17825792 --keyint 12 --bframes 2 --no-scenecut --open-gop --deblock -1:-1 --overscan show --colormatrix bt709 --range tv --transfer bt709 --colorprim bt709 --videoformat component --nal-hrd cbr --output-csp i422 --output "\\mibctvan000\Ingest\MEDIA\temp\raw_video.m2v"


hangs forever.

This is the Avisynth Script:


FFVideoSource("D:\Masterfiles\Mortal Kombat DNxHR HQX UHD BT2020 HDR HLG YUV422 25p 12bit.mxf")

ConvertYUVtoXYZ(Color=0, HDRmode=2)
ConvertXYZ_Reinhard_HDRtoSDR(exposure_X=2.1)

ConvertXYZtoYUV(pColor=0)

Spline64ResizeMT(1920, 1080)

ConvertBits(bits=8, dither=1)

Converttoyv16(matrix="Rec709", interlaced=false, chromaresample="Spline64")



The Avisynth Script doesn't matter, though.

This makes it hang just as fine:


ColorBars(1920, 1080, pixel_type="YV12")
Converttoyv16()
ChangeFPS(25)


it just hangs 'till eventually it stops and the output is 0 KB:

https://i.imgur.com/aKHoQHI.png

Surprisingly, this makes it produce 1 frame:


ColorBars(848, 480, pixel_type="YV12")
Converttoyv16()
ChangeFPS(25)


https://i.imgur.com/Y2MHCRd.png



EDIT: Found the bug

It's the assembly part that is written incorrectly.
Disabling intrinsics make it work.

In other words, adding --asm 1 makes it work correctly:


x262_64.exe "D:\Temp\AVS Script.avs" --mpeg2 --preset medium --level high --profile 422 --bitrate 50000 --vbv-maxrate 50000 --vbv-bufsize 17825792 --keyint 12 --bframes 2 --no-scenecut --open-gop --deblock -1:-1 --overscan show --colormatrix bt709 --range tv --transfer bt709 --colorprim bt709 --videoformat component --nal-hrd cbr --output-csp i422 --asm 1 --output "\\mibctvan000\Ingest\MEDIA\temp\raw_video.m2v"


https://i.imgur.com/F00eznf.png

still going fine:

https://i.imgur.com/otNmNrs.png

FranceBB
30th October 2021, 17:28
I opened a bug in the bug tracker: https://github.com/kierank/x262/issues/13

Blue_MiSfit
2nd November 2021, 23:24
I think I ran into this issue as well :)

Regarding your AviSynth script, wouldn't it be better to go to 4:2:2 first, then dither down to 8 bit?

FranceBB
3rd November 2021, 09:00
I think I ran into this issue as well :)


Ah, I see.

Regarding your AviSynth script, wouldn't it be better to go to 4:2:2 first, then dither down to 8 bit?[/QUOTE]

Yep, I can change that, no biggie.