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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 8th December 2015, 17:39   #1  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
10-bit Encoding with DitherTools

I'm trying to do 10-bit encoding with DitherTools as described here.

My script ends with Dither_out() and I run this command

Quote:
Encoder\avs2yuv.exe -raw "Job1_Script.avs" -o - | Encoder\x264-10b.exe --demuxer raw --input-depth 16 --input-res 940x720 --fps 25 --preset veryslow --crf 24 --psy-rd 1:0.05 --output "Job1_Output.264" --frames 13710
x264 throws an error "No input file" and then exits.

Any idea what I'm doing wrong?
MysteryX is offline   Reply With Quote
Old 8th December 2015, 17:56   #2  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
You forgot the "-" (stdin input) in the x264 command.
sneaker_ger is offline   Reply With Quote
Old 8th December 2015, 19:31   #3  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
... yeah that works
MysteryX is offline   Reply With Quote
Old 8th December 2015, 22:42   #4  |  Link
AzraelNewtype
Registered User
 
AzraelNewtype's Avatar
 
Join Date: Oct 2007
Posts: 135
Incidentally, if you're using the latest avs2yuv, you can just be doing:

Code:
Encoder\avs2yuv.exe -depth 16 "Job1_Script.avs" - | Encoder\x264-10b.exe --demuxer y4m --preset veryslow --crf 24 --psy-rd 1:0.05 --output "Job1_Output.264" --frames 13710 -
It's nice if you're using non-standard resolutions and don't want to remember exactly what you have.
AzraelNewtype is offline   Reply With Quote
Old 8th December 2015, 23:11   #5  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Quote:
Originally Posted by AzraelNewtype View Post
Incidentally, if you're using the latest avs2yuv
Perhaps the DitherTools documentation could be updated to reflect this? This would have saved me some time; and saved the forum from this thread
MysteryX is offline   Reply With Quote
Old 9th December 2015, 00:04   #6  |  Link
AzraelNewtype
Registered User
 
AzraelNewtype's Avatar
 
Join Date: Oct 2007
Posts: 135
Quote:
Originally Posted by MysteryX View Post
Perhaps the DitherTools documentation could be updated to reflect this? This would have saved me some time; and saved the forum from this thread
Well, no, because you'd still have forgotten the - on x264 side, and that's never going to stop being necessary. The depth hack isn't magic, it just lets y4m headers handle some of the grunt work of connecting.
AzraelNewtype is offline   Reply With Quote
Old 9th December 2015, 00:08   #7  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
The code to pipe through x264 as y4m was already written; I wouldn't have had to retouch that code and develop a bunch of other "stuff" around it to get the right values through.
MysteryX is offline   Reply With Quote
Old 9th December 2015, 01:50   #8  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
I downloaded v0.24bm3 here
http://avisynth.nl/index.php/Avs2YUV

First time I tried it, the script froze during initialization.

The second time it started encoding and then froze at 4.2%.

No error message or anything, just froze. It's not using the CPU anymore. This isn't working.

I'll go back to the RAW method unless there is a solution to this.

Edit: It appears v0.24bm3 is broken as the RAW method isn't working either. If I revert back to the version of avs2yuv I had before, it's working in RAW format. I don't know which version I have but the file is 20,480 bytes (while the latest version is 39kb)

Last edited by MysteryX; 9th December 2015 at 01:57.
MysteryX is offline   Reply With Quote
Old 9th December 2015, 04:30   #9  |  Link
Sparktank
47.952fps@71.928Hz
 
Sparktank's Avatar
 
Join Date: Mar 2011
Posts: 940
I use this from taro_06:
http://tmod.nmm-hd.org/avs4x26x/

Code:
"avs4x26x.exe" --x26x-binary "x264_kMod\k8_64.exe" --demuxer raw --input-depth 16 --input-res 1920x1080 --othersettings -o "output.mkv" "script.avs"
He renamed it because it now supports piping AVS to: x262, x264, x265. Should support all various builds (vanilla, tmod, kmod, etc).
__________________
Win10 (x64) build 19041
NVIDIA GeForce GTX 1060 3GB (GP106) 3071MB/GDDR5 | (r435_95-4)
NTSC | DVD: R1 | BD: A
AMD Ryzen 5 2600 @3.4GHz (6c/12th, I'm on AVX2 now!)
Sparktank is offline   Reply With Quote
Old 9th December 2015, 05:46   #10  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
And his build doesn't require the use of command pipe.

By the way, I encoded this video with a 10-bit encoding chain
10-bit encoding (90.9 MB)
8-bit encoding (92.2 MB)

I ended my script like this to provide 10-bit output
Code:
Double="""edi_rpow2(2, nns=4, cshift="BicubicResize", a1=-.6, a2=0, lsb=true, fwidth=960, fheight=720, Threads=2)"""
SuperRes(2, 0.43, 0, Double, lsb_upscale=true, lsb_out=true)
Dither_out()
Now here's what's interesting. The two videos have the same dimensions (940x720), but they are stretched differently vertically, in favor of the 10-bit version. The 8-bit video is losing a few lines at the bottom and the video is stretched (distorted) vertically! Any idea why this is happening?
MysteryX is offline   Reply With Quote
Old 9th December 2015, 06:34   #11  |  Link
Sparktank
47.952fps@71.928Hz
 
Sparktank's Avatar
 
Join Date: Mar 2011
Posts: 940
Are all of what you're using updated?

Don't know what your command looks like piping to what.
__________________
Win10 (x64) build 19041
NVIDIA GeForce GTX 1060 3GB (GP106) 3071MB/GDDR5 | (r435_95-4)
NTSC | DVD: R1 | BD: A
AMD Ryzen 5 2600 @3.4GHz (6c/12th, I'm on AVX2 now!)
Sparktank is offline   Reply With Quote
Old 9th December 2015, 14:39   #12  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
My command pipe is written in the first post. To execute that from a program, I have to run "cmd /c" followed by the rest of the command
MysteryX is offline   Reply With Quote
Old 9th December 2015, 17:00   #13  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by MysteryX View Post
To execute that from a program, I have to run "cmd /c" followed by the rest of the command
Why don't you use CreateProcess()? It provides much better control of the child process.
Maybe I'm missing something here?

Last edited by Groucho2004; 9th December 2015 at 17:12.
Groucho2004 is offline   Reply With Quote
Old 10th December 2015, 03:47   #14  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Quote:
Originally Posted by Groucho2004 View Post
Why don't you use CreateProcess()? It provides much better control of the child process.
Maybe I'm missing something here?
Piping with '|' is a feature of the command shell. If I want to execute a process directly, I would have to somehow implement that feature myself (complicated). The simplest workaround is to start the process "cmd" which has that feature instead of starting the "avs2yuv" process directly.

With that being said... does avs4x26x support FFMPEG?

And I was also using avs2yuv to execute scripts that write values into a text file; can I use avs4x26x for that?
MysteryX is offline   Reply With Quote
Old 10th December 2015, 03:51   #15  |  Link
Sparktank
47.952fps@71.928Hz
 
Sparktank's Avatar
 
Join Date: Mar 2011
Posts: 940
Quote:
Originally Posted by MysteryX View Post
does avs4x26x support FFMPEG?
No, just the x26x encoders.
__________________
Win10 (x64) build 19041
NVIDIA GeForce GTX 1060 3GB (GP106) 3071MB/GDDR5 | (r435_95-4)
NTSC | DVD: R1 | BD: A
AMD Ryzen 5 2600 @3.4GHz (6c/12th, I'm on AVX2 now!)
Sparktank is offline   Reply With Quote
Old 10th December 2015, 03:54   #16  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Yeah... I'll have to stick to avs2yuv then. I use ffmpeg for 8-bit encoding and a separate x264.exe for 10-bit encoding. Plus I use it to run quick scripts.

Any idea why the latest version of avs2yuv is freezing?

Or I'll stick to 'raw' mode; that works.
MysteryX is offline   Reply With Quote
Old 10th December 2015, 06:56   #17  |  Link
MasterNobody
Registered User
 
Join Date: Jul 2007
Posts: 552
Quote:
Originally Posted by MysteryX View Post
Yeah... I'll have to stick to avs2yuv then. I use ffmpeg for 8-bit encoding and a separate x264.exe for 10-bit encoding. Plus I use it to run quick scripts.

Any idea why the latest version of avs2yuv is freezing?

Or I'll stick to 'raw' mode; that works.
I would guess your freezing problem is due your AviSynth version and not due avs2yuv itself. What AviSynth version do you use? Probably some of the non-official versions with MT support that is cause of the most problems a specially when using with plugins developed without thread safety in mind (which is ok for ST official builds but not for MT builds). Try one of official builds to check if it freeze also. Also you can try to set add SetMTMode(0,0) at start of the script to disable multithreading in MT-build. As for why your avs2yuv do not freeze is probably because it is so old that it doesn't add Distributor() for MT automatically and so you still use it as single-threaded.

Last edited by MasterNobody; 10th December 2015 at 07:06.
MasterNobody is offline   Reply With Quote
Old 10th December 2015, 17:09   #18  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
I use AviSynth 2.6 MT.

I was recommended specifically *NOT* to add "Distributor" at the end of the script as it just creates additional threads on top of the multi-threading already taking place.
MysteryX is offline   Reply With Quote
Old 10th December 2015, 17:46   #19  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by MysteryX View Post
I was recommended specifically *NOT* to add "Distributor" at the end of the script as it just creates additional threads on top of the multi-threading already taking place.
Using named pipes presents a different scenario. When you transfer frames from Avisynth to x264 via stdout, the tool piping the frames and the encoder have to call "Distributor()".
Groucho2004 is offline   Reply With Quote
Old 10th December 2015, 18:33   #20  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Quote:
Originally Posted by Groucho2004 View Post
Using named pipes presents a different scenario. When you transfer frames from Avisynth to x264 via stdout, the tool piping the frames and the encoder have to call "Distributor()".
Why?

In any case, the old version of avs2yuv works with AviSynth 2.6 MT and it is multi-threaded otherwise performance would be much lower on my 8-core system.
MysteryX is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 21:38.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.