[Cin] I think I found way how to build multi-bit-depth x265 and link it into ffmpeg/CinGG

Andrew Randrianasulu randrianasulu at gmail.com
Sat Nov 2 01:40:59 CET 2019


It was in the source :}

Just disable asm for 32-bit arch if you are building 12- and 10-bit versions .. It will be dog slow
(like 8 min for 1 min encode of 720x400 film clip! On 4x 3.9Ghz AMD machine) but it will work

in  cinelerra-5.1/thirdparty/x265_3.1.2 replace supplied configure with attached configure script, and multilib.sh
inside x265_3.1.2/build/linux/ with attached version too.

Then remove x265 and ffmpeg build-touch files in cinelerra-5.1/thridparty/build, it will trigger rebuild of both if 
you will do make in cinelerra-5.1 root dir.

then, if everything was ok - cd cinelerra, make clean , cd ../ , make -j 5.
resulted file in bin will be 10-bit hevc capable Cinelerra-GG

root at slax:/dev/shm/tmp/cinelerra-goodguy-20191101/cinelerra-5.1/bin# ./cin
Cinelerra Infinity - built: Nov  2 2019 03:08:05
git://git.cinelerra-gg.org/goodguy/cinelerra.git
(c) 2006-2019 Heroine Virtual Ltd. by Adam Williams
(c) 2007-2019 cin5 derivative by W.P. Morrow aka goodguy
Cinelerra is free software, covered by the GNU General Public License,
and you are welcome to change it and/or distribute copies of it under
certain conditions. There is absolutely no warranty for Cinelerra.

x265 [info]: HEVC encoder version 3.1.2+1-76650bab70f9
x265 [info]: build info [Linux][GCC 5.5.0][32 bit][noasm] 10bit
x265 [info]: using cpu capabilities: none!
x265 [info]: Main 4:2:2 10 profile, Level-3 (Main tier)
x265 [info]: Thread pool created using 4 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 2 / wpp(7 rows)
x265 [warning]: Source height < 720p; disabling lookahead-slices
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 3
x265 [info]: Keyframe min / max / scenecut / bias: 3 / 30 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 3 / off / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 2 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-28.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 early-skip rskip signhide tmvp b-intra
x265 [info]: tools: strong-intra-smoothing deblock sao
x265 [info]: frame I:     73, Avg QP:26.28  kb/s: 2612.99
x265 [info]: frame P:    455, Avg QP:28.33  kb/s: 716.62
x265 [info]: frame B:   1383, Avg QP:34.19  kb/s: 139.91
x265 [info]: Weighted P-Frames: Y:1.1% UV:0.0%
x265 [info]: consecutive B-frames: 5.1% 10.6% 1.9% 82.0% 0.4%

encoded 1911 frames in 449.76s (4.25 fps), 371.69 kb/s, Avg QP:32.49
Render::render_single: Session finished.
** rendered 1911 frames in 449.855 secs, 4.248 fps
audio0 pad 16 0 (16)


note, for x86_64 you actually can re-enable asm in multilib.sh, I just have only 32-bit Slackware ATM .

Note2: you should choose pixel format by hand - yuv422p10le - not just yuv422p10 as h265-10bit.mp4 suggest

Mplayer seems to recognize this as 10 bit depth file:

mplayer /dev/shm/hevc_10bit.mp4
MPlayer SVN-r38152-5.5.0 (C) 2000-2019 MPlayer Team
224 audio & 466 video codecs

Playing /dev/shm/hevc_10bit.mp4.
libavformat version 58.33.100 (internal)
libavformat file format detected.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x5755e9e0]Protocol name not provided, cannot determine if input is local or a network protocol, buffers and access patterns cannot be configured optimally without knowing the protocol
[lavf] stream 0: video (hevc), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang rus
VIDEO:  [HEVC]  720x400  24bpp  25.000 fps  372.5 kbps (45.5 kbyte/s)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 58.59.102 (internal)
Selected video codec: [ffhevc] vfm: ffmpeg (FFmpeg HEVC / H.265)
==========================================================================
Clip info:
 major_brand: isom
 minor_version: 512
 compatible_brands: isomiso2mp41
 encoder: Lavf58.29.100
Load subtitles in /dev/shm/
==========================================================================
Forced audio codec: mad
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
[aac @ 0x576b67e0]Multiple frames in a packet.
AUDIO: 48000 Hz, 2 ch, floatle, 128.5 kbit/4.18% (ratio: 16062->384000)
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
AO: [alsa] 48000Hz 2ch floatle (4 bytes per sample)
Starting playback...
[aac @ 0x576b67e0]channel element 0.0 is not allocated
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
Movie-Aspect is 1.80:1 - prescaling to correct movie aspect.
[swscaler @ 0x577f2140]bicubic scaler, from yuv422p10le to yuv420p using MMXEXT
VO: [vdpau] 720x400 => 720x400 Planar YV12
A:  61.3 V:  61.3 A-V: -0.023 ct: -0.048   0/  0  7% 16%  0.6% 0 0

Exiting... (Quit)

Happy hacking!

PS:

x265 [info]: HEVC encoder version 3.1.2+1-76650bab70f9
x265 [info]: build info [Linux][GCC 5.5.0][32 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX XOP FMA4 FMA3 BMI1
x265 [info]: Main profile, Level-3 (Main tier)
x265 [info]: Thread pool created using 4 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 2 / wpp(7 rows)
x265 [warning]: Source height < 720p; disabling lookahead-slices
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 3
x265 [info]: Keyframe min / max / scenecut / bias: 3 / 30 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 3 / off / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 2 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-5.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 early-skip rskip signhide tmvp b-intra
x265 [info]: tools: strong-intra-smoothing deblock sao
x265 [info]: frame I:     72, Avg QP:4.03  kb/s: 20900.03
x265 [info]: frame P:    458, Avg QP:5.11  kb/s: 11911.56
x265 [info]: frame B:   1381, Avg QP:10.12  kb/s: 3065.83
x265 [info]: Weighted P-Frames: Y:0.4% UV:0.0%
x265 [info]: consecutive B-frames: 4.0% 13.0% 1.7% 81.1% 0.2%

encoded 1911 frames in 220.58s (8.66 fps), 5857.77 kb/s, Avg QP:8.69
Render::render_single: Session finished.
** rendered 1911 frames in 220.697 secs, 8.659 fps

as you can see 8-bit encoding still fast/asm'ed.
-------------- next part --------------
cd build/linux/
./multilib.sh
cp 8bit/libx265.a ../../

# cmake "$@" "source"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: multilib.sh
Type: application/x-shellscript
Size: 1046 bytes
Desc: not available
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20191102/f1ca4dbc/attachment-0001.sh>


More information about the Cin mailing list