Log in

View Full Version : 'Twister (1996)' - lots of artifacts, what to do?


protovision
9th May 2016, 22:44
I tried to compress my blu ray of Twister, but ended up with a lot of artifacts, especially when there are flashes of lightning (attached).

Here's the output while doing a test compress of the attached scene, any ideas what param I should change?

(2-pass):

set prefs1="-filter:v crop=1920:800 -f yuv4mpegpipe -pix_fmt yuv420p10le -strict -1 -loglevel error"

set prefs2="--preset slower --tune grain --profile main10 --output-depth 10 --bitrate 1800 --colormatrix bt709 --colorprim bt709 --transfer bt709"


ffmpeg.exe -t 15 -ss 00:01:50 -i orig.mkv %prefs1:"=% - | x265.exe %prefs2:"=% --pass 1 --stats r:\newstats.stats --y4m --output "r:\sample1.h265" -

ffmpeg.exe -t 15 -ss 00:01:50 -i orig.mkv %prefs1:"=% - | x265.exe %prefs2:"=% --pass 2 --stats r:\newstats.stats --y4m --output "r:\sample1.h265" -


y4m [info]: 1920x800 fps 24000/1001 i420p10 sar 1:1 unknown frame count
x265 [info]: HEVC encoder version 1.9+150-00ea3784bd36
x265 [info]: build info [Windows][GCC 4.8.2][64 bit] 10bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
x265 [warning]: Rc Grain removes qp fluctuations caused by aq/cutree, Disabling aq,cu-tree

x265 [info]: Main 10 profile, Level-4 (Main tier)
x265 [info]: Thread pool created using 8 threads
x265 [info]: frame threads / pool features : 3 / wpp(13 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 2 inter / 2 intra
x265 [info]: ME / range / subpel / merge : dia / 57 / 2 / 1
x265 [info]: Keyframe min / max / scenecut : 23 / 250 / 40
x265 [info]: Lookahead / bframes / badapt : 30 / 8 / 2
x265 [info]: b-pyramid / weightp / weightb : 1 / 1 / 1
x265 [info]: References / ref-limit cu / depth : 1 / on / off
x265 [info]: Rate Control / qCompress : ABR-1800 kbps / 0.60
x265 [info]: tools: limit-modes rd=2 psy-rd=2.00 rdoq=2 psy-rdoq=1.00
x265 [info]: tools: early-skip signhide tmvp b-intra fast-intra
x265 [info]: tools: strong-intra-smoothing lslices=4 deblock sao stats-write
x265 [info]: frame I: 7, Avg QP:26.57 kb/s: 3620.24
x265 [info]: frame P: 77, Avg QP:26.79 kb/s: 3032.93
x265 [info]: frame B: 277, Avg QP:26.73 kb/s: 1220.70
x265 [info]: Weighted P-Frames: Y:15.6% UV:11.7%
x265 [info]: Weighted B-Frames: Y:14.4% UV:11.2%
x265 [info]: consecutive B-frames: 22.6% 7.1% 10.7% 13.1% 7.1% 20.2% 6.0% 8.3% 4.8%

encoded 361 frames in 65.72s (5.49 fps), 1653.77 kb/s, Avg QP:26.74
y4m [info]: 1920x800 fps 24000/1001 i420p10 sar 1:1 unknown frame count
x265 [info]: HEVC encoder version 1.9+150-00ea3784bd36
x265 [info]: build info [Windows][GCC 4.8.2][64 bit] 10bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
x265 [warning]: Rc Grain removes qp fluctuations caused by aq/cutree, Disabling aq,cu-tree

x265 [info]: Main 10 profile, Level-4 (Main tier)
x265 [info]: Thread pool created using 8 threads
x265 [info]: frame threads / pool features : 3 / wpp(13 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 2 inter / 2 intra
x265 [info]: ME / range / subpel / merge : star / 57 / 3 / 3
x265 [info]: Keyframe min / max / scenecut : 23 / 250 / 40
x265 [info]: Lookahead / bframes / badapt : 30 / 8 / 2
x265 [info]: b-pyramid / weightp / weightb : 1 / 1 / 1
x265 [info]: References / ref-limit cu / depth : 4 / on / off
x265 [info]: Rate Control / qCompress : ABR-1800 kbps / 0.60
x265 [info]: tools: rect amp limit-modes rd=6 psy-rd=2.00 rdoq=2 psy-rdoq=1.00
x265 [info]: tools: signhide tmvp b-intra strong-intra-smoothing lslices=4
x265 [info]: tools: deblock sao stats-read
x265 [info]: frame I: 7, Avg QP:24.00 kb/s: 4719.52
x265 [info]: frame P: 77, Avg QP:26.06 kb/s: 2852.03
x265 [info]: frame B: 277, Avg QP:25.85 kb/s: 1394.18
x265 [info]: Weighted P-Frames: Y:16.9% UV:13.0%
x265 [info]: Weighted B-Frames: Y:14.8% UV:11.2%
x265 [info]: consecutive B-frames: 22.6% 7.1% 10.7% 13.1% 7.1% 20.2% 6.0% 8.3% 4.8%

encoded 361 frames in 357.72s (1.01 fps), 1769.62 kb/s, Avg QP:25.86
Press any key to continue . . .

sneaker_ger
9th May 2016, 22:48
Is the video VC-1? Try to use a different decoder than the software VC-1 decoder in ffmpeg.

I'm not sure if it will work, it's system dependent:
ffmpeg.exe -t 15 -ss 00:01:50 -hwaccel dxva2 -i orig.mkv %prefs1:"=% - | x265.exe %prefs2:"=% --pass 1 --stats r:\newstats.stats --y4m --output "r:\sample1.h265" -

ffmpeg.exe -t 15 -ss 00:01:50 -hwaccel dxva2 -i orig.mkv %prefs1:"=% - | x265.exe %prefs2:"=% --pass 2 --stats r:\newstats.stats --y4m --output "r:\sample1.h265" -

protovision
9th May 2016, 22:53
thx for the reply, it is vc-1. fwiw, the source file plays back fine in MPC-HC, but I'll try a diff decoder.

edit: hmm, not sure what other windows decoder I can use to pipe into x265?

sneaker_ger
9th May 2016, 22:55
MPC-HC's LAV Video invokes the Microsoft decoder in software decoding by default, not the ffmpeg one. It should show behind "active decoder" in LAV Video. Try my edit in the earlier post.

protovision
9th May 2016, 23:20
hi, no luck with the extra param. I think I need another vc-1 decoder. I also tried avconv for decoding, but it doesn't have a yuv420p10 profile.

Here's the ffmpeg output with the extra param:

No decoder device for codec found
Error creating the DXVA2 decoder
dxva2 hwaccel requested for input stream #0:0, but cannot be initialized.
No decoder device for codec found
Error creating the DXVA2 decoder
dxva2 hwaccel requested for input stream #0:0, but cannot be initialized.
[vc1 @ 00000000005d8840] decoding to AV_PIX_FMT_NONE is not supported.
Error while opening decoder for input stream #0:0 : Error number -1 occurred
x265 [error]: unable to open input file <->
No decoder device for codec found
Error creating the DXVA2 decoder
dxva2 hwaccel requested for input stream #0:0, but cannot be initialized.
No decoder device for codec found
Error creating the DXVA2 decoder
dxva2 hwaccel requested for input stream #0:0, but cannot be initialized.
[vc1 @ 0000000000158840] decoding to AV_PIX_FMT_NONE is not supported.
Error while opening decoder for input stream #0:0 : Error number -1 occurred
x265 [error]: unable to open input file <->
Press any key to continue . . .

thx!

sneaker_ger
9th May 2016, 23:25
You don't need to output yuv420p10 (anymore), x265 can increase the bitdepth itself from 8 bit input. But I don't know if this problem is fixed in avconv.

Is AviSynth an option for you? Then you could use dss2() or DirectShowSource() to invoke the Microsoft decoder or LAV for decoding. If you have Nvidia hardware there is also DGDecNV (http://rationalqm.us/dgdecnv/dgdecnv.html) but it is not free.

Motenai Yoda
9th May 2016, 23:29
but why do you pipe to x265 rather than encode directly with ffmpeg?

protovision
9th May 2016, 23:46
but why do you pipe to x265 rather than encode directly with ffmpeg?

I had trouble compiling ffmpeg with the right libraries, and decided it might be easier to leave ffmpeg alone, and just update x265.exe from time to time.