View Full Version : Creating a video file from a series of images, using H.264
jp2k
13th January 2012, 17:28
Hi everyone,
I have a series of gray level images with 16 bits depth and I would like to save it as a video file using h.264.
Would it be possible to help me how I can do it.
Thank you in advance.
sneaker_ger
13th January 2012, 17:43
What format?
Does that help: http://forum.doom9.org/showthread.php?t=157940 ?
jp2k
13th January 2012, 21:07
The images are saved as PNG, 512*512 and 16 bit gray scale and the output should be a lossless video file using H.264.
Juce
14th January 2012, 11:39
H.264 does not support 16 bit depth. x264 supports only 8, 9 or 10 bit depth.
jp2k
16th January 2012, 12:11
Is there any other suggestion how I can do it ( to convert 16 bit grayscale images to AVI using H.264) .
Many Thx
sneaker_ger
16th January 2012, 14:16
Why don't you use the one I posted?
pandy
16th January 2012, 14:59
why H.264? maybe MNG can help solve Your problem? (Imagemagick + 16bit grayscale PNG as MNG)
or try:
http://avisynth.org/mediawiki/High_bit-depth_Support_with_Avisynth
or try to use 8 bit with oversampling+dithering to store more than 8 bit data (at a cost resolution - increased size) in 8 bit.
jp2k
16th January 2012, 18:30
Why don't you use the one I posted?
Thank you for your response,I have checked your link but I could not find anything about 16 bit depth support in h.264( I used the VitualDub to convert 8bit grayscale images to avi and it's work, but it 's not work for 16bit grayscale.)
Would it be possible to explain in detail. Thx a lot.
sneaker_ger
16th January 2012, 18:37
As Juce has already pointed out, H.264 does not support 16 bit. That does not mean that the x264cli encoder cannot convert the images to a supported format.
Try the following command line:
x264.exe "input_%03d.png" -o output.h264
The "%03d" is a wildcard for the filenames, it means three digit (%03d) with leading zeros ((%03d), i.e. from "input_000.png" to "input_999.png".
You can later mux the raw .h264 to anything you want (AVI is highly disrecommended for H.264, though, unless you have a very specific reason to do so).
If you need 100% lossless (except for the initial bitdepth and subsampling loss), you add "--qp 0" to the x264 command line.
/edit:
resize [warning]: converting from gray16be to yuv420p
resize [warning]: converting from yuv420p to rgb24
x264cli can't seem to do it without subsampling. Don't know if you need to keep full chroma resolution.
jp2k
16th January 2012, 18:56
why H.264? maybe MNG can help solve Your problem? (Imagemagick + 16bit grayscale PNG as MNG)
As a part of my project , I have to compare a method with H.264 (16 bit grayscale+lossless)
or try:
http://avisynth.org/mediawiki/High_bit-depth_Support_with_Avisynth
I checked the link but I think it only support up to 10 bits depth.
or try to use 8 bit with oversampling+dithering to store more than 8 bit data (at a cost resolution - increased size) in 8 bit.
Would it be possible to explain more about it.
Many Thanks.
J_Darnley
16th January 2012, 23:05
/edit:
resize [warning]: converting from gray16be to yuv420p
resize [warning]: converting from yuv420p to rgb24
x264cli can't seem to do it without subsampling. Don't know if you need to keep full chroma resolution.
Grey-scale images don't have any chroma to subsample!
sneaker_ger
16th January 2012, 23:24
That's embarrassing. :o
pandy
17th January 2012, 17:15
As a part of my project , I have to compare a method with H.264 (16 bit grayscale+lossless)
Seems that on market such h.264 encoder (16 bit dept per component sample) not exist.
I checked the link but I think it only support up to 10 bits depth.
Tricks are available to support higher than 8 bit per component sample - they should work up to 16 bit.
Would it be possible to explain more about it
http://en.wikipedia.org/wiki/Dither
http://en.wikipedia.org/wiki/Sigma-delta_modulation
http://en.wikipedia.org/wiki/Oversampling
pandy
17th January 2012, 17:18
Grey-scale images don't have any chroma to subsample!
they can have chroma with null ("0") ie only luma values but chroma planes present.
Juce
17th January 2012, 20:20
For some reason, this seems an infrared homing missile. :)
The images are saved as PNG, 512*512 and 16 bit gray scaleIs the real accuracy 16 bits per sample? I mean that if the original source is just 10 bit per sample then it may be scaled to 16 bit only because PNG does not support 10 bit depth. In this case, the image can be losslessly converted back to the 10 bit.
Try the following command line:
x264.exe "input_%03d.png" -o output.h264That did not work properly with 16 bit depth RGB PNGs. More in this thread: http://forum.doom9.org/showthread.php?p=1552245#post1552245 But this is not a big problem.
jp2k
17th January 2012, 21:22
For some reason, this seems an infrared homing missile. :)
Is the real accuracy 16 bits per sample? I mean that if the original source is just 10 bit per sample then it may be scaled to 16 bit only because PNG does not support 10 bit depth. In this case, the image can be losslessly converted back to the 10 bit.
That did not work properly with 16 bit depth RGB PNGs. More in this thread: http://forum.doom9.org/showthread.php?p=1552245#post1552245 But this is not a big problem.
The original sources are 12 bit per sample(grayscale) and they are scaled to 16 bit and they are saved as PNG and lossless jpeg.
jp2k
17th January 2012, 21:54
As Juce has already pointed out, H.264 does not support 16 bit. That does not mean that the x264cli encoder cannot convert the images to a supported format.
Try the following command line:
x264.exe "input_%03d.png" -o output.h264
The "%03d" is a wildcard for the filenames, it means three digit (%03d) with leading zeros ((%03d), i.e. from "input_000.png" to "input_999.png".
You can later mux the raw .h264 to anything you want (AVI is highly disrecommended for H.264, though, unless you have a very specific reason to do so).
If you need 100% lossless (except for the initial bitdepth and subsampling loss), you add "--qp 0" to the x264 command line.
/edit:
resize [warning]: converting from gray16be to yuv420p
resize [warning]: converting from yuv420p to rgb24
x264cli can't seem to do it without subsampling. Don't know if you need to keep full chroma resolution.
Would it be possible to let me know how I can decode the output.h264 to image sequences. Thx
J_Darnley
17th January 2012, 22:03
Use %d, just like for input: ffmpeg -i INPUT output_%d.png
Juce
18th January 2012, 21:25
Try the following command line:
x264.exe "input_%03d.png" -o output.h264
This might be better in this case: x264.exe "input_%03d.png" -o output.h264 -q 0 --input-range pc --range pc
The original sources are 12 bit per sample(grayscale) and they are scaled to 16 bit and they are saved as PNG and lossless jpeg.Wikipedia says that IPP supports 12 bit depth.
http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Software_encoder_feature_comparison
Use %d, just like for input: ffmpeg -i INPUT output_%d.pngThat makes 8 bit depth PNGs.
jp2k
19th January 2012, 01:07
This might be better in this case: x264.exe "input_%03d.png" -o output.h264 -q 0 --input-range pc --range pc
Wikipedia says that IPP supports 12 bit depth.
http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Software_encoder_feature_comparison
That makes 8 bit depth PNGs.
Would it be possible to let me know how I can create 12 or 16 bit depth PNGs or other formats.Thx
pandy
19th January 2012, 17:15
Would it be possible to let me know how I can create 12 or 16 bit depth PNGs or other formats.Thx
http://www.imagemagick.org/Usage/formats/#png_write
Juce
19th January 2012, 18:04
Would it be possible to let me know how I can create 12 or 16 bit depth PNGs or other formats.Thx
ffmpeg -i video -pix_fmt gray16be frame%05d.png
This feature was recently added to FFMPEG, so it may need updating.
jp2k
21st January 2012, 19:06
I have tried to convert just a 16 bit grayscale PNG to h264
and decompress the h264 to original file with following instructions.Unfortunately the original file, test.png and output file,test1.png is not the same.
Would it be possible to let me know what 's wrong in following instructions. Thank you.
x264.exe test.png -o output.h264 --qp 0
ffmpeg.exe -i output.h264 -pix-fmt gray16be test1.png
nm
21st January 2012, 19:59
I have tried to convert just a 16 bit grayscale PNG to h264
[...]
x264.exe test.png -o output.h264 --qp 0
As said earlier in this thread, the maximum bit depth that x264 supports is 10 bits, and you need a special 10 bit x264 build for that.
Full 16 bit accuracy is not achievable with H.264. 14 bits is the maximum in Hi444PP profile. Juce pointed out that the H.264 encoder in Intel Integrated Performance Primitives may support 12 bit encoding, so that's one option to try.
jp2k
24th January 2012, 19:05
As said earlier in this thread, the maximum bit depth that x264 supports is 10 bits, and you need a special 10 bit x264 build for that.
Full 16 bit accuracy is not achievable with H.264. 14 bits is the maximum in Hi444PP profile. Juce pointed out that the H.264 encoder in Intel Integrated Performance Primitives may support 12 bit encoding, so that's one option to try.
Our images are 12 bit per sample (gray level) and scale up to 16 bits. Would it be possible to let me know how I can use the profile,Hi444PP, to fix my problem.
Please let me know if you have any experience for using the intel integrated performance primitives, ia32_cl10.exe, to convert a sequence of gray level images to h.264 without any loss of information. Thank you in advance.
jp2k
26th January 2012, 15:05
Any further help would be greatly appreciated to fix my problem. Thank you in advance.
SeeMoreDigital
26th January 2012, 16:12
Is there any other suggestion how I can do it ( to convert 16 bit grayscale images to AVI using H.264) .
Many Thx
Provided you have the (latest) VfW version of x264 installed, it's possible to import images into VirtualDub 1.9.11 or 1.10.0 and generate .AVI contained encodes...
jp2k
29th January 2012, 15:06
Dear All,
Does anyone knows, the configuration setting for converting the 14 bit gray level images to H.264 using JM.
Any help would be appreciated.:thanks:
poisondeathray
29th January 2012, 15:39
Even if you could encode at 14bit, there aren't any decoders (maybe JM?) that will support it. Or do you not care about viewing it (just storing it) ?
jp2k
29th January 2012, 18:44
Even if you could encode at 14bit, there aren't any decoders (maybe JM?) that will support it. Or do you not care about viewing it (just storing it) ?
What 's your suggestion?
poisondeathray
29th January 2012, 18:53
Maybe you can provide more background information on your goal? What purpose is this for ? Why not leave it as an image sequence ?
SeeMoreDigital
29th January 2012, 20:41
How about "zipping-up" and up-loading a few of your source images for us to look at?
jp2k
30th January 2012, 00:51
Maybe you can provide more background information on your goal? What purpose is this for ? Why not leave it as an image sequence ?
As a part of my project , I have to convert my images sequences to a AVI file using H.264 (The images are 12-14 bit grayscale and scale up to 16 bit and lossless method should be used).
nm
30th January 2012, 01:01
As a part of my project , I have to convert my images sequences to a AVI file using H.264
But what is the purpose of having such file? Why H.264?
jp2k
30th January 2012, 11:20
But what is the purpose of having such file? Why H.264?
I would like to compare a method with H.264 So I have to apply the H.264 method on my images sequences for calculating of some image quality metrics parameters.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.