How to preserve frame size with h264enc?
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.
pls use "-dw 0 320 -dh 0 200", if you are encoding one spatial layer. check "-dw/-dh" command options.
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.
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.