Solved Issue - 10-bit h264 (Hi10) Support?

  Thread Rating:
  • 7 Votes - 4.43 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Ned Scott Offline
Team-XBMC Wiki Guy
Posts: 18,365
Joined: Jan 2011
Reputation: 222
Location: Arizona, USA
Post: #361
A patch is already waiting in the wings that has the FFmpeg bump, so keep an eye out on the nightly builds when they start up again. The wiki page will also be updated when that is merged to nightlies.

You can make easy links to the XBMC wiki using double brackets around words: [[debug log]] = debug log, [[Add-on:YouTube]] = Add-on:YouTube, [[Adding videos to the library]] = Adding videos to the library, [[userdata]] = userdata, etc
find quote
enolive Offline
Junior Member
Posts: 16
Joined: May 2011
Reputation: 0
Post: #362
Hi there!

Any suggestions which tools/options I should use for transcoding 10 to 8 Bit? My goal is to write a small shell script that can batch convert exclusive Hi10p stuff to something I can enjoy on my XBMC 11.0 box Wink. I've tried to compile XBMC myself only to notice that I won't get any hw acceleration, so this is no satisfying option for me (at least not for Hi10p 1080p stuff).

Right now, I use the following commands for conversion (using both x264 and mkvtoolnix from the ubuntu repos):

x264 --threads=auto --tune animation --preset veryfast --profile high --level 4.1 --crf 16 -o "$TEMPFILE" "$INPUT"
mkvmerge -o "$OUTPUT" -D "$INPUT" "$TEMPFILE"
find quote
magao Offline
Senior Member
Posts: 155
Joined: Sep 2008
Reputation: 2
Post: #363
I just leave Handbrake open with my "Anime" settings. I download things to "...\<Show name>\10-bit" folders, so I just set the default path for automatically named files to "{source_path}\.." and the format to "{source}". So for nearly everything I can just drag the episode into Handbrake and start transcoding.

My actual settings are likely to be very different to yours. They're tuned to get the highest quality (essentially imperceptible difference from source) in a reasonable filesize transcoding at ~25-30FPS for 720p animation on my 4 core/8 thread CPU. That works out to be:

Constant framerate
CRF: 20
Passthrough audio (always - if Handbrake can't passthrough e.g. vorbis I'll discard and remux the orignal in later)
Ref frames: 6
Max. B-frames: 5
Adaptive B-frames: Optimal
Mostion estimation: UHM: 9
psy-rd: 0.50,0.00
Everything else at default.

The reference frames and max b-frames were determined by doing tests at everything from 1 to 16 and seeing where their use tailed off in the logs. Beyond these numbers there was minimal use and filesize reduction, but increased transcoding time.
(This post was last modified: 2012-03-30 23:43 by magao.)
find quote
lad1337 Offline
Junior Member
Posts: 19
Joined: May 2010
Reputation: 0
Post: #364
(2012-03-30 16:42)enolive Wrote:  Hi there!

Any suggestions which tools/options I should use for transcoding 10 to 8 Bit? My goal is to write a small shell script that can batch convert exclusive Hi10p stuff to something I can enjoy on my XBMC 11.0 box Wink. I've tried to compile XBMC myself only to notice that I won't get any hw acceleration, so this is no satisfying option for me (at least not for Hi10p 1080p stuff).

Right now, I use the following commands for conversion (using both x264 and mkvtoolnix from the ubuntu repos):

x264 --threads=auto --tune animation --preset veryfast --profile high --level 4.1 --crf 16 -o "$TEMPFILE" "$INPUT"
mkvmerge -o "$OUTPUT" -D "$INPUT" "$TEMPFILE"

i am very interested in this since something like this might be the only solution for me ...
but i have another problem ... i use an automated system of sb and sab

and it appears that not every release group mentions if it is 10-bit or 8-bit in the title
so what i need is a way to find out if the current file is in 10-bit or 8-bit and act accordingly with either enolive code or another handbrake cli cmd

my question is has anyone figured out a way find out if a file is in 10-bit from the cli ?
find quote
jpsdr Offline
Fan
Posts: 312
Joined: Oct 2003
Reputation: 0
Post: #365
Things here : https://github.com/xbmc/xbmc/pull/810 are very promising.
Only hope the version will have the same multi-threading capability as ffdshow to be able to decode without problem 10 bits 1080p high bitrate video. Big Grin
find quote
boingman Offline
Senior Member
Posts: 128
Joined: Apr 2011
Reputation: 0
Post: #366
Yeah, multi threading support is important. Otherwise we'll get frame drops again.
find quote
sereny Offline
Junior Member
Posts: 23
Joined: Dec 2008
Reputation: 0
Post: #367
Indeed, multi-threading is obligatory. Otherwise only i5/i7 users will have a chance at decoding without heavy framedrops.

(Using the old experimental builds for 10bit on my Q6600 results in occasional framedrops even with 720p material, therefore single-threaded decoding is really no good.)
find quote
enolive Offline
Junior Member
Posts: 16
Joined: May 2011
Reputation: 0
Post: #368
(2012-03-31 17:54)lad1337 Wrote:  my question is has anyone figured out a way find out if a file is in 10-bit from the cli ?

mkvinfo displays the used h264 profile in its output, for example (in Shakugan no Shana from SS-Eclipse):

Code:
|  + private Codecdaten, Länge 49 (h.264-Profil: High 10 @L5.1)

btw, here is the shell script I use for transcoding.

http://pastebin.com/2rCh13Pk

@magao: thanks for your reply! I will try out your options in my cli solution later Wink
find quote
Shine Offline
Junior Member
Posts: 48
Joined: Apr 2012
Reputation: 1
Post: #369
(2012-03-31 18:34)jpsdr Wrote:  Things here : https://github.com/xbmc/xbmc/pull/810 are very promising.
Only hope the version will have the same multi-threading capability as ffdshow to be able to decode without problem 10 bits 1080p high bitrate video. :D

So I went ahead and compiled it. The latest commit (a0fc63df94) appears to break multithreading. So I went back to the previous one (3201695872). Multithreading is fine in this build, Hi10P 1080p content using 40-50% CPU on my Q9650 and no frame drops!

From a few quick tests, I found the following additional things to note (no idea whether these are specific to this build or present in 11.0 as well):
  • Vorbis and WMA audio is broken. No sound is playing and the video freezes after a few seconds.
  • MKV aspect ratio tags are finally being honored!!
  • There seems to be a rounding bug or something in the resizer calculations. E.g. a 1920x1038 MKV was resized to 1920x1039, leading to frame drops when using shader or software based scaling. I found only 1 affected file out of a handful tested, so it could as well be specific to this file.
  • Also noticed some ASS subtitle corruption that I'm quite sure hasn't been there before (I was using pre-Eden nightlies including bambi73's builds from this thread)

All in all, pretty promising!
(This post was last modified: 2012-04-01 21:51 by Shine.)
find quote
sereny Offline
Junior Member
Posts: 23
Joined: Dec 2008
Reputation: 0
Post: #370
@shine: Could you upload your compiled build somewhere? I'm really eager to test it and would also like to report my findings, but do not have a build-environment at hand.
find quote
Shine Offline
Junior Member
Posts: 48
Joined: Apr 2012
Reputation: 1
Post: #371
Here you go:

This is from elupus' ffmpeg_0.10.2 branch: https://github.com/elupus/xbmc/tree/ffmpeg_0.10.2
All credits go to elupus, I have nothing to do with the code, I just compiled it.

Revision 3201695872: Multithreading works, but the comments in the pull request suggest that DXVA is broken in this rev.
Download here: http://www.mediafire.com/?raap74gkx6k4lk8

Revision a0fc63df94: Multithreading broken for me, but apparently DXVA is fixed in this rev.
Download here: http://www.mediafire.com/?rxc3jfye0klotmd
find quote
sereny Offline
Junior Member
Posts: 23
Joined: Dec 2008
Reputation: 0
Post: #372
Great, thank you very much!
Will check it out.
find quote
lad1337 Offline
Junior Member
Posts: 19
Joined: May 2010
Reputation: 0
Post: #373
(2012-04-01 14:06)enolive Wrote:  mkvinfo displays the used h264 profile in its output, for example (in Shakugan no Shana from SS-Eclipse):

Code:
|  + private Codecdaten, Länge 49 (h.264-Profil: High 10 @L5.1)

btw, here is the shell script I use for transcoding.

http://pastebin.com/2rCh13Pk

@magao: thanks for your reply! I will try out your options in my cli solution later Wink

thanks so much for your script and the info
after some work i came up with my own script that checks if a file is 10-bit and transcodes it
here: https://gist.github.com/2277551

but it uses HandBrakeCli since the x264 did not work for me

(2012-03-30 23:36)magao Wrote:  Constant framerate
CRF: 20
Passthrough audio (always - if Handbrake can't passthrough e.g. vorbis I'll discard and remux the orignal in later)
Ref frames: 6
Max. B-frames: 5
Adaptive B-frames: Optimal
Mostion estimation: UHM: 9
psy-rd: 0.50,0.00
Everything else at default.
i also tried to add your settings as a "profile" for the script


to use the script you will need HandBrakeCLI which can be found here http://handbrake.fr/downloads2.php
you can just run it by: transcode10to8.sh -i some_anime.mkv
and it will create a file some_anime[8-bit].mkv

for more info use transcode10to8.sh -h
(This post was last modified: 2012-04-02 01:00 by lad1337.)
find quote
magao Offline
Senior Member
Posts: 155
Joined: Sep 2008
Reputation: 2
Post: #374
(2012-04-01 14:06)enolive Wrote:  mkvinfo displays the used h264 profile in its output, for example (in Shakugan no Shana from SS-Eclipse):

Coincidentally, that's the same show/release that prompted my comment above about vorbis audio not being passed through by Handbrake. And now it's over :(

BTW I enjoyed Shakugan no Shana F, but it's such a pity that the great character interaction in the first 3 series took a back seat (read: almost excluded entirely) in the final series.
(This post was last modified: 2012-04-02 00:28 by magao.)
find quote
jpsdr Offline
Fan
Posts: 312
Joined: Oct 2003
Reputation: 0
Post: #375
The a0fc63df94 is the following : changed: Only allow slice based parallel decoding.
What i'm affraid : If "slice" refer to the same "slice" parameter you have in the x264 parameter encode, this purely disable multithreading because mkv files are not encoded with slices.
You have slices only when you encode in level 4.1 for blu-ray targer, because authoring software requiered h264 level 4.1 video to have 4 slices. Otherwise, as having slice will (very slighty) reduce encoding quality, you'll never see encode with slice except specialy when you encode for blu-ray authoring.
So, having mt only on slice is purely useless, as frames have no (or only 1) slice, and if it has to stay like this, we're screwed !! Sad
Wich means mt will have benefit only for frame parallel decoding.
Now, if "slice" refer to totaly something else, what i've said is not relevant.
(This post was last modified: 2012-04-02 22:51 by jpsdr.)
find quote
Post Reply