DaVinciUA / xvid4psp

Automatically exported from code.google.com/p/xvid4psp
GNU General Public License v2.0
0 stars 0 forks source link

x264 10 bit depth #23

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello.
I would like to know if it was possible to implement an x264 10 bit depth 
encoder into a future release and also to get an option to switch between 8 and 
10 bit depth?

Thanks a lot

Original issue reported on code.google.com by Okocha1...@gmail.com on 25 Jun 2011 at 7:08

GoogleCodeExporter commented 9 years ago
Hello. Of course it is possible, but I don`t think that it`s needed. 10-bit 
encoding is not for "every day using", and if you really need 10-bit for some 
reasons, you can manually replace existing 8-bit x264.exe with 10-bit one (see 
\apps\x264 folder or drag-and-drop appropriate version of x264.exe into preview 
area).

Original comment by forc...@gmail.com on 29 Jun 2011 at 2:06

GoogleCodeExporter commented 9 years ago
Hello.
Thanks for your answer. I'm gonna do that.
Reason why I asked is because the 10 bit depth x264 offers a really better 
video quality and also it encodes faster than the 8 bit depth x264.
As for decoding, I plays great with the latest CCCP build on windows 7.

Original comment by Okocha1...@gmail.com on 29 Jun 2011 at 5:51

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hello again.
I did tried your suggestions, while they worked, they weren't perfect.
First, I can't properly tweak the settings (like CRF) and also choose a 10 bit 
level (High 10@L4.1 or High 10@L5.1). 
So the encoding results aren't exactly what expected when compared with another 
encoder.
Another thing, the current version of xvid4psp can't decode a 10 bit depth x264 
encode (if you wanna re-encode a 10 bit depth to 8 bit depth), it shows a grey 
image. In order to get it to work, ffmpegsource has to be replaced with a newer 
version (that supports 10 bit) and the decoding options for mkv and mp4 have to 
be changed from directshowsource to ffmpegsource2.

So that's why, it would be nice add a proper 10 bit option in the encoding 
settings, and if it was possible to add an option to use ffdshow as decoder it 
would be great too.

I'm asking this because CCCP now released a 10 bit depth filter pack version, 
and the fansubs groups started to move to 10 bit, it won't be long before they 
stop doing 8 bit encodes.

Thanks again for your hard work and support. ^^

Okocha

Original comment by Okocha1...@gmail.com on 13 Jul 2011 at 4:59

GoogleCodeExporter commented 9 years ago
Hi.
Well, just tested it a little bit. 

"I can't properly tweak the settings (like CRF) and also choose a 10 bit level 
(High 10@L4.1 or High 10@L5.1)." - not sure what do you mean by "tweak the 
settings"; if you want High10 profile - just leave it as "Auto", or add\edit 
"--profile high10" to CLI - both will work the same way.

Current versions of FFMS2 (r484, r494) can`t decode 10-bit samples, it requires 
colorspace specifying when calling. Without it we will get an error 
"FFVideoSource: No suitable output format found" - I don`t know is it bug or 
not, so not gonna change anything about it untill it will be clear.

"and if it was possible to add an option to use ffdshow as decoder it would be 
great too." - no, its impossible. Well, it is possible by tweaking the 
registry, but this is not what XviD4PSP must to do. If you want to use 
DirectShowSource and if you want it to use ffdshow, then it is your mission to 
tweak your (system)decoders merrits\settings accordingly (using Win7DSTweaker, 
DSFMgr or something similar).

I will add a "--output-csp" key and "High 10 Profile" option, probably it will 
be good to auto-use a 10-bit encoder when the user switching to this profile. 
But in this case we must have 4 different version of x264 (32bit, 64bit, 10bd 
32bit, 10bd 64bit) - nothing special except a few extra mbytes for the 
installer :)

"Thanks again for your hard work and support." - well.. my support currently is 
very limited. We need a fresh blood, a new programmers! :D

Original comment by forc...@gmail.com on 16 Jul 2011 at 12:18

GoogleCodeExporter commented 9 years ago
Thanks for your reply.

By tweak I meant, CRF for 10 bit goes up to 61 (50 for 8 bit). As for the 
level, I'll try to leave it at auto and see how it ends.

As for FFMS2, I replaced the one from xvid4psp with this one 
http://sourceforge.net/projects/mplayer-win32/files/FFmpeg/git-N-30656-g23a29a3/
 and that way I was able to re-encode a 10 bit encode into an 8 bit one without 
problem, I just had to select FFMS2 in the decoding option.

Thanks for adding the "--output-csp" key and "High 10 Profile" option, it will 
be useful. ^^

Greats

Okocha

Original comment by Okocha1...@gmail.com on 16 Jul 2011 at 3:22

GoogleCodeExporter commented 9 years ago
Oh yes. You're right about the settings, I didn't know about this.

-q, --qp <integer>          Force constant QP (0-69, 0=lossless)
-q, --qp <integer>          Force constant QP (0-81, 0=lossless)

--crf <float>           Quality-based VBR (0-51) [23.0]
--crf <float>           Quality-based VBR (-12-51) [23.0]

--qpmax <integer>       Set max QP [69]
--qpmax <integer>       Set max QP [81]

I'm not sure yet how to resolve it..

Original comment by forc...@gmail.com on 16 Jul 2011 at 4:19

GoogleCodeExporter commented 9 years ago
Yes, yes.

That's what I was trying to say. ^^

Original comment by Okocha1...@gmail.com on 16 Jul 2011 at 4:43

GoogleCodeExporter commented 9 years ago
http://rghost.ru/private/15091431/6f5e09f4405796ce94c7750d62cc5fa8 - here is 
exe from r240. 10-bit depth x264.exe must be placed to \apps\x264_10b folder. 
Different limits\defaults also must work.

Original comment by forc...@gmail.com on 19 Jul 2011 at 3:14

GoogleCodeExporter commented 9 years ago
Thanks a lot.
It works better now. Just the max CRF needs to be modified also, 8 bit has 51 
max and 10 bit has 61 max.

Original comment by Okocha1...@gmail.com on 20 Jul 2011 at 1:08

GoogleCodeExporter commented 9 years ago
You`re welcome :) As stated in --fullhelp for a 10-bit version (2019 at least), 
CRF range is -12-51, so maximum is the same (51) as for 8-bit. You can encode 
with (say) --crf 57.0 and then check with MediaInfo that this value was 
lowered\limited to 51.

Original comment by forc...@gmail.com on 20 Jul 2011 at 2:42

GoogleCodeExporter commented 9 years ago
Yes, you are right, they changed it again.

But, CRF -12 won't work. http://pastebin.com/uicpgNrj
And why I try to encode using command lines it tells me this:
"x264 [error]: high10 profile doesn't support lossless"

-11 is the maximum you can use (tried -11.1 and crashed also with the same 
error)

So, I think, that the lossless option should be grayed out when using High 10 
Profile.

Original comment by Okocha1...@gmail.com on 20 Jul 2011 at 5:04

GoogleCodeExporter commented 9 years ago
CRF = -12 (from -12 to -11.1) - is lossless range for 10-bit. So you have some 
problems (crashing x264) in 10-bit Lossless mode. Sorry, I can`t help you with 
this. You better ask about it someone from the x264 team. But first try 32bit 
10bit-depth version or version compiled by someone else (from here for example 
http://www.xvidvideo.ru/x264-video-codec/x264-video-codec-rev-2019-x86-x64.html)
. Anyway, this is not the reason for graying out Lossless checkbox if 10-bit is 
selected.

How did you get this error "x264 [error]: high10 profile doesn't support 
lossless"? It could only happen if you passed --crf -12 (or --qp 0) and 
--profile keys both at the same time. But XviD4PSP (uploaded above) will 
remove* any --profile keys from the command line if Lossless mode is active. 
Well.. It must, at least :D
* - remove from the command line that will be passed to encoder right before it 
calling; your encoding preset remains unaffected.

Original comment by forc...@gmail.com on 20 Jul 2011 at 7:55

GoogleCodeExporter commented 9 years ago
When I select lossless, xvid4psp automatically selects Constant Quantizer, if I 
choose Constant Quality it refuses to use lossless.
In order to get CRF -12, I've to do like that:
Select Constant Quality, then choose high10 profile, then set the CRF to -12 
and then the lossless button sticks from itself

"--crf -12.0 --preset medium --profile high10 --ref 8 --deblock -1:-1 --b-adapt 
2 --trellis 2 --no-fast-pskip --psy-rd 1.0:0.1 --partitions all --me umh 
--rc-lookahead 50 --extra:"

I can't choose CRF -12 without having chosen profile high10 before.

Original comment by Okocha1...@gmail.com on 20 Jul 2011 at 10:19

GoogleCodeExporter commented 9 years ago
Ok. Do you have any problems right now? Because all what you described above - 
this is how it should be, and I don`t see any problems here. 10-bit x264 
crashes for me too with your settings (from this log 
http://pastebin.com/uicpgNrj). But since you`re trying to encode in Lossless 
mode, most of this settings is probably pointless anyway, so leave just "--qp 0 
--preset medium --profile high10" on the CLI tab, the key "--profile high10" 
will be removed from this line when encoding starts.

Original comment by forc...@gmail.com on 21 Jul 2011 at 10:29

GoogleCodeExporter commented 9 years ago
OK.
I tried like that:
"--qp 0 --preset medium --profile high10 --level 5.1 --aq-strength 0.6 
--deblock -1:0 --b-adapt 2 --no-fast-pskip --psy-rd 0.4:0.0 --threads 4 
--partitions all --me umh --extra:"
And the error is still happening. If I remove --profile high10 from the profil, 
then xvid4psp encodes using 8bit depth x264.
But what's strange is that http://pastebin.com/PRKdM9NB (x264 [info]: profile 
High 4:4:4 Predictive, level 5.1, 4:2:0 10-bit)

Original comment by Okocha1...@gmail.com on 21 Jul 2011 at 12:47

GoogleCodeExporter commented 9 years ago
But I'm only using lossless for testing purpose and to find possible bugs.
I don't use it normally.

Original comment by Okocha1...@gmail.com on 21 Jul 2011 at 12:49

GoogleCodeExporter commented 9 years ago
Oh, btw, this is unrelated, but I tried a new MT version of avisynth which can 
be found here http://xhmikosr.1f0.de/index.php?folder=YXZpc3ludGg=
So far that version works great but only with new processors.
That site has some nice patches

Original comment by Okocha1...@gmail.com on 21 Jul 2011 at 1:41

GoogleCodeExporter commented 9 years ago
"And the error is still happening." - x264 crashes, I can`t help you with that..
"If I remove --profile high10 from the profil, then xvid4psp encodes using 8bit 
depth x264." - yes, you don`t need to remove this key. But XviD4PSP will remove 
it when encoding starts, if Lossless mode is active (because --profile is 
incompatible with Lossless and --profile high10 is only required to determine 
what version of x264 must be used).
"But what's strange is that" - and what`s strange? x264 crashes in 10-bit 
Lossless mode :) Or what?

P.S. New MT-builds of AviSynth 2.6 also can be found here 
http://forum.doom9.org/showthread.php?t=148782 , but I didn`t test it myself..
Very interesting, what`s the difference between current 2.5.8 MT (by SEt) and 
2.5.8 MT from your link, except compiler.

Original comment by forc...@gmail.com on 21 Jul 2011 at 3:52

GoogleCodeExporter commented 9 years ago
Yes, whatever is chosen, x264 crashes in 10-bit Lossless mode. Can't say why 
though.

As for xhmikosr avisynth version, it seems to have been tweaked for Intel 
processor.
But I'm gonna test the aviSynth 2.6 MT and let you know, but it may need a 
couples of encodes before I can give you an opinion.

So, I think the only thing left to do for 10-bit depth would be the decoding in 
case someone wants to re-encode a 10 bit to 8 bit.
I tested xvid4psp 6 and it seems this one can decode 10-bit encoded videos, but 
I can't say what filters it uses to do that.
Also, I've to say that I'm not really found of xvid4psp 6. It's not user 
friendly and lacks advanced features.

Original comment by Okocha1...@gmail.com on 21 Jul 2011 at 4:54

GoogleCodeExporter commented 9 years ago
AviSynth 2.6 is still in Alpha stage, so be carefull..

Decoding 10-bit files is possible with DirectShowSource and DirectShowSource2, 
but you must have all requiered codecs\splitters installed and properly tuned. 
FFmpegSource2 also can decode such files, but currently it can`t be used 
without forcing the colorspace (autoforcing is broken in FFmpeg code, see here 
http://forum.doom9.org/showthread.php?p=1513636#post1513636). So.. 1.) someone 
will fix this bug or 2.) I will add an option to forcing the colorspace or 3.) 
you can modify \dlls\AviSynth\plugins\FFMS2.avsi (find colorspace = 
default(colorspace,"") and put YV12 between quotes).
XviD4PSP 6 is based on FFmpeg libraries, so I think it decode such files the 
same way as FFmpegSource2 does. I have very outdated version and don`t want to 
upgrade (don`t want to install Framework 4.0 :p ).

Original comment by forc...@gmail.com on 21 Jul 2011 at 5:57

GoogleCodeExporter commented 9 years ago
I tested a bit avisynth 2.6 MT, what I can say is that it is a bit faster than 
2.5.8 MT but crashes more often. So it's not good for now.

Thanks for your trick (\dlls\AviSynth\plugins\FFMS2.avsi), I modified it.

Original comment by Okocha1...@gmail.com on 22 Jul 2011 at 1:34

GoogleCodeExporter commented 9 years ago
No Problem :) I`ve made some more changes to x264 settings window, adding 
--tune and --subme 11 (r2036+). Not committed yet. 
http://rghost.ru/private/15558141/156d9a21d517036585347e7529d7714d - here.

Original comment by forc...@gmail.com on 23 Jul 2011 at 5:52

GoogleCodeExporter commented 9 years ago
OK, thanks a lot.
I tested it and the tune options are working, when selected they enable, 
disable and modify stuff were needed.
--tune grain will be really useful for some movies and animes.
--subme 11, I can't test that one yet, the new revision of trellis isn't out 
yet (I think).

Original comment by Okocha1...@gmail.com on 24 Jul 2011 at 1:22

GoogleCodeExporter commented 9 years ago
Hi dont know if any1 is going to anwser me but here i go:

I ve replaced also the 8bit x264 to a 10bit but after i enconded a anime eps in 
mkv with ass subtitles to mp4 ps3 format the fonts changed to a default. Can 
some1 help me on this subject?

Original comment by gasparsa...@hotmail.com on 30 Jan 2012 at 1:11