Author Topic: Bleach  (Read 4615 times)

Offline Krudda

  • Member
  • Posts: 10322
  • 私は 日本語 が 上手 じゃ ありません
    • My Anime List
Re: Bleach
« Reply #40 on: October 24, 2014, 12:20:21 am »
I find the tune option 'grain' useful from time to time, but mostly its as revo said - tune options are bad.
Though, 'film' comes in handy for live action stuff.

Offline kuchikirukia

  • Member
  • Posts: 58
Re: Bleach
« Reply #41 on: October 24, 2014, 12:35:15 am »
No tune came out to 277MB
Grain is 230MB.
And Grain has better rain.

Neither are acceptable as they leave in MPEG artifacts around some edges that crawl when the camera pans.
I'm going to do a run at Animation 2:2 crf=14 qcomp=0.8, and if that looks good, I'll keep it.  It's not like what I was trying to fix was all that horrible to start, it's just an area where there was definite room for improvement.  Throwing more bitrate at it to bring out what it can is going to have to be the balance against the filtering this source needs.
« Last Edit: October 24, 2014, 01:30:39 am by kuchikirukia »

Offline revo

  • Member
  • Posts: 814
  • I Can Only Carry 50 Loli's at a Time
Re: Bleach
« Reply #42 on: October 24, 2014, 05:30:00 am »
No tune came out to 277MB
Grain is 230MB.
And Grain has better rain.

Neither are acceptable as they leave in MPEG artifacts around some edges that crawl when the camera pans.
I'm going to do a run at Animation 2:2 crf=14 qcomp=0.8, and if that looks good, I'll keep it.  It's not like what I was trying to fix was all that horrible to start, it's just an area where there was definite room for improvement.  Throwing more bitrate at it to bring out what it can is going to have to be the balance against the filtering this source needs.
with the "do not use tune options" I did not said use default options but do the test encodes and find the best options
test psy-rd ,qcomp,aqmode,aqstrenght ...

Offline Desbreko

  • Member
  • Posts: 614
Re: Bleach
« Reply #43 on: October 24, 2014, 06:05:08 am »
Tune grain is pretty terrible for anime that aren't actually grainy, and even then, there are better settings. Tune film can be suitable for some anime but it's a bit overkill on psy-rd and the lower deblocking for most. Tune animation is only useful if you're doing low-bitrate encodes and don't care about flat areas getting smoothed out.

And you'll get much better results from filtering out artifacts in AviSynth than relying on the compression to smooth them out. Post a short sample if you'd like advice on how to filter it.

Offline revo

  • Member
  • Posts: 814
  • I Can Only Carry 50 Loli's at a Time
Re: Bleach
« Reply #44 on: October 24, 2014, 02:50:41 pm »
Tune grain is pretty terrible for anime that aren't actually grainy, and even then, there are better settings. Tune film can be suitable for some anime but it's a bit overkill on psy-rd and the lower deblocking for most. Tune animation is only useful if you're doing low-bitrate encodes and don't care about flat areas getting smoothed out.

And you'll get much better results from filtering out artifacts in AviSynth than relying on the compression to smooth them out. Post a short sample if you'd like advice on how to filter it.
tune grain is even bad for grain :D

I have done a lot live action movies with high amount of grain and tune grain never worked for me

Offline OnDeed

  • Member
  • Posts: 649
  • Uploader account for [email protected]
Re: Bleach
« Reply #45 on: October 24, 2014, 03:28:19 pm »
My opinion is also that no tune is better. In case somebody cares (yeah, not), I prefer --psy-rd 1.0:0.0 --aq-strength 0.8 --aq-mode 1 personally. In case --mbtree is used, add --qcomp 0.8

Offline revo

  • Member
  • Posts: 814
  • I Can Only Carry 50 Loli's at a Time
Re: Bleach
« Reply #46 on: October 24, 2014, 04:07:45 pm »
My opinion is also that no tune is better. In case somebody cares (yeah, not), I prefer --psy-rd 1.0:0.0 --aq-strength 0.8 --aq-mode 1 personally. In case --mbtree is used, add --qcomp 0.8
for bakuman (clean animation) I am/was using --psy-rd 0.80:0.10 --aq-strength 0.8 --aq-mode 4 , qcomp 0.70 and --no-mbtree

surprisingly psy-rd 0.80:0.x works good with Black and white grainy movies :) but 0.90 is better hehe
« Last Edit: October 24, 2014, 05:23:49 pm by revo »

Offline kuchikirukia

  • Member
  • Posts: 58
Re: Bleach
« Reply #47 on: October 26, 2014, 12:17:42 pm »
Changed the Avisynth script again because TIVTC doesn't play well with multithreading (thankfully my filters have since simplified so Avisynth working on a single core isn't limiting me on Very Slow); also, I was adding aliasing by using LSFMod's resize feature.  I got pulled in by the LSFMod wiki saying, "saves a resizing step," but what it does is poorly resize your newly antialiased scene.
Resize before LSFMod.

Decided to go to qcomp 0.7 as standard.  Rain, I just upped a bunch of things.  I guess we'll see.

E:  Of course, wouldn't you know, the filter settings I've come up with are pretty much universally inferior to what I had 22 days ago:  less cleaning, more halos, loss of fine detail.  Thank God I had the old ones saved, and with what I've learned it took me less than an hour to fix some things that I never noticed originally (lsfmod's default uses postprocessing that was giving some weird bleeding) while sharpening up things better and nicely increasing encoding speed.  (I had been under 5fps back then.  Now passing 8.)

"Please come out like the preview.  Please come out like the preview."
« Last Edit: October 26, 2014, 02:23:44 pm by kuchikirukia »

Offline cold_hell

  • Member
  • Posts: 351
Re: Bleach
« Reply #48 on: October 26, 2014, 02:42:06 pm »
so Avisynth working on a single core isn't limiting me on Very Slow
You can run multiple encodes simultaneously if you want 100% CPU usage;
A quick single episode encode is good for TV releases, but it doesn't really matter for BDs/DVDs when you will release more than 1 episode at once. You can encode single episode on multiple files and then combine them if you want, but it is pointless when you can just encode another episode to fill your CPU's free time.

Offline kuchikirukia

  • Member
  • Posts: 58
Re: Bleach
« Reply #49 on: October 26, 2014, 03:48:08 pm »
Does increasing qcomp or aq-strength increase bitrate to dark areas?  I noticed KAA's was absolutely horrid in the dark while fine in the light (sharper/cleaner than source), and while the previous encode of mine was blurrier than source in the dark even with all the sharpening, the new one isn't. (qcomp 0.7/aq-strength 0.7)
« Last Edit: October 26, 2014, 03:51:38 pm by kuchikirukia »

Offline revo

  • Member
  • Posts: 814
  • I Can Only Carry 50 Loli's at a Time
Re: Bleach
« Reply #50 on: October 26, 2014, 07:14:07 pm »
do the testing and you will see

set in your .avs script

SelectRangeEvery(every=800, length=35, offset=0, audio=false)

which will give you around 1500 frames for 24min episode

Offline Desbreko

  • Member
  • Posts: 614
Re: Bleach
« Reply #51 on: October 26, 2014, 08:24:01 pm »
Increasing aq-strength gives more bits to flat areas, i.e. areas without much contrast, which dark scenes tend to fall under.

Increasing q-comp gives more bits to blocks with high complexity, i.e. blocks with lots of detail, and blocks that aren't referenced as much. This can help dark areas if they're noisy by preserving the noise better, but if they're static, it won't do much.

You can do test encodes of different scenes with varying settings, like with revo's script snippet there, to see exactly how the changes affect your source.

Offline kuchikirukia

  • Member
  • Posts: 58
Re: Bleach
« Reply #52 on: October 28, 2014, 11:04:41 pm »
YES!  Got VFR working.  Current workflow is involved -- gonna see if I there are unnecessary steps in here.
Going to write what I have down so I don't forget

Currently (from makeMKV'd conversion from ISO and mkvmerge-GUI extraction of chapters):

1. Extract MPEG2 with gMKVextractGUI
2. Use DGIndex to make a d2v file
3. Edit avisynth timecodes-generating script for d2v file input

Code: [Select]
SetMemoryMax(600)
LoadPlugin("C:\Program Files\MeGUI_2507_x86\tools\dgindex\DGDecode.dll")
DGDecode_mpeg2source("E:\Video\input.d2v", cpu=1) #cpu=1 needed for tdecimate mode 3 linear access requirement? test
LoadPlugin("C:\Program Files\MeGUI_2507_x86\tools\avisynth_plugin\TIVTC.dll")
LoadPlugin("C:\Program Files\MeGUI_2507_x86\tools\avisynth_plugin\EEDI2.dll")
LoadPlugin("C:\Program Files\MeGUI_2507_x86\tools\avisynth_plugin\TDeint.dll")
edeintted = SeparateFields().SelectEven().EEDI2(field=-1)
tdeintted = TDeint(edeint=edeintted)

tfm(order=-1,clip2=tdeintted).tdecimate(mode=3, hybrid=2, vfrDec=1, mkvOut="mkv-timecodesfile.txt")

4. Open script with Virtualdub and hit play to generate timecodesfile.txt. (hide input pane [F9] for speeeeed)
5. Note Last Actual Frame number in VirtualDub preview that pops up.
6. Edit encoding Avisynth script with d2v input and update Trim command to Last Actual Frame.

Code: [Select]
SetMemoryMax(500)
LoadPlugin("C:\Program Files\MeGUI_2507_x86\tools\dgindex\DGDecode.dll")
DGDecode_mpeg2source("E:\Video\input.d2v", cpu=1)
LoadPlugin("C:\Program Files\MeGUI_2507_x86\tools\avisynth_plugin\TIVTC.dll")
LoadPlugin("C:\Program Files\MeGUI_2507_x86\tools\avisynth_plugin\EEDI2.dll")
LoadPlugin("C:\Program Files\MeGUI_2507_x86\tools\avisynth_plugin\TDeint.dll")
edeintted = SeparateFields().SelectEven().EEDI2(field=-1)
tdeintted = TDeint(edeint=edeintted)
tfm(order=-1,clip2=tdeintted).tdecimate(mode=3, hybrid=2, vfrDec=1, mkvOut="nothing.txt") #different mkvOut file name so as not to overwrite the timecodesfile.txt from the first pass with an empty one.  This probably should generate a good file, but it doesn't, thus the workaround.

#filters
#Trim(0,XXXXX) #set XXXXX to Last Actual Frame

7. Load script in MeGUI and encode.
8. Open encoded MKV in mkvmerge, select the video track, and import the timecodes file under General Track Options.
9. Mux.

Then encode the audio and mux it in.


E: Ok, apparently I don't need VirtualDub, I can load the first script in MeGUI and use Queue Analysis Pass to generate the timecodes.  The Last Actual Frame is noted in the timecodes file so it can be gotten from there.
« Last Edit: October 28, 2014, 11:15:03 pm by kuchikirukia »

Offline Desbreko

  • Member
  • Posts: 614
Re: Bleach
« Reply #53 on: October 29, 2014, 12:59:17 am »
MPEG2Source's cpu parameter is for post-processing. It doesn't have anything to do with linear access.

TDecimate's mode 3 is for single pass vfr, so you shouldn't need to do an analysis pass with it, provided it works with your script. If you need non-linear access, use the two-pass modes 4 and 5.

Using nnedi3 instead of eedi2 and using TDeint's emask parameter with TMM will give you better quality on frames that need to be deinterlaced. It'll be slower, but since it's only for post-processing frames with no good field matches, it shouldn't be that big of a speed hit overall.

Offline kuchikirukia

  • Member
  • Posts: 58
Re: Bleach
« Reply #54 on: October 29, 2014, 01:24:35 am »
Yeah, I know mode 3 is supposed to be single-pass, but it's giving me nothing but a timecode header if I try to use it on the encoding run.
Mode4+5 complains either of a CRC mismatch,  that all frames must have entries, or that it can't read the video stream.
I can get the first pass to output a huge metrics.txt and matches.txt, but they come out practically empty after erroring out on load of the second, which I don't get since they're not set to write them.
Maybe if I rename to something other than the example...
e: Nope.

e2: Ok, it worked through VirtualDub.  And then it started working in MeGUI.  That makes no sense.

Anyway, I switched to FFVideoSource in an attempt to bypass the whole "extract MPEG2/run though DGIndex", and it's working except it gives me a timecodes.txt file with two-frame sequences of 17.982018 FPS here and there.

from d2v with DGDecode_mpeg2source:
Code: [Select]
# timecode format v1
Assume 29.970030
# TDecimate v1.0.3 by tritical
# Mode 3 - Auto-generated mkv timecodes file
0,3,23.976024
24,27,23.976024
33,404,23.976024
515,598,23.976024
704,723,23.976024
744,1795,23.976024
1801,2219,23.976024
# TDecimate Mode 3:  Last Frame = 2219
# vfr stats:  90.22% film  09.78% video
# vfr stats:  2444 - film  265 - video  2709 - total
# vfr stats:  longest vid section - 110 frames
# vfr stats:  # of detected vid sections - 6

From mkv with ffvideosource:
Code: [Select]
# timecode format v1
Assume 29.970030
# TDecimate v1.0.3 by tritical
# Mode 5 - Auto-generated mkv timecodes file
25,28,23.976024
34,373,23.976024
379,381,17.982018
387,390,23.976024
391,393,17.982018
394,405,23.976024
516,599,23.976024
705,724,23.976024
745,1464,23.976024
1470,1472,17.982018
1473,1476,23.976024
1482,1484,17.982018
1490,1509,23.976024
1515,1526,23.976024
1532,1534,17.982018
1535,1798,23.976024
1804,2222,23.976024
# vfr stats:  88.74% film  11.26% video
# vfr stats:  2404 - film  305 - video  2709 - total
# vfr stats:  longest vid section - 110 frames
# vfr stats:  # of detected vid sections - 13

And you can notice it ends a hair sooner.
Any ideas how to fix it?
« Last Edit: October 29, 2014, 02:56:03 am by kuchikirukia »

Offline Desbreko

  • Member
  • Posts: 614
Re: Bleach
« Reply #55 on: October 29, 2014, 07:40:52 am »
I wouldn't use ffms2 for DVD decoding as it's prone to errors. DGIndex is much more reliable.

What I do is mount the ISO on a virtual drive with Daemon Tools Lite, use DVD Decrypter to rip the VOB files, and then use DGIndex to index them. The last step can be automated by using DGIndex's command line interface through a batch file if you've got a lot of VOBs to index.

Offline kuchikirukia

  • Member
  • Posts: 58
Re: Bleach
« Reply #56 on: October 29, 2014, 08:34:39 am »
Darn it, and I had just gotten it all put together to use One-Click using ffms2.

Wait... if I load from a d2v will it use DGDecode_mpeg2source for <input>?

Offline Krudda

  • Member
  • Posts: 10322
  • 私は 日本語 が 上手 じゃ ありません
    • My Anime List
Re: Bleach
« Reply #57 on: October 30, 2014, 08:05:14 am »
Darn it, and I had just gotten it all put together to use One-Click using ffms2.

Wait... if I load from a d2v will it use DGDecode_mpeg2source for <input>?
Not quite, it's just these two lines (unless you autoload the mpeg2 source dll)

Example:

loadplugin("C:\Program Files (x86)\AviSynth 2.5\plugins\DGDecode.dll") #this one is already in the autoload folder, but I still seem to require to manually load it anyway
MPEG2Source("G:\[[[]]]Projects\Otaku no Video\VTS_01_1.d2v", cpu=0)

Offline Koby

  • Member
  • Posts: 71
Re: Bleach
« Reply #58 on: June 18, 2015, 03:11:54 am »
Zero-HP did a really good job at retaining the detail and such; while Arigatou just looks terrible and has destroyed everything. The issue I have with Zero-HP is that for whatever reason they decided to ADD grain to their encode. I'm guessing to help cover up banding and other issues but IDK, it just looks bad on the characters clothes and hair.

kuchikirukia encode here looks like it has some slight aliasing; but from reading the topic it seems like she's did some major overhauling on her encoding script so I'd prefer to see another comparison being done with the new script. Though it is unfortunate that this late in the game, the English dub isn't being included when it's widely available and the last dvd set is being released this year. Just doesn't feel like the complete package and as a result it wouldn't fully replace Arigatou/Zero-HP releases.

Offline kuchikirukia

  • Member
  • Posts: 58
Re: Bleach
« Reply #59 on: August 19, 2015, 07:07:08 am »
The R1's have seriously butchered audio.