On 08/12/2010 08:40, Andrew Rowley wrote:
Hi,

I have found that in general it is best for most encoders if the frame sizes 
are divisible by 16 (i.e. each of the width and height are divisible by 16).  
If necessary, you can frame your video with a border or else use swscale to 
resize.  You may get away with divisible by 8 in some cases, but 16 works with 
most codecs.

Andrew :)

---------------------------------------------------------

    Andrew G D Rowley
    Senior Development Officer

    Research Computing Services
    The University of Manchester
    Devonshire House, Oxford Road
    Manchester, M13 9PL

    t :  +44 (0) 161 275 0685
    e :  [email protected]
    w :  www.manchester.ac.uk/researchcomputing

---------------------------------------------------------


-----Original Message-----
From: [email protected] [mailto:libav-user-
[email protected]] On Behalf Of Mark Kenna
Sent: 07 December 2010 16:38
To: Libav* user questions and discussions
Subject: [libav-user] H264 Encoding Width/Height

Hi Guys

Can someone tell me if there are certain frame sizes that H264 encoding
will just completely fail on? Here is my scenario:

I'm capturing a snapshot of a windows form (w=142, h=116) and saving it
as a JPEG, this then gets passed to my encoder which is encoding to
H264
format, this size does not work at all. When I run this again and
resize
the JPEG to (w=640, h=480) it works perfectly.

If there are only certain sizes that you can use for encoding I will
have to make a check to resize if needed, I just don't know what they
are.

Thanks guys,
Mark

_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user
Hi Andrew

Thanks for the input - I have been checking that it's divisible by 4 and resizing otherwise. I will modify it to check for 16 instead.

Incidentally I figured this out because the encoding always seemed to fail when (width/2) or (height/2) resulted in an odd number.

Mark.

_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to