I want to code a pipeline to overlay an image on a video.
First I would like to understand how to implement this one and then to code it. So I attemped with this: gst-launch filesrc location=/home/boss/test/video.mpg ! decodebin2 ! videomixer name=mix ! xvimagesink filesrc location = /home/boss/test/image.png ! pngdec ! ffmpegcolorspace ! mix but I got: "pipeline wrong. No element called mix" Suggestions? Thanks in advance K |
On Thu, 2012-03-01 at 11:40 -0800, kususe wrote:
> I want to code a pipeline to overlay an image on a video. > First I would like to understand how to implement this one and then to code > it. > So I attemped with this: > > gst-launch filesrc location=/home/boss/test/video.mpg ! decodebin2 ! > videomixer name=mix ! xvimagesink filesrc location = > /home/boss/test/image.png ! pngdec ! ffmpegcolorspace ! mix > > but I got: "pipeline wrong. No element called mix" I believe the syntax you're looking for is mix. with a trailing dot, this basically means "a suitable pad on the element named 'mix'". Cheers -Tim _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
here's an example that works with overlaying text on top of video
gst-launch-0.10 v4l2src ! 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! \ timeoverlay halignment=right valignment=bottom shaded-background=true ! \ clockoverlay halignment=left valignment=bottom text="M/D/Y:" shaded-background=true time-format="%m/%d/%Y %H:%M:%S" ! \ tee name=t_vid ! queue ! xvimagesink sync=false t_vid. ! queue ! videorate ! \ 'video/x-raw-yuv,framerate=30/1' ! theoraenc ! queue ! oggmux ! \ filesink location=testogg.ogg On Thu, Mar 1, 2012 at 9:50 AM, Tim-Philipp Müller <[hidden email]> wrote:
-- _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by kususe
Using rsvgoverlay can provide an alternative solution to videomixer:
gst-launch videotestsrc ! rsvgoverlay fit-to-frame=1 data='<svg viewBox="0 0 800 600"><image x="0" y="0" width="100%" height="100%" xlink:href="foo.jpg" /></svg>' ! ffmpegcolorspace ! xvimagesink Olivier On Thu, 2012-03-01 at 11:40 -0800, kususe wrote: > I want to code a pipeline to overlay an image on a video. > First I would like to understand how to implement this one and then to code > it. > So I attemped with this: > > gst-launch filesrc location=/home/boss/test/video.mpg ! decodebin2 ! > videomixer name=mix ! xvimagesink filesrc location = > /home/boss/test/image.png ! pngdec ! ffmpegcolorspace ! mix > > but I got: "pipeline wrong. No element called mix" > > Suggestions? > Thanks in advance > K > > > > -- > View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Overlaying-an-image-on-a-video-tp4436063p4436063.html > Sent from the GStreamer-devel mailing list archive at Nabble.com. > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by kususe
Ok, I added a trailing dot.
But I got: gstpngdec.c(550): gst_pngdec_task (): /GstPipeline:pipeline0/GstPngDec:pngdec0: stream stopped, reason error with the impossibility to make the "preroll". Cheers, K. -----Messaggio originale----- Da: Tim-Philipp Müller <[hidden email]> Inviato il: 01 Mar 2012 - 19:50 A: [hidden email] On Thu, 2012-03-01 at 11:40 -0800, kususe wrote: > I want to code a pipeline to overlay an image on a video. > First I would like to understand how to implement this one and then to code > it. > So I attemped with this: > > gst-launch filesrc location=/home/boss/test/video.mpg ! decodebin2 ! > vid eomixer name=mix ! xvimagesink filesrc location = > /home/boss/test/image.png ! pngdec ! ffmpegcolorspace ! mix > > but I got: "pipeline wrong. No element called mix" I believe the syntax you're looking for is mix. with a trailing dot, this basically means "a suitable pad on the element named 'mix'". Cheers -Tim _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel ------------------------------------------------------------------------------- Valore legale alle tue mail InterfreePEC - la tua Posta Elettronica Certificata http://pec.interfree.it ------------------------------------------------------------------------------- _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
You need to use imagefreeze... because videomixer does not manage framerate of the picture. 2012/3/2 <[hidden email]> Ok, I added a trailing dot. _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
gst-launch videomixer name=mix ! ffmpegcolorspace ! xvimagesink \ filesrc location=XXX.avi ! decodebin ! mix. \ filesrc location=YYY.jpg ! jpegdec ! imagefreeze ! ffmpegcolorspace ! mix. 2012/3/2 Angel Martin <[hidden email]>
_______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by kususe
Hi,
I was doing similar thing yesterday - I was trying to overlay a logo on output from one of ours videofilters. I had several mp4 files with h264 video and no audio. I finally found 2 solutions, which had worked fine when playing to xvimagesink, but which failed to stop (and also made everything in video look somehow slowed) so I was unable to store the resulting video in another video file. Here's what I had: * video-input.mp4: - 640x480, 30000/1001 fps h264 stream in mp4 container with no audio * logo.png: - a color 640x480 png image with transparency (mostly fully transparent, only in top left corner small logo) What I wanted: 1) to see if it works using some videosink - and it did 2) to store the result in a file - it worked but it worked forever.. 1) to see if it works (I left out our company's filter) (a) variant using multifilesrc with caps: caps="video/x-raw-yuv,format=(fourcc)AYUV,width=640,height=480,framerate=(fraction)30000/1001" caps_png="image/png,framerate=(fraction)30000/1001" logo=logo.png vid=video-input.mp4 gst-launch \ videomixer name=mix \ ! ffmpegcolorspace \ ! xvimagesink sync=false \ multifilesrc location = $logo caps = $caps_png \ ! pngdec \ ! ffmpegcolorspace \ ! $caps \ ! mix. \ filesrc location = $vid \ ! qtdemux \ ! ffdec_h264 \ ! ffmpegcolorspace \ ! $caps \ ! mix. There's probably more 'ffmpegcolorspace's than needed, but it shouldn't hurt anything. (b) variant using imagefreeze: caps="video/x-raw-yuv,format=(fourcc)AYUV,width=640,height=480,framerate=(fraction)30000/1001" logo=logo.png vid=video-input.mp4 gst-launch \ videomixer name=mix \ ! ffmpegcolorspace \ ! xvimagesink sync=false \ filesrc location = $logo \ ! pngdec \ ! imagefreeze \ ! ffmpegcolorspace \ ! $caps \ ! mix. \ filesrc location = $vid \ ! qtdemux \ ! ffdec_h264 \ ! ffmpegcolorspace \ ! $caps \ ! mix. And it works too. 2) Here comes the problem - storing the result. If you're fine with just displaying - feel free to ignore the rest. But if anyone sees where my problem lies I'd be grateful for any help or suggestions. So I'm trying to store the video. The pipeline is almost the same (I'll use the (a) variant): caps="video/x-raw-yuv,format=(fourcc)AYUV,width=640,height=480,framerate=(fraction)30000/1001" caps_png="image/png,framerate=(fraction)30000/1001" logo=logo.png vid=video-input.mp4 res=video-result.mp4 gst-launch \ videomixer name=mix \ ! ffmpegcolorspace \ ! x264enc \ ! mp4mux \ ! filesink location = $res multifilesrc location = $logo caps = $caps_png \ ! pngdec \ ! ffmpegcolorspace \ ! $caps \ ! mix. \ filesrc location = $vid \ ! qtdemux \ ! ffdec_h264 \ ! ffmpegcolorspace \ ! $caps \ ! mix. It looks fine, it works, but it works forever - the png image part keeps sending images even after the video part ends. I came up with only one solution - limiting nuber of frames sent by multifilesrc, so i changed the line: multifilesrc location = $logo caps = $caps_png \ to: multifilesrc location = $logo caps = $caps_png num-buffers = $frames \ where '$frames' is number of frames in 'video-input.mp4' I have calculated earlier. I was hoping that when both sources have the same framerate it must work. Well.. it didn't. I got video which was rouhgly 2.6 times longer and part where mixer's video input was still working was strangely slowed in some places and then there was just 1 minute of plain png with transparency (checkerboard almost all over the place). That was differen than it was when I was using the 'xvimagesink' - with 'xvimagesink' I got the last video-input's frame "freezed" and even though it was going forever, it at least looked normal. Here are some things that I tried before I gave up and reencoded the resulting video with mencoder's 'bmovl' feature: * queue - I had put queues everywhere - no effect * qos - I had turned qos everywhere (qos=false) - no effect * I tried queues and no-qos with all combinations also with freezeframe variant - still no effect I guess it could work if I just wrote small python program and disconnected png mixer input on video's eof.. but I didn't had enough time, so I sticked with mencoder and worse quality (because of another re-encoding). I hope it may help someone or someone could help me :) sincerely, Jan Spurny > > Ok, I added a trailing dot. > But I got: > > gstpngdec.c(550): gst_pngdec_task (): /GstPipeline:pipeline0/GstPngDec:pngdec0: > stream stopped, reason error > > with the impossibility to make the "preroll". > > Cheers, > K. > -----Messaggio originale----- > Da: Tim-Philipp Müller <[hidden email]> > Inviato il: 01 Mar 2012 - 19:50 > A: [hidden email] > > > On Thu, 2012-03-01 at 11:40 -0800, kususe wrote: > > > I want to code a pipeline to overlay an image on a video. > > First I would like to understand how to implement this one and then to code > > it. > > So I attemped with this: > > > > gst-launch filesrc location=/home/boss/test/video.mpg ! decodebin2 ! > > vid > eomixer name=mix ! xvimagesink filesrc location = > > /home/boss/test/image.png ! pngdec ! ffmpegcolorspace ! mix > > > > but I got: "pipeline wrong. No element called mix" > > I believe the syntax you're looking for is mix. with a trailing dot, > this basically means "a suitable pad on the element named 'mix'". > > Cheers > -Tim > > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel > > > > ------------------------------------------------------------------------------- > Valore legale alle tue mail > InterfreePEC - la tua Posta Elettronica Certificata > http://pec.interfree.it > ------------------------------------------------------------------------------- > > gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
I always been looking for a possibility to make a mp3 and image file to a mp4. I just realized this could easily be done with gstreamer. Thanks for your detailed mail!!
On Fri, Mar 2, 2012 at 10:43 AM, Jan Spurný <[hidden email]> wrote: Hi, Michael Niemand Albusstr. 17
60313 Frankfurt/M Germany Tel.: +49 (0) 69 200 130 60 _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |