[libav-api] YUV Frame Splicing

Luca Barbato lu_zero at gentoo.org
Fri Dec 9 18:04:10 CET 2011


On 09/12/11 16:41, Mark Kenna wrote:
> On 09/12/2011 14:26, Luca Barbato wrote:
>> On 09/12/11 13:33, Mark Kenna wrote:
>>> Hi Guys
>>>
>>> I'm encoding YUV420p frames to H264 at a fixed size of say 640x480.
>>>
>>> Say I had another frame of YUV420p which was only 160x120, is there any
>>> way that I would be able to copy this frame into the 640x480 and
>>> essentially produce a 4x4 tiled output? I think I would have to loop
>>> over the first two frames, join them line by line, do the same for the
>>> last two images and then splice it together?
>>>
>>> Does that sound about right?
>>
>> Sounds proper, if you have some cycles to throw over it, you might use
>> avfilter.
>>
>> lu
>>
> I will always have a fixed output resolution. I will be receiving
> segments of a 2x2 tiled view which I will need to splice into the main
> AVFrame which will be encoded and transmitted.
>
> If AVFilter can do that simply I would love to know more! :)

the overlay filter should let you place them in a quite inefficient way 
but sort of easy to grasp.

Still the best is doing the pointer math and memcopy accordingly =)

lu

-- 

Luca Barbato
Gentoo/linux
http://dev.gentoo.org/~lu_zero



More information about the libav-api mailing list