View Full Version : open png 16bit sequence
Santa
23rd January 2015, 11:15
I have to compress using x264 an image sequence of PNG 16 bpc
I'm actually not able to open it with an avs script.
How can i compress them? Is ther a particular plugin/script I should use?
Thank you
feisty2
23rd January 2015, 11:20
use ffmpeg to convert them to a large single raw rgb file
then read it with rawreader
Santa
23rd January 2015, 12:53
does it make sense?
ffmpeg -f image2 -i "J:\sintel-4k-png16\%08d.png" -start_number 1 -r 25 -vcodec rawvideo -pix_fmt rgb565 "J:\test.rgb"
also rawsource seems not being able to open 4k files (width too big)
Santa
23rd January 2015, 12:58
tried with sashimi plugin and it opens the raw file but it looks like this:
http://i60.tinypic.com/15g76t2.png
feisty2
23rd January 2015, 13:22
rgb565??
I don't think avisynth could handle something like that, shouldn't formats older than rgb24 be long gone by now?
btw....
16bpc=rgb48...not rgb565
rgb565=rgb16
feisty2
23rd January 2015, 13:27
ffmpeg -f image2 -i "%d.png" -c:v rawvideo clip.rgb
MSB=RawReader("clip.rgb", "RGB", width, height, packing="16:0:8")
LSB=RawReader("clip.rgb", "RGB", width, height, packing="16:8:8")
StackVertical (MSB,LSB)
R=showred ("y8")
G=showgreen ("y8")
B=showblue ("y8")
dither_convert_rgb_to_yuv (R,G,B,matrix="2020",output="yv24",tv_range=true,lsb=true)
assumefps (# framerate)
dither_out ()
now it's ready to be encoded
Santa
23rd January 2015, 14:07
ffmpeg -f image2 -i "%d.png" -c:v rawvideo clip.rgb
MSB=RawReader("clip.rgb", "RGB", width, height, packing="16:0:8")
LSB=RawReader("clip.rgb", "RGB", width, height, packing="16:8:8")
StackVertical (MSB,LSB)
R=showred ("y8")
G=showgreen ("y8")
B=showblue ("y8")
dither_convert_rgb_to_yuv (R,G,B,matrix="2020",output="yv24",tv_range=true,lsb=true)
assumefps (# framerate)
dither_out ()
now it's ready to be encoded
ffmpeg -f image2 -i "J:\sintel-4k-png16\%08d.png" -start_number 1 -c:v rawvideo "J:\test2.rgb"
LoadPlugin("D:\Software Video\MeGUI\tools\avisynth_plugin\\Sashimi.dll")
LoadPlugin("D:\Software Video\MeGUI\tools\avisynth_plugin\dither.dll")
LoadPlugin("D:\Software Video\MeGUI\tools\avisynth_plugin\mt_masktools-26.dll")
Import("D:\Software Video\MeGUI\tools\avisynth_plugin\dither.avsi")
MSB=RawReader("J:\test2.rgb", "RGB", 4096, 1744, packing="16:0:8")
LSB=RawReader("J:\test2.rgb", "RGB", 4096, 1744, packing="16:8:8")
StackVertical (MSB,LSB)
R=showred ("y8")
G=showgreen ("y8")
B=showblue ("y8")
dither_convert_rgb_to_yuv (R,G,B,matrix="2020",output="yv24",tv_range=true,lsb=true)
assumefps (25)
dither_out ()
http://i59.tinypic.com/2ywinpt.png
feisty2
23rd January 2015, 14:21
dither_out is for 10bit x264 encoding
remove it and the preview seems normal?
Santa
23rd January 2015, 14:38
nope:
http://i59.tinypic.com/atoemr.png
feisty2
23rd January 2015, 14:42
yeah, that should be correct, add dither_out back to your script and encode it with x264, remember to add these commands
--input-depth 16 --output-csp i444 --input-csp i444 --profile high444
Are_
23rd January 2015, 14:48
Why avisynth? do you really need to do any major editing to it?
x264 %08d.png -o out.mkv --fps 24/1
Santa
23rd January 2015, 14:57
x264-10b.exe --tune animation --crf 18 --input-depth 16 --output-csp i444 --input-csp i444 --output "J:\test.h264" "J:\test.avs"
avs [info]: 8192x1744p 0:0 @ 25/1 fps (cfr)
x264 [warning]: frame MB size (512x109) > level limit (36864)
x264 [warning]: DPB size (6 frames, 334848 mbs) > level limit (3 frames, 184320 mbs)
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
x264 [error]: malloc of size 366195488 failed
x264 [error]: x264_encoder_open failed
Santa
23rd January 2015, 14:59
also megui asks me to convert to yv12 but also adding the line to avs script doesn't work
Are_
23rd January 2015, 15:05
For such a frame size x264 allocates up to ~4.5GB of ram for me. How much available do you have?
Santa
23rd January 2015, 15:07
5200MB more or less
feisty2
23rd January 2015, 15:09
ignore whatever megui says
DO NOT add converttoyv12 at the end of the script
keep your script that way or the whole thing's gonna be messed up
Are_
23rd January 2015, 15:10
Mmh... by any chance are you using 32bit x264?
Santa
23rd January 2015, 16:12
ok with 64bit x264 and without converttoyv12 it works.
is it also possible to convert this source with 8bit x264 for comparison purposes?
how should i change the avs script? i've never used avisynth apart of what avs script creator of megui automatically create (adding just a few scripting lines like degrain etc.) so i don't really know what that avs script does...
thank you all again!!!
feisty2
23rd January 2015, 16:20
dither_out ----> ditherpost (mode=6)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.