[FFmpeg-devel] [PATCH] Fix linesize computation for NV formats

Ramiro Polla ramiro.polla
Fri Nov 20 17:16:44 CET 2009

On Fri, Nov 20, 2009 at 9:56 AM, Ramiro Polla <ramiro.polla at gmail.com> wrote:
> On Thu, Nov 19, 2009 at 10:54 PM, Ramiro Polla <ramiro.polla at gmail.com> wrote:
>> On Thu, Nov 19, 2009 at 10:38 PM, Stefano Sabatini
>> <stefano.sabatini-lala at poste.it> wrote:
>>> On date Thursday 2009-11-19 17:51:30 +0100, Michael Niedermayer encoded:
>>>> On Thu, Nov 19, 2009 at 01:37:03AM +0100, Stefano Sabatini wrote:
>>> [...]
>>>> > So basically all the code affected by the change is indeed code which
>>>> > is never used, my patch simply makes the linesize params semantics for
>>>> > NV formats consistent with that of all the other formats (thus
>>>> > simplifying the code if we choose to use pixdesc for ff_fill_XXX).
>>>> if no code uses NV12 it should be removed (i dont belive this though)
>>>> if any code uses NV12 your patch will break it.
>>> ffmpeg doesn't support NV12 as input, but can convert to NV12 /
>>> NV21. So we can create a stream with pix_fmt nv12 but there is no mean
>>> to visually test it (e.g. with ffplay) or convert it back to a stream
>>> which is playable by ffmpeg, but maybe someone can suggest some way to
>>> display such a format e.g. with mplayer or vlc.
>>> Also I wonder how hard would be to add it as an input format in lsws.
>> I have a device with a hardware decoder to nv12 that also displays in
>> nv12 at work. I might take a look tomorrow if I manage to find some
>> time...
> One more change was needed to get raw nv12 output properly. With
> attached patch I can
> ./ffmpeg_g -i input.avi -s 1280x720 -pix_fmt nv12 -f rawvideo -y output.nv12
> and then feed output.nv12 to the display frame by frame.
> I haven't worked on nv12 support as input to swscale yet. I'll do it
> either this afternoon or in two weeks =)

And here is a patch to take nv12 and nv21 as input for swscale
(depends on the previous patch).

Ramiro Polla
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nv12in.diff
Type: text/x-diff
Size: 2092 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091120/1f4b14f7/attachment.diff>

More information about the ffmpeg-devel mailing list