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. |
|
13th February 2018, 02:06 | #1 | Link |
Registered User
Join Date: Sep 2005
Posts: 178
|
Feeding 10 or 16-bit AVS output to x265?
I'm trying to move from x264 to x265, and run into a problem with feeding high depth clips as input. The tail end of my script is this right now:
Code:
f3kdb(input_mode=1, input_depth=16, output_mode=1, output_depth=16, dither_algo=2, grainY=16, grainC=16) ConvertFromStacked(16) Prefetch(2)
Last edited by `Orum; 13th February 2018 at 02:13. |
13th February 2018, 02:23 | #2 | Link |
Registered User
Join Date: Dec 2002
Posts: 5,565
|
You haven't given us enough information.
Post MediaInfo of source, your complete AviSynth script, AviSynth and source filter and avs2yuv version, and avs2yuv + x265 command-line. If you put ConvertBits(8) below ConvertFromStacked() and open it in e.g. VirtualDub does the image look correct? |
13th February 2018, 02:40 | #3 | Link | |
Registered User
Join Date: Sep 2005
Posts: 178
|
Quote:
Code:
Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L4.1 Format settings : CABAC / 4 Ref Frames Format settings, CABAC : Yes Format settings, RefFrames : 4 frames Muxing mode : Container profile=@0.0 Codec ID : V_MPEG4/ISO/AVC Duration : 25 min 41 s Bit rate mode : Variable Bit rate : 21.6 Mb/s Maximum bit rate : 39.0 Mb/s Width : 1 920 pixels Height : 1 080 pixels Display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 23.976 (24000/1001) FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.434 Stream size : 3.87 GiB (98%) Default : No Forced : No Code:
LWLibavVideoSource("01_video.mkv") ColorYUV(levels="TV->PC") AssumeFPS("ntsc_film") Scripted_MDegrain(thSAD=150, tr=2, thSCD1=300, debugSCD=false, lsb=true) f3kdb(input_mode=1, input_depth=16, output_mode=1, output_depth=16, dither_algo=2, grainY=16, grainC=16) ConvertFromStacked(16) Prefetch(2) Not sure on the exact version of LSMASHSource, but does it really matter? avs2yuv version: Avs2YUV 0.24bm5 Edit: Whoops, forgot the command line. It is: Code:
"C:\Program Files\avs2yuv\avs2yuv64.exe" -depth 16 -seek 5000 -frames 1000 "01_vid.avs" -o - | "C:\Program Files\x265\x265-10b8b-PGO.exe" -p veryslow --crf 32 -F 4 -D 10 -I 240 --open-gop -b 10 --aq-mode 3 --aq-strength 0.9 --psy-rdoq 5.0 -o test.hevc --input - --fps 24000/1001 --input-res 1920x1080 Yes, that looks fine in AvsPmod. I can also open the actual 16-bit (without downconverting to 8-bit) output in MPC-HC. The problem appears to be between AviSynth and avs2yuv, or between avs2yuv and x265, or both. Apologies if this isn't the correct forum for the question, but I'm really not sure what the "right" one would be. Last edited by `Orum; 13th February 2018 at 02:47. |
|
13th February 2018, 03:04 | #6 | Link |
Registered User
Join Date: Dec 2002
Posts: 5,565
|
Try:
Code:
"C:\Program Files\avs2yuv\avs2yuv64.exe" -seek 5000 -frames 1000 "01_vid.avs" -o - | "C:\Program Files\x265\x265-10b8b-PGO.exe" -p veryslow --crf 32 -F 4 -D 10 -I 240 --open-gop -b 10 --aq-mode 3 --aq-strength 0.9 --psy-rdoq 5.0 -o test.hevc --input - --y4m |
13th February 2018, 12:18 | #10 | Link |
Registered User
Join Date: Dec 2002
Posts: 5,565
|
I would probably set f3kdb output to 10 bit. In the end it comes down to which dither algo is better suited for the job. (Which I'm not actually sure with 10 bit encoding. With low bitrate 8 bit ordered dither brought best results.)
|
14th February 2018, 22:23 | #11 | Link |
Registered User
Join Date: Apr 2008
Posts: 58
|
Have you tried piping it raw?
Code:
"F:\avs2pipemod\avs2pipemod.exe" -rawvideo %1 | "F:\codecs\video\X265\x265.exe" --input-res 1920x1080 --fps 24000/1001 --input-depth 16 --output-depth 10 --dither - -o "%~dpn1_10bit.mkv" |
15th February 2018, 04:04 | #12 | Link | |
...?
Join Date: Nov 2005
Location: Florida
Posts: 1,420
|
Quote:
And that was the problem here: avs2yuv defaults to piping out y4m, and the OP simply didn't give x265 the --y4m parameter to make it recognize that it was getting y4m. Although I'll reiterate that using an FFmpeg with a multibit-capable libx265 would make this entire issue moot*. No piping, all the video properties preserved, give it a script outputting 10-bit and it'll be encoded as 10-bit without having to tell libx265 otherwise. The same is true if said FFmpeg was also built against a multibit-capable libx264 (which is new on x264's side). *as would x265 builds with the LAVF input patch (see: x265-Yuuki-Asuna, which based on the fact that you're outputting MKV, you're probably already using), if the LAVF it links against had AviSynth support enabled. |
|
15th February 2018, 05:28 | #13 | Link | |
Registered User
Join Date: Apr 2008
Posts: 58
|
Quote:
Never knew about the Yuuki Asuna builds until reading your post so I might give that a try. It would be interesting to see the performance diferences of pipe encoding and this build on my setup. As for the OP, it's good to see that the problem was resolved. I mistakenly skimmed over the post stating all that was required was --y4m before replying to the thread. |
|
15th February 2018, 08:56 | #14 | Link | ||
...?
Join Date: Nov 2005
Location: Florida
Posts: 1,420
|
Quote:
And that build doesn't output MKV, since that's just a normal build from the main project's development tip, and there is no containered output support in the main project's bitbucket repo (Yuuki-Asuna supports both MKV and MP4 output). You're outputting raw .hevc with an incorrect extension. Quote:
|
||
15th February 2018, 11:02 | #15 | Link | |
Registered User
Join Date: Apr 2008
Posts: 58
|
Quote:
For the incorrect extension on the encode, I guess that explains why previewing the output on a media player had broken seeking, ha ha! It never gave me an issue outside of that since the video had to be muxed together with audio post encode. Going to fix the mislabel anyhow for the sake of correctness. |
|
15th February 2018, 12:33 | #16 | Link | |
Registered User
Join Date: Dec 2002
Posts: 5,565
|
Quote:
But as you say with AviSynth+ and y4m it is easier anyways. Except for those of us still using 32 bit AviSynth. x265 only officially supports 8 bit on 32 bit binaries. You need some kind of hacked/patched x265 version if you want 32 bit + 10 bit. Last edited by sneaker_ger; 15th February 2018 at 12:36. |
|
16th February 2018, 08:03 | #17 | Link | |
Registered User
Join Date: Sep 2005
Posts: 178
|
Quote:
Anyway, my understanding of the "multi-bit" builds was that was only for selectable depth output, and hasn't had any effect on what x264 will take in. As long as I've used it, x264 with lavf or y4m support supports all depths that lavf / y4m support for output, and you can even feed it a full 16 bit video if you like. Whether or not this is a good idea depends on other factors, but I usually try to feed it the same depth I'm outputting to (usually 10 bit). Theoretically 16 bit would be better if it had internal support for it, but I'm unsure without looking at the code base. The error that appears when I try to directly encode 10-bit output from avs scripts is vexing though: "avs [error]: not supported pixel type: YUV420P10"? I can only assume this is due to its avs demuxer not handling anything higher than 8 bit, while lavf/y4m handle it just fine. Last edited by `Orum; 16th February 2018 at 08:08. |
|
15th February 2018, 08:05 | #18 | Link | ||
Registered User
Join Date: Sep 2005
Posts: 178
|
Quote:
Quote:
I've thought about ffmpeg, but that has many codecs rolled into one, so I prefer the individual command-line utilities. |
||
16th February 2018, 10:54 | #20 | Link |
Registered User
Join Date: Sep 2010
Location: Ukraine, Bohuslav
Posts: 377
|
10-bit y4m input is actually up-converted to 16-bit internally: http://git.videolan.org/?p=x264.git;...ds/master#l282
On my observations 16->10->16 will produce lesser bitrate (against direct 16 bits) with near the same quality. |
Tags |
avs2yuv, avs2yuv64, x265 |
Thread Tools | Search this Thread |
Display Modes | |
|
|