Log in

View Full Version : compress png images with H.264 standar


Andreacrrll
30th May 2011, 21:15
Good day.

I have images in .png format and i want to make a compression of it thru an h.264 software, i have been looking x264 documentation and commands in CLI but i have not found any comand to do it.

Is there anyone who can help out, and maybe guide me thru this experiment.

Thanks a lot

Chikuzen
30th May 2011, 21:55
if you have "/path/to/image_0000.png", "/path/to/image_0001.png", "/path/to/image_0002.png", ...
then,
x264 --demuxer lavf --fps xxx/xxx -o "output" "/path/to/image_%04d.png"

Boogerlad
31st May 2011, 05:05
might want to tune for stillimage with --stillimage

J_Darnley
31st May 2011, 09:43
might want to tune for stillimage with --stillimage

Just to be clear. That is only for a single frame or a sequence of very different frames.

mariush
31st May 2011, 18:09
And be warned you will lose information, it's not lossless compression. PNG can store image data in RGB24 while x264 will convert to 4:2:0, resulting in less colors in the image..

Blue_MiSfit
1st June 2011, 02:45
Indeed. --qp 0 will still be lossy in this sense, right?

J_Darnley
1st June 2011, 09:42
Indeed. --qp 0 will still be lossy in this sense, right?

Yes, since x264 will still need yuv420p images. For most things besides computer user interfaces, the quality loss negligible.

Oh... Nobody's mentioned this. Use a full range rgb->yuv conversion if you can.

roozhou
1st June 2011, 09:49
Yes, since x264 will still need yuv420p images. For most things besides computer user interfaces, the quality loss negligible.

Oh... Nobody's mentioned this. Use a full range rgb->yuv conversion if you can.
Color banding is often visible after rgb->yuv. Full range yuv may reduce banding, but most players will not do the correct conversion during playback.

vivan
1st June 2011, 13:32
Yes, since x264 will still need yuv420p images.I thought in loseless mode x264 doesn't use subsampling (4:4:4 profile).

J_Darnley
1st June 2011, 13:44
I thought in loseless mode x264 doesn't use subsampling (4:4:4 profile).

No, that is just the name of the profile (high 444 predictive)