Currently using -rawvideo on:w=720:h=480:format=nv12 to watch Hauppauge nv12 video results in a picture which has blue and red swapped. The code currently swaps the destination planes if "swapped" is set which is confusing since DOCS/tech/colorspaces.txt says: Note: planes[1] is ALWAYS U, and planes[2] is V Also "swapped" is currently set if the format is nv12 which is confusing since nv12 stores the U and V in the same order as hm12 which doesn't swap the bytes. This patch simply swaps the source (instead of the destination) if "swapped" is set and only sets "swapped" if the format is nv21. MPlayer plays the video fine after this patch is applied. -- John Wehle ------------------8<------------------------8<------------------------ --- libmpcodecs/vd_hmblck.c.ORIGINAL Sun Aug 31 16:58:25 2003 +++ libmpcodecs/vd_hmblck.c Fri Dec 26 01:43:02 2003 @@ -64,8 +64,8 @@ unsigned int UV_size = mpi->chroma_width * mpi->chroma_height; unsigned int idx; unsigned char *dst_Y = mpi->planes[0]; - unsigned char *dst_U = swapped?mpi->planes[2]:mpi->planes[1]; - unsigned char *dst_V = swapped?mpi->planes[1]:mpi->planes[2]; + unsigned char *dst_U = mpi->planes[1]; + unsigned char *dst_V = mpi->planes[2]; unsigned char *src = data + Y_size; // sanity check raw stream @@ -90,8 +90,8 @@ // chroma data is interlaced UVUV... so deinterlace it for(idx=0; idxplanes[0],data,mpi->stride[0],mpi->w,mpi->h); de_macro_uv(mpi->planes[1],mpi->planes[2],data+mpi->w*mpi->h,mpi->stride[1],mpi->w/2,mpi->h/2); } else { - if(!nv12_to_yv12(data, len, mpi,(sh->format == IMGFMT_NV12))) return NULL; + if(!nv12_to_yv12(data, len, mpi,(sh->format == IMGFMT_NV21))) return NULL; } return mpi; ------------------------------------------------------------------------- | Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com | | John Wehle | Fax: 1-215-540-5495 | | -------------------------------------------------------------------------