>This is my first post in this list so hi !

Howdy!

 >Hope you could help in this as i am a begginner in the video world.
 >What i am trying to achieve is to take a video stream, extract couple of
 >frames, modify them (add another picture on top) and put them back in to
 >the video stream.
 >
 >This is what i do :
 >
 >(lav2yuv -f 1 myMovie.mov | y4mtoppm | <composite command>| ppmtoy4m -F
 >25:1 | strip.sh;... ;lav2yuv -f 2 myMovie.mov | y4mtoppm | <composite
 >command>| ppmtoy4m -F 25:1 | strip.sh;) | ffmpeg -f yuv4mpeg pipe -i -
 >-sameq -b 8500 res.mov
 >
 >Note: the strip.sh remove Y4M unwanted headers

(Does 'strip.sh' need to be applied to all stream chunks, or just all
 except for the first?  I don't know what ffmpeg is expecting....)

 >Everythings work not too bad except i can notice a luminance difference
 >between frame i had extracted and the rest of the video stream. It is
 >like a white transparent shadow (it s more visible from Quicktime Player
 >though ...)
 ...
 >So i concluded y4mtoppm or ppmtoy4m is the culprit (or both) . I know
 >the subsampling and colorspace operations is lossy so i guess the shadow
 >comes from this loss. ...
 
Hmm... I have a suggestion for something which could help diagnosing
 the problem.  Could you extract one (problematic) frame from your
 original source, and then pass it through "y4mtoppm | ppmtoy4m" to
 get a modified frame, and then mail both the original and modified
 to me (as the plain, raw, short YUV4MPEG2 streams)?

What I plan to do (and you could do this, too) is to run each through
 the new "flatten" mode of y4mtopnm ("y4mtopnm -f"), and then open
 the resulting PGM's in gimp and see what actually happened to each
 channel.  

Even though it is lossy, I wouldn't have expected a noticeable difference
 in one "y4mtoppm | ppmtoy4m" cycle, so it could be a bug.  (Or, it could
 be that your original stream/frame has a lot of pixels with Y'<16, which
 are getting clipped -- which would brighten them.)

 >Alternatively i though i could use YUV data instead of PPM (so i could
 >work directly with yuv without subsampling) , i tried to extract one yuv
 >single frame but imageMagick only displays crap. ...:

You could try using "lavpipe" with "matteblend.flt"; I'm not sure if anyone
 has used these in years, though.  This would do all the work with YUV4MPEG2
 streams (if simple alpha-compositing is all you need).

-matt m.


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users

Reply via email to