On Mon, 2007-08-13 at 18:15 -0600, James G. Flewelling, Cobras2 wrote:
> Yay! I got it working.
> It is strange, though... if I do this in the filter's frame routine:
>
> //vY = ptr->video_buf_Y
> //vU = ptr->video_buf_U
> //vV = ptr->video_buf_V
> for(y=0; y<256; y++) {
> for(x=0; x<256; x++) {
> vY[0][y*w + x] = 128;
> vY[1][y*w + x] = 128;
> if(y%2==0 && x%2==0) {
> vU[0][(y*w)/4 + x/2] = x;
> vU[1][(y*w)/4 + x/2] = x;
> vV[0][(y*w)/4 + x/2] = y;
> vV[1][(y*w)/4 + x/2] = y;
> }
> }
> }
>
> (i.e. to print out a square that has the whole colour space in it, at
> Y=128 (middle of the range), basically it's a graph with the x axis
> being U, and y axis being V), the result looks like the UV colour plane
> shown at wikipedia:
> http://en.wikipedia.org/wiki/YUV
> (at the top of the page, on the right) EXCEPT for one big difference;
> the colour plane I generated is rotated 90 degrees clockwise.
> In other words, it looks to me like ***the U and V components are
> swapped***.
This looks the old YV12/I420 confusion... Quoting the wikipedia page
above:
***
The YV12 format is essentially the same as YUV420p, but it has the U and
V data reversed: the Y values are followed by the V values, with the U
values last. As long as care is taken to extract U and V values from the
proper locations, both YUV420p and YV12 can be processed using the same
algorithm.
***
transcode 1.0.x handles internally YV12 (...mostly), while transcode
1.1.x and beyond is I420. (being I420 == YUV420)
> So now the only question is, is anyone else interested in a version of
> the extsub filter which takes as three of its arguments the R, G, and B
> values you want the subtitle to be rendered in? :-)
just post the patch :)
(that reminds me about nextsub filter posted here some time ago. No,
I've not forgot it).
> It's not what I'd call "fully tested" or "fully featured" yet, but it
> works for me, so I figured it might be useful for others. If the already
> existing extsub filter has colour control (i.e. so you can select what
> colour the final subtitle will be), then ignore this, but I couldn't
> figure out for the life of me how to use extsub's colour selection (if
> it has any.. and I didn't see much in the code to indicate that it does,
> either), so I coded my own version.
>
> Basically, with my version, you can now do this:
>
> -J extsub=0:0:0:1:0:255:255:255:4:0
>
> The first 5 arguments are as they were before, but now the 6th, 7th,
[...]
We have definitively too much number instead, looks like it's time
for a refactoring! :)
something like
-J extsub=0:0:0:1:0:color=255,255,255:style=4:bright=0
[...]
> If anyone is interested, let me know, and let me know where to send the
> filter_extsub.c file so you can take a look at it!
diffs (as attahments) against lastest revision are always preferred :)
Bests,
--
Francesco Romani // Ikitt
[ Out of memory. ~ We wish to hold the whole sky, ~ But we never will. ]