openh264 icon indicating copy to clipboard operation
openh264 copied to clipboard

How to preserve frame size with h264enc?

Open amtri opened this issue 11 years ago • 3 comments

I have a yuv file with custom dimensions 320 x 200 with 29 frames. I do specify -sw 320 -sh 200 when using the encoder. However, the final image is never the right size, no matter what I try.

How do I invoke h264enc to preserve the image size?

Thanks.

amtri avatar Aug 26 '15 17:08 amtri

pls use "-dw 0 320 -dh 0 200", if you are encoding one spatial layer. check "-dw/-dh" command options.

sijchen avatar Aug 27 '15 05:08 sijchen

sijchen,

Thanks for the reply. But this is what I get:

h264enc.exe -bf earth.h264 -org earth.yuv -sw 320 -sh 200 Width: 1280 Height: 720 Frames: 19 encode time: 0.468013 sec FPS: 40.597163 fps

h264enc.exe -bf earth.h264 -org earth.yuv -sw 320 -sh 200 -dw 0 320 -dh 0 200

Wels SVC Encoder Usage: ... [OpenH264] this = 0x00000000000B0890, Error:ParamValidation,Invalid resolution layer(1) resolution(320 x 208) should be less than the upper spatial layer resolution(320 x 192) [OpenH264] this = 0x00000000000B0890, Error:WelsInitEncoderExt(), ParamValidationExt failed return 2. [OpenH264] this = 0x00000000000B0890, Error:CWelsH264SVCEncoder::Initialize(), WelsInitEncoderExt failed. SVC encoder Initialize failed

What am I missing?

Thanks.

amtri avatar Aug 27 '15 14:08 amtri

sijchen,

I figured it out: I had to add -numl 1. The resulting image is still not correct, but at least the size is. I'll take it from here for now and see if I can figure this out.

Thanks.

amtri avatar Aug 27 '15 15:08 amtri