PDA

View Full Version : Encoding Still picture to x264 movie


drpaulng
23rd June 2009, 17:15
What is the optimal preset for encoding still picture of full HD size with minimal bitrate. Can anybody help?

Edit: For avoiding confusion, I need to re-state my problem -
What is the optimal preset for encoding still picture of full HD size as a video stream (with x264) with minimal bitrate. Can anybody help?

With high quality still image enocoding to moving picture, one would expect such static picture should be of low bitrate but in fact, the bitrate is unexpectedly high in order to avoid pixel and block formation.

1920x1080 still image encoded to a movie + PGS subtitles + audio for example, would serve as a slide-show. The video bitrate encoded from x264 would be about 7000-8000kbps (target bitrate is higher) or more if I want it smooth without "motion artifact". Lower effective bitrate at around 4000kbps (target bitrate is higher) would cause swelling and shrinking of pixel elements off and on with bitrate varying from 1500-5000kbps.

In short, how can I get "motionless" high quality still scene of a movie encoded from still image at low bitrate.

Adub
23rd June 2009, 21:32
png.

Why do you want to encode a still picture with a moving picture codec?

Dark Shikari
23rd June 2009, 21:39
png.

Why do you want to encode a still picture with a moving picture codec?Because H.264 is a better still-image compressor than JPEG?

Here's what I use:

--frames 1 --8x8dct --trellis 2 --subme 9 --psy-rd 1.5:0.5 --aq-strength 1.2 --deblock -2:-2

ChronoCross
23rd June 2009, 22:28
Because H.264 is a better still-image compressor than JPEG?

Here's what I use:

--frames 1 --8x8dct --trellis 2 --subme 9 --psy-rd 1.5:0.5 --aq-strength 1.2

how does one use these images encoded in h264 in a standard photo editing program or view it in windows?

Dark Shikari
23rd June 2009, 22:33
how does one use these images encoded in h264 in a standard photo editing program or view it in windows?You can view it in Flash online. Other than that, support is pretty nonexistent.

Keiyakusha
23rd June 2009, 22:41
how does one use these images encoded in h264 in a standard photo editing program or view it in windows?

Well photoshop supports mp4/h264 ^_^

ChronoCross
23rd June 2009, 22:50
You can view it in Flash online. Other than that, support is pretty nonexistent.

makes it hard to get behind it =(

benwaggoner
24th June 2009, 01:19
Silverlight 3 would support these as well. It woudln't make sense to incldue in a straight HTML web page, but once you're building an app, this can be used.

There are actually some pretty interesting applications, although you need to weigh the greater decode complexity of a big H.264 frame versus JPEG if there are a lot of images that need to be decoded at once.

Variable block size + In-loop deblocking + DQuant + CABAC are all great things in a still codec as much as in an interframe codec.

drpaulng
24th June 2009, 03:10
OK, very simple, a picture-show with music. The theme is music not picture.

With high quality still image enocoding to moving picture, one would expect such static picture should be of low bitrate but in fact, the bitrate is unexpectedly high in order to avoid pixel and block formation.

1920x1080 still image encoded to a movie + PGS subtitles + audio for example, would serve as a slide-show. The video bitrate encoded from x264 would be about 7000-8000kbps (target bitrate is higher) or more if I want it smooth without "motion artifact". Lower effective bitrate at around 4000kbps (target bitrate is higher) would cause swelling and shrinking of pixel elements off and on with bitrate varying from 1500-5000kbps.

Edit: In short, how can I get "motionless" high quality still scene of a movie encoded from still image at low bitrate.

10L23r
24th June 2009, 03:27
well for how many frames do u show each picture?

drpaulng
24th June 2009, 03:38
NTSC would be 24000/1001 or 30000/1001.
Thanks

akupenguin
24th June 2009, 04:28
In short, how can I get "motionless" high quality still scene of a movie encoded from still image at low bitrate.
Make sure every new picture is an I-frame, there are no I-frames other than those, and all P-frames have QP greater than their corresponding I-frame. These all should happen automatically if you set keyint to something larger than your maximum slide duration, and use 2pass or CRF with no VBV.
Better yet, have no P-frames at all, and use VFR with 1 frame per picture. But this part isn't very important, as P-frames with no content are tiny.

If you can't ensure no other I-frames (due to blu-ray restrictions or something), then you'll waste a bunch of bits. But the right QPs should still be sufficient to ensure a perfectly static picture.

roozhou
24th June 2009, 08:11
There are actually some pretty interesting applications, although you need to weigh the greater decode complexity of a big H.264 frame versus JPEG if there are a lot of images that need to be decoded at once.

Variable block size + In-loop deblocking + DQuant + CABAC are all great things in a still codec as much as in an interframe codec.

No, with libavcodec H264 intra frames decodes as fast as JPEGs, a bit faster than HDPhoto and a lot faster than JP2k.

A friend of mine developed a simple container to embed H264 intra frames. He also write plug-ins for several image-viewers to support these pictures.

AFAIK H264 intra frames beats any still image codecs. I found that snow intra is also good at encoding still images, though in most cases it doesn't look better than H264.

deank
24th June 2009, 16:18
drpaulng's question was related to audioBD output from multiAVCHD.

Thanks to Dark Shikari and akupenguin for their suggestions. I used some of the settings and now audio titles have a perfect still-picture-like video background.

Dean

benwaggoner
24th June 2009, 19:16
No, with libavcodec H264 intra frames decodes as fast as JPEGs, a bit faster than HDPhoto and a lot faster than JP2k.
I'd expect that's probably more a sign of a slow JPEG decoder.

CABAC + in-loop deblocking are pretty expensive features that JPEG doesn't have to do; it's hard to imagine how JPEG couldn't be quite a bit faster per pixel.

Of course, for net-delivered content, we're network bound much more often than CPU bound, so I'd imagine H.264 Hgh stills would be a lot more performant on net in many cases.

skal
29th June 2009, 19:50
you can use the HTML5 tag too: <video src="my_single_iframe.mp4">.

Leeloo Minaļ
29th June 2009, 20:34
you can use the HTML5 tag too: <video src="my_single_iframe.mp4">.

I am not sure there is any browser which has native .mp4 decoding capabilities...
Safari, maybe ? If so, it may be the only one.

Edit : or use a Flash plugin as Dark Shikari suggested.

Dark Shikari
29th June 2009, 20:37
I am not sure there is any browser which has native .mp4 decoding capabilities...
Safari, maybe ? If so, it may be the only one.Chrome.

Leeloo Minaļ
29th June 2009, 21:28
What a good surprise !
Thanks for the info, Dark.

jethro
29th June 2009, 21:50
A friend of mine developed a simple container to embed H264 intra frames. He also write plug-ins for several image-viewers to support these pictures.

.
Wow that would be very nice. I'd kill for xnview plugin ;). Any ETA for this?

roozhou
2nd July 2009, 03:49
Wow that would be very nice. I'd kill for xnview plugin ;). Any ETA for this?

Wow that would be very nice. I'd kill for xnview plugin ;). Any ETA for this?

You are lucky, it has xnview plugin.

http://www.filefront.com/13950899/UCI.7z/

ucienc, ucidec and imgdec are cmdline tools. Show help by running them w/o parameters. You also need to put x264.exe in the same folder of ucienc.

Rename ucidec.dll to Xuci.usr and move it to the XnView's plugin directory will allow XnView to read UCI images.

jethro
2nd July 2009, 14:47
You are lucky, it has xnview plugin.

http://www.filefront.com/13950899/UCI.7z/

Is it Christmas already?:)


ucienc, ucidec and imgdec are cmdline tools. Show help by running them w/o parameters. You also need to put x264.exe in the same folder of ucienc.

Rename ucidec.dll to Xuci.usr and move it to the XnView's plugin directory will allow XnView to read UCI images.

Works perfectly, even these pesky non-mod 2 images are no longer a problem:cool:. Good stuff dwing! Now... where's UDA 4? :D

One request though: Add xnview encoding plugin/filter?