Command:
It returns:Code:x265.exe --input "H:/Frames/S01E01-%01d.png" --input-res 2880x1920 --fps 24000/1001 --crf 20.5 --preset slow --output-depth 10 --rd 6 --ctu 32 --max-tu-size 16 --tu-intra-depth 2 --tu-inter-depth 2 --psy-rdoq 5 --no-rect --aq-mode 2 --subme 5 --merange 92 --bframes 8 --rc-lookahead 60 --lookahead-slices 2 --ref 5 --deblock -3:-3 --limit-sao --psy-rd 1.55 --no-strong-intra-smoothing -o "encoded.hevc"
Is it not supported or am I missing something?Code:x265 [error]: unable to open input file <H:/Frames/S01E01-%01d.png>
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 26 of 26
Thread
-
Last edited by PRAGMA; 15th Apr 2023 at 03:33.
-
Try "\" instead of "/" ? You have less than 10 frames to input? %01d specifies a single digit.
-
Unless your x265.exe binary has been compiled with support to read image sequences, it won't work .
Usually they are compiled to only accept Y4M or YUV input . You can check with x265 --fullhelp
Normally you'd use something else read the image sequence (e.g. ffmpeg, or avisynth, or vapoursynth) and pipe to x265 ; (or use ffmpeg libx265 directly) -
-
-
Based the same code; almost any setting from x265 can be used in ffmpeg libx265 with -x265-params . But the syntax is slightly different, and some settings are reflected in "normal" ffmpeg settings like -crf, but others must be specified in -x265-params
So if you feel more comfortable with x265 syntax, it might be easier for you to pipe ffmpeg to x265 (ie. get ffmpeg to read the image sequence to send to x265)
But you have some other issues - a PNG sequence (I'm assuming is 8bit) will be RGB, but you have not specified the output format conversion . I'm assuming it's YUV420P10 . How you want convert from RGB => YUV420P10 isn't specified, in terms of matrix, transfer, primaries.
So what do you have exactly ?
(ignoring the prefix S01E01- )
1.png
.
.
.
9.png
10.png
11.png
.
.
If that's the case, it won't work (unless you use some python scripting, maybe clique). Easier use a batch renamer like bulk rename utility to put the proper placeholder /padding digits -
Identified with image magick:
Code:S01E01-1.png PNG 2880x1920 2880x1920+0+0 8-bit sRGB 59454B 0.000u 0:00.001
And the numbers of the files are actually correct to %01d, these frame names were done via ffmpeg %01d.
But yeah I can pad them if needed, not hard.
But how would I pipe the frames then? :/Last edited by PRAGMA; 15th Apr 2023 at 03:25.
-
Actually I was wrong - you don't need to pad them. A quick test looks like it will read it ok with ffmpeg
Regular HD BD will be YUV using Rec 709 . But 2880x1920 is non standard resolution . UHD would typically use Rec 2020 -
This isnt for use on a BluRay, but I wish to typically use BluRay standards in some areas like that.
Resolution I will be changing to 1620x1080 using -vf scale though.
And great that I dont need to mess with padding
So to pipe, would I just need to do:
Code:ffmpeg <all my shit> | x265.exe --input - --frames all bla bla
-
Yes , it would look like this , you can add w=:h= to -vf scale in ffmpeg (it's already used to convert RGB to YUV using 709 below) . But then you have to adjust the x265 part to reflect the changes
In theory, Y4M is supposed to communicate everything, dimensions, fps, colorspace, framecount, etc.. but it doesn't always - so more often than not I find you have to specify them on the x265 end as well
Code:ffmpeg -r 24000/1001 -i "S01E01-%01d.png" -vf scale=out_color_matrix=bt709:flags=bicubic+accurate_rnd+full_chroma_int+full_chroma_inp,format=yuv420p10 -strict -1 -f yuv4mpegpipe - | "x265" --input - --y4m --input-depth 10 --input-csp 1 --input-res 2880x1920 --fps 24000/1001 --crf 20.5 --preset slow --output-depth 10 --rd 6 --ctu 32 --max-tu-size 16 --tu-intra-depth 2 --tu-inter-depth 2 --psy-rdoq 5 --no-rect --aq-mode 2 --subme 5 --merange 92 --bframes 8 --rc-lookahead 60 --lookahead-slices 2 --ref 5 --deblock -3:-3 --limit-sao --psy-rd 1.55 --no-strong-intra-smoothing --colorprim bt709 --transfer bt709 --colormatrix bt709 --sar 1:1 -o "encoded.hevc"
(also added colormatrix flags, sar flags - but those are not necessary for it to work, just for completeness) -
Ok this is what I resulted with:
Code:"bin/ffmpeg.exe" -r 24000/1001 -i "H:/1; ESRGAN/[] OUTPUT/S01E01-%%01d.png" -vf scale=1620:-2,out_color_matrix=bt709:flags=bicubic+accurate_rnd+full_chroma_int+full_chroma_inp,format=yuv420p10 -strict -1 -f yuv4mpegpipe - | "bin/x265.exe" --input - --y4m --input-depth 10 --input-csp 1 --input-res 1620x1080 --fps 24000/1001 --crf 20.5 --preset slow --output-depth 10 --rd 6 --ctu 32 --max-tu-size 16 --tu-intra-depth 2 --tu-inter-depth 2 --psy-rdoq 5 --no-rect --aq-mode 2 --subme 5 --merange 92 --bframes 8 --rc-lookahead 60 --lookahead-slices 2 --ref 5 --deblock -3:-3 --limit-sao --psy-rd 1.55 --no-strong-intra-smoothing --colorprim bt709 --transfer bt709 --colormatrix bt709 --sar 1:1 -o "encoded.hevc"
Code:[AVFilterGraph @ 000002a1a031ac40] No such filter: 'out_color_matrix' Error reinitializing filters! Failed to inject frame into filter network: Invalid argument Error while processing the decoded data for stream #0:0
-
Oh I realized its meant to be like:
Code:-vf scale=w=1620:h=-2:out_color_matrix=bt709:
-
Yes, out_color_matrix is a -vf scale argument
And Y4M does work here for conveying the input info from ffmpeg (except frame count) . But it might depend on the specific ffmpeg or x265 binary(I've had it not work before in the past, and you had to specify those input options)
But I found you did NOT need to specify input options (depth, colorspace, resolution, fps) , as they were conveyed by the --y4m pipe correctly
ie you can omit these
--input-depth 10 --input-csp 1 --input-res 2880x1920 --fps 24000/1001 -
Last edited by PRAGMA; 15th Apr 2023 at 03:27.
-
Sweet this does seem to not need those entries, but yeah I get what you mean where it sometimes may not be able to inherit.
Anyway, dont I need to set SAR and DAR to 3:2? DAR isnt set at all here, maybe its calculated against the w/h? (1.5)? -
It's in the --fullhelp
Code:--input-csp <string> Chroma subsampling, auto-detected if Y4M 0 - i400 (4:0:0 monochrome) 1 - i420 (4:2:0 default) 2 - i422 (4:2:2) 3 - i444 (4:4:4)
If you wanted something different , change it -
-
Oh sweet command, also Im not sure which color profile I even want, All im aware is that the source (dvd) is the usual yuv420p8, (BT.601 NTSC), but after my editing, it results in the format I showed you earlier (rgb p8?). With this color convert, if I select one I shouldn't, how would I know? Like how would I know which to choose? (Also the program am using to end up with an edited image cannot result in a non rgb image, it isnt changeable due to how it works)
Last edited by PRAGMA; 15th Apr 2023 at 03:28.
-
Everything for consumer distribution is 4:2:0 . UHD BD is even 4:2:0, but 10bit . That's what I recommend you use 10bit 4:2:0 . 10bit is becoming more and more common (it's quite common for HEVC), and your commandline in the 1st post used 10bit
Other subsampling (4:2:2, 4:4:4) might not be as widely supported by decoders, hardware chips , consumer TV's etc.. So it's also dependent on what the audience is or how it's going to be played
If you need wide audience compatibility , right now - you should use 8bit 4:2:0 AVC, not HEVC
If it's just for personal use, full color 4:4:4 would be better, especially for animation, but compression is worse (larger filesizes) -
-
I added some more comments above on compatibility and format decisions above ^
First, I would get the processing correct. That's the most important. IIRC American Dad DVD has many problems (or maybe it was only certain seasons, or certain studio releases ? )
If it's a dvd source, then 4:2:0 is fine, 10bit will help with compression efficiency and banding issues . So that's a good choice if there were not target compatibility issues
Personally , I probably wouldn't upscale it
I don't deal much with simple cartoons like that - so I cannot comment too much on what is "ideal" in terms of encoding settings -
Yes so, what im even doing here is I trained a GAN network model against the DVDs and HD copies of American Dad, once it was trained to a high degree (took me weeks), I ran it on frames of S01E01, and the result was INSANE.
[Attachment 49506 - Click to enlarge]
So im trying to efficiently encode these resulting files into x265
The model trains in a x4 configuration (i can do x2 instead, but its less efficient), so with the resulting 2880x1920, I simply downscale it to 1620x1080 (3:2 ratio here as it seems it was animated in 3:2, it looks way better in 3:2 than 4:3, looks more like the latest seasons.)
So yeah, its going very well so far -
Which GAN, or a custom one ?
What was the hardware setup to train that took weeks ?
Can post some comparison frames? -
I trained ESRGAN (using SRRDB Net), and I used BasicSR to do so.
My setup is a GTX 1080ti running off of CUDA 10.
It took weeks because I left it training for a long time on purpose to be more efficient.
And sure,
[Attachment 49507 - Click to enlarge]
[Attachment 49508 - Click to enlarge]
[Attachment 49510 - Click to enlarge]
[Attachment 49509 - Click to enlarge]Last edited by PRAGMA; 15th Apr 2023 at 03:30.
Similar Threads
-
[HEVC] x265.EXE: mingw builds
By El Heggunte in forum Video ConversionReplies: 2221Last Post: 9th Feb 2021, 01:18 -
X265 encodes 0 frames
By smike in forum Video ConversionReplies: 4Last Post: 12th Mar 2018, 02:16 -
4K UHD x265 Editing using AviSynth (Grey Frames)
By TheLastOfThem in forum EditingReplies: 2Last Post: 22nd Jan 2018, 18:08 -
how to use x265.exe?
By flashandpan007 in forum Newbie / General discussionsReplies: 4Last Post: 17th Apr 2016, 12:54 -
Is x265 ready for Primetime.. Migrating From x264 to x265..
By RazorBurn in forum Video ConversionReplies: 83Last Post: 31st Jan 2016, 07:14