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 > Video Encoding > High Efficiency Video Coding (HEVC)

Reply
 
Thread Tools Search this Thread Display Modes
Old 26th April 2016, 23:00   #3621  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
Quote:
Originally Posted by Ma View Post
www.msystem.waw.pl/x265/utf16_output.7z

It is only output file fixed (remains: input y4m + yuv and stat file).
works great, thanks!
stax76 is offline   Reply With Quote
Old 27th April 2016, 00:17   #3622  |  Link
Magik Mark
Registered User
 
Join Date: Dec 2014
Posts: 666
I have a single Xeon 2695v3 CPU. May I ask which among the x265 build is best for my CPU? Is it the ICC build? GCC 5.3 / 6? AVX2?

Thanks
__________________
Asus ProArt Z790 - 13th Gen Intel i9 - RTX 3080 - DDR5 64GB Predator - LG OLED C9 - Yamaha A3030 - Windows 11 x64 - PotPlayerr - Lav - MadVR
Magik Mark is offline   Reply With Quote
Old 27th April 2016, 05:26   #3623  |  Link
x265_Project
Guest
 
Posts: n/a
Quote:
Originally Posted by Magik Mark View Post
I have a single Xeon 2695v3 CPU. May I ask which among the x265 build is best for my CPU? Is it the ICC build? GCC 5.3 / 6? AVX2?

Thanks
x265 has over a thousand kernels that have been hand-optimized with the latest SIMD instruction sets (SSE2, SSE3, SSE4, AVX, AVX2). Your compiler won't change these kernels one bit. For the rest of the code, there are very minor differences in performance due to different compilers (ICC vs GCC).
  Reply With Quote
Old 27th April 2016, 18:28   #3624  |  Link
Ma
Registered User
 
Join Date: Feb 2015
Posts: 326
I've made extended version of Unicode patch for Windows -- now output file works and stat file(s). Console info is also fixed including error messages, example:
Code:
i:\vs\x265\ma\XP>x265 --pass 1 --bitrate 4500 --stat Łojezu_Łotr-jeden?.stat /speed/720p50_parkrun_ter.y4m -o W_żółtych_płomieni
ach_liści.hevc
y4m  [info]: 1280x720 fps 50/1 i420p8 sar 1:1 frames 0 - 503 of 504
raw  [info]: output file: W_żółtych_płomieniach_liści.hevc
x265 [info]: HEVC encoder version 1.9+147-19cced21060f
x265 [info]: build info [Windows][GCC 6.1.0][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
x265 [info]: Main profile, Level-4 (Main tier)
x265 [info]: Thread pool created using 4 threads
x265 [info]: frame threads / pool features       : 2 / wpp(12 rows)
x265 [error]: can't open stats file Łojezu_Łotr-jeden?.stat.temp
x265 [error]: failed to open encoder
Sample multilib build (WinXP compatible, 64-bit and 32-bit + patch):
www.msystem.waw.pl/x265/utf16_output-stat.7z

If there will be no errors, tomorrow I will send this patch to devel-list.
Ma is offline   Reply With Quote
Old 27th April 2016, 19:13   #3625  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
@MA

The first was perfect, this one encodes but the console output looks wrong:



My code works for all other tools:

Code:
Overloads Sub Encode(passName As String, batchCode As String)
    batchCode = "@echo off" + BR + "CHCP 65001" + BR + batchCode
    Dim batchPath = p.TempDir + p.TargetFile.Base + "_encode.bat"
    File.WriteAllText(batchPath, batchCode, New UTF8Encoding(False)) 'UTF8 without BOM

    Using proc As New Proc
        proc.Init(passName)
        proc.Encoding = Encoding.UTF8
        proc.File = "cmd.exe"
        proc.Arguments = "/C call """ + batchPath + """"
        proc.Start()
    End Using
End Sub

Last edited by stax76; 27th April 2016 at 19:17.
stax76 is offline   Reply With Quote
Old 27th April 2016, 20:02   #3626  |  Link
Ma
Registered User
 
Join Date: Feb 2015
Posts: 326
@stax76
Thanks for info! I've changed output mode for stderr from _O_U16TEXT to _O_U8TEXT. New test build (only 64-bit + patch):
www.msystem.waw.pl/x265/utf16_output-stat2.7z
Ma is offline   Reply With Quote
Old 27th April 2016, 20:45   #3627  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
@Ma

Thanks for the test build, I tested various things without noticing any problem!
stax76 is offline   Reply With Quote
Old 27th April 2016, 23:05   #3628  |  Link
pingfr
Registered User
 
Join Date: May 2015
Posts: 185
The true power of the Open Source.
pingfr is offline   Reply With Quote
Old 27th April 2016, 23:45   #3629  |  Link
x265_Project
Guest
 
Posts: n/a
Quote:
Originally Posted by pingfr View Post
The true power of the Open Source.
It's unbeatable. Thanks guys.
  Reply With Quote
Old 28th April 2016, 09:20   #3630  |  Link
Ma
Registered User
 
Join Date: Feb 2015
Posts: 326
Patch which allows Unicode filenames in Windows (for now output file and stat files) has been sent
https://patches.videolan.org/patch/13109/

Next we can fix input files.
------------------------
GCC on old mingw-w64 not works with this code. First workaround is:
Code:
diff -r 00ea3784bd36 source/common/common.cpp
--- a/source/common/common.cpp	Thu Apr 28 09:59:30 2016 +0200
+++ b/source/common/common.cpp	Fri Apr 29 03:12:31 2016 +0200
@@ -185,7 +185,7 @@
     MultiByteToWideChar(CP_UTF8, 0, buffer, -1, buf_utf16, sizeof(buf_utf16)/sizeof(wchar_t));
     fflush(stderr);
     int oldmode = _setmode(_fileno(stderr), _O_U8TEXT);
-    fwprintf(stderr, L"%ls", buf_utf16);               // WARNING: due to bug in msvcrt.dll fputws doesn't work in mingw/gcc 
+    fwprintf_s(stderr, L"%ls", buf_utf16);             // WARNING: due to bug in msvcrt.dll fputws doesn't work in mingw/gcc
     fflush(stderr);
     _setmode(_fileno(stderr), oldmode);
 }
Under investigation...

Last edited by Ma; 29th April 2016 at 02:14.
Ma is offline   Reply With Quote
Old 29th April 2016, 03:52   #3631  |  Link
Ma
Registered User
 
Join Date: Feb 2015
Posts: 326
Could someone with WinXP test this 32-bit version of x265:
www.msystem.waw.pl/x265/32bit-xp.zip

I've tested on Win7 64bit and Vista 32bit -- works. I don't have WinXP.
It should work and should be line "raw [info]:"
Code:
y4m  [info]: 1280x720 fps 50/1 i420p8 sar 1:1 frames 0 - 503 of 504
raw  [info]: output file: Żółć.hevc
x265 [info]: HEVC encoder version 1.9+150-00ea3784bd36
x265 [info]: build info [Windows][GCC 5.3.0][32 bit] 8bit
This is due a bug in old mingw-w64 (v4 for example) in function fwprintf, so we can try fwprintf_s instead.
-------------------
Finally I give up with mingw-w64 (for ver. 3 I can't write working code), so it is easier switch to Windows API. If someone wants to try new code:
hg import --no-commit https://patches.videolan.org/patch/13138/raw/

Last edited by Ma; 29th April 2016 at 09:31.
Ma is offline   Reply With Quote
Old 29th April 2016, 14:16   #3632  |  Link
pie
Registered User
 
pie's Avatar
 
Join Date: Sep 2012
Posts: 17
Quote:
Originally Posted by Ma View Post
Could someone with WinXP test this 32-bit version of x265:
www.msystem.waw.pl/x265/32bit-xp.zip

Doesn't work:
http://i.imgur.com/v4bLZpq.png
pie is offline   Reply With Quote
Old 29th April 2016, 14:57   #3633  |  Link
Ma
Registered User
 
Join Date: Feb 2015
Posts: 326
Quote:
Originally Posted by pie View Post
Thanks!

I've prepared new samples compiled with patch
https://patches.videolan.org/patch/13138/
Could you test this on WinXP (on 99% should work, both compiled by GCC 4.8.3 and GCC 5.3):
www.msystem.waw.pl/x265/32bit-xp2.zip
Ma is offline   Reply With Quote
Old 29th April 2016, 15:12   #3634  |  Link
pie
Registered User
 
pie's Avatar
 
Join Date: Sep 2012
Posts: 17
Quote:
Originally Posted by Ma View Post
Thanks!
Could you test this on WinXP (on 99% should work, both compiled by GCC 4.8.3 and GCC 5.3):
www.msystem.waw.pl/x265/32bit-xp2.zip

Both versions seem to work.

raw [info]: output file: Zólc.hevc
pie is offline   Reply With Quote
Old 29th April 2016, 15:23   #3635  |  Link
Ma
Registered User
 
Join Date: Feb 2015
Posts: 326
Quote:
Originally Posted by pie View Post
Both versions seem to work.

raw [info]: output file: Zólc.hevc
Thanks! So we should make a fix to mingw-w64 code (but this may take a long while). For now it is better to apply 13138 patch.
---------------
After investigation -- mingw-w64 code looks OK, x265 v1.9+150 code looks OK, the bug is in msvcrt.dll. Almost all mingw-w64 stdio code is written with use of fputwc/fputc functions from msvcrt.dll. fputwc function from msvcrt.dll doesn't work with _O_U8TEXT mode (works only with _O_U16TEXT mode). If you build x265 v1.9+150 by mingw-w64/gcc linked to msvcrt.dll, there will be no "raw [info]" line in console. If you link to msvcr110.dll instead of msvcrt.dll, all is working (without any changes in x265 code nor mingw-w64 code). Example www.msystem.waw.pl/x265/gcc483-xp.7z -- x265n.exe is linked to msvcr110.dll and works OK without any patches.

Last edited by Ma; 29th April 2016 at 20:22.
Ma is offline   Reply With Quote
Old 1st May 2016, 13:07   #3636  |  Link
James Freeman
Registered User
 
Join Date: Sep 2013
Posts: 919
Quote:
Originally Posted by James Freeman View Post
I realized that HEVC main10 output chroma subsampling has to be equal to the input, in raw YUV (uncompressed), so it has to be 10bit 4:2:0 uncompressed first.

If it is Lossless (compressed) I have to push it to HEVC through Avisynth with avs4x265 so only AVI is optional.
I want to export from AE in 10bit 4:2:0 4K (P010), MOV or AVI so that I can encode with HEVC.

Any idea?
Bump this.

Any idea how I can push a EXR sequence (individual file fer frame) to x265?
I tried everything in after effects but can't generate a 10bit 4:2:0 4K MOV or AVI file for x265 Main10.

Any suggestion to go from After Effects workflow to 10bit 4:2:0 4K is much appreciated.
__________________
System: i7 3770K, GTX660, Win7 64bit, Panasonic ST60, Dell U2410.

Last edited by James Freeman; 1st May 2016 at 13:15.
James Freeman is offline   Reply With Quote
Old 1st May 2016, 16:27   #3637  |  Link
James Freeman
Registered User
 
Join Date: Sep 2013
Posts: 919
Okay, Ihave managed to maintain a 10bit 4K workflow from start to finish.

First I export to PNG image sequence in 16bit (smallest file format compared to TIFF, DPX, EXR).
Next I use ffmpeg PNG image sequence to Y4M raw in yuv420p10, 16bit RGB full range PNG converted and dithered down to 10bit YUV 4:2:0 Limited range by ffmpeg with 1:1 color accuracy.
8 seconds Y4M (192 frames) = 4GB !!

Anyone knows a better way to keep a 4:2:0 10bit 4K workflow in a smaller footprint?
For test patterns it is pointless to use more than 1 fps, so the Y4M is proportionally smaller since it is uncompressed.

For anyone interested, here are my steps:
Quote:
ffmpeg.exe -framerate 24 -i "E:\Sequence\img-%%05d.png" -strict -1 -pix_fmt yuv420p10 -vf colormatrix=bt601:bt709 "E:\x265\RAW.Y4M"
Quote:
x265.exe --input-depth 10 --uhd-bd --preset slow --crf 18 --colorprim bt2020 --transfer smpte-st-2084 --colormatrix bt2020nc --master-display "G(8500,39850)B(6550,2300)R(35400,14600)WP(15635,16450)L(10000000,1)" --max-cll "0,0" --output "E:\x265\output.hevc" "E:\x265\RAW.y4m"
Quote:
mp4box.exe -add E:\X265\output.hevc -new E:\X265\output.mp4
__________________
System: i7 3770K, GTX660, Win7 64bit, Panasonic ST60, Dell U2410.

Last edited by James Freeman; 1st May 2016 at 20:15.
James Freeman is offline   Reply With Quote
Old 1st May 2016, 17:22   #3638  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,753
I guess ffmpeg could read image sequences and pipe Y4M. But no guarantees, and no idea about quirks how to manage the color depths.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 1st May 2016, 17:31   #3639  |  Link
James Freeman
Registered User
 
Join Date: Sep 2013
Posts: 919
What do you mean "no guarantee" and "quirks how to manage the color depths"?
Can you be more specific?
__________________
System: i7 3770K, GTX660, Win7 64bit, Panasonic ST60, Dell U2410.
James Freeman is offline   Reply With Quote
Old 1st May 2016, 17:37   #3640  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,753
I cannot guarantee that ffmpeg can handle 16 bit per component PNG.

If it can, I don't know which command line options are required to convert to 10 bit per component YUV 4:2:0.

But it should be worth discovering if it works, and how.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 05:47.


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