On Sat, 2004-11-06 at 16:47, Steven M. Schultz wrote:
> On 6 Nov 2004, scott wrote:
> 
> > I doing this little mod to y4mshift to try and correct some vertical
> > shaking in recording from a VCR and I have got to the point where I now
> 
>       You may want to look at 'y4mstabilizer' (in the CVS version of
>       mjpegtools) - perhaps it will do some of what you want.
> 

That's interesting, I'm going to put some of my code in there instead of
y4mshift.  I want a specific vertical shift (im my case 0 or -1 or -2
depending on the frame) (never any horizontal) so I'm going to put in my
dumb calculation to get the vertical shift which might work
better/faster than the algorithm that is already there.  I fear that if
I have several frames in succession which have dropped the currently
algorithm will tend to let them creep downwards, which I don't want.

> > I think I understand that 4:2:0 has (for each square of 4 pixels) 4 Y
> > values, 1 U, and 1 V value.  But what happens in the uchar **yuv arrays
> > for interlaced material.  I presume that the first row of U/V values
> 
>       4:2:0 is, as you noticed, subsampled in BOTH the horizontal _and_
>       vertical dimensions.
> 
> > Is that correct and if so are there any algorithms in the library to
> > handle shifting by numbers that are not a factor of 4?
> 
>       Not if you're doing the processing in 4:2:0 - two fields x the vertical
>       subsampling factor of 2 = 4.
> 
>       What you can do is supersample the data up to 4:2:2 or even 4:4:4,
>       perform whatever manipulations you want, and then subsample back to
>       4:2:0
> 
That makes sense.
>       y4mscaler can do that for you with the option "-O chromass=422" or 
>       "-O chromass=444".  Then to convert back to 420 before going into
>       the encoder you'd use "-O chromass=420_mpeg2"
> 
That sounds easy :-)
>       The other thing which may make life simpler is to deinterlace the
>       material with 'yuvdeinterlace'.  Deinterlaced supersampled (to 4:4:4)
>       data may be the simplest/easiest form to work with for stabilization
>       purposes.
> 
Yes, it would be easier except that every 5 frames or so the field order
is incorrect and needs to be swapped.  I'll have a look at y4mscaler -S
mode=LINESWITCH so see if I can make it only line switch on a function I
have.
>       Cheers,
>       Steven Schultz
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Sybase ASE Linux Express Edition - download now for FREE
> LinuxWorld Reader's Choice Award Winner for best database on Linux.
> http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
> _______________________________________________
> Mjpeg-users mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/mjpeg-users



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Mjpeg-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mjpeg-users

Reply via email to