Hi there,
Is is possible to add Text or Bitmap overlay on the input video, so that it is encoded with the video or even better muxed into the output file?
Or is it possible to play a file, which has the Text overlay/Subtitle muxed in it, with the overlay enabled?
Thanks for the reply in advance.
Moza
Thanks for the answer :)
I tried the following pipeline with a video clip which I muxed with a text subtitle:
gst-launch filesrc location=davinci500_s.mp4 ! qtdemux name=demux ! "video/x-mpeg4" ! queue ! dmaidec_mpeg4 numOutputBufs=14 ! subtitleoverlay name=overlay ! ffmpegcolorspace ! autovideosink demux. ! "video/x-dvd-subpicture" ! queue ! overlay.
But what I get is the video without any text subtitle.
I tried another file which I muxed with a DVDBitmap Subtitle.
This time the decoder stops at:
Setting pipeline to PAUSED ...Pipeline is PREROLLING ...
and no video or subpicture is displayed.
Can anyone shed some light on this issue please?
Thanks in advance.
Morteza,
Interesting, I have never used subtitleoverlay element. I am a bit confused about what color space exists at each point in the pipeline and how the subtitle text is getting from the demuxer to the subtitleoverlay element.
Do you have an example pipeline that is working on a Linux host PC?
Todd
Hi Todd,
Thanks for the reply.
I've been searching for subtitle or subpicture overlay for quite some time now. I came across this link in G-streamer Website:
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-plugins/html/gst-plugins-base-plugins-subtitleoverlay.html
I tried adapting it to RRSDK Installation of LeopardBoard.
But I was somehow sure that at least Text Subtitles need some tweaking on Font property before it could be functional.
Regarding your question, I must add that G-Streamer website (The link I provided above) states that the following pipeline is used to playback an MKV file with subtitle:
gst-launch -v filesrc location=test.mkv ! matroskademux name=demux ! "video/x-h264" ! queue2 ! decodebin2 ! subtitleoverlay name=overlay ! ffmpegcolorspace ! autovideosink demux. ! "video/x-dvd-subpicture" ! queue2 ! overlay.
Get subtitles working on your desktop computer first. That simplifies your problem. Be sure to publish those working pipelines and provide access to the source file you used. Then, once you have it working there, try it on the embedded target. We can help you with your move to the embedded target, but I don't know anything about DVD subtitle technology.
Hi Todd, and thanks for the support,
I did a lot of research on the pipelines needed to construct the subtitle overlay but it is not very well documented.
I later tried installing GST-Editor to have a GUI for constructing the pipeline visually, It was successful but I had a lot of problems with the buggy editor.
Finally I came across playnin and playbin2 filters. They are amazing!!
I wonder why I have never seen them in the installation guide or the wikis about RidgeRunSDK and/or LeopardBoard.
It works fine both on the PC and LeopardBoard (But of course with performance issues) for any type of audio or video file I threw at it.
I tried playing a video clip which I muxed with a simple Text subtitle, with this pipeline on my Linux machine (Not Leopard board):
gst-launch playbin2 uri=file://sims.mkv
It first analyses the source file and tried constructing all necessary filters and finaly plays the file with the subtile as it should. (Just Perfect)
Then I tried running the same pipeline on the LeopardBoard.
It analyses the file and outputs some warnings and plays the video (But of course very slowly).
Here is the output from the LeopardBoard:
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
WARNING: from element /GstPlayBin2:playbin20/GstPlaySink:playsink0/GstBin:tbin/GstSubtitleOverlay:suboverlay: Your GStreamer installation is missing a plug-in.
Additional debug info:
../../../src/gst/playback/gstsubtitleoverlay.c(793): _pad_blocked_cb (): /GstPlayBin2:playbin20/GstPlaySink:playsink0/GstBin:tbin/GstSubtitleOverlay:suboverlay:
no suitable subtitle plugin found
davinci_v4l2 davinci_v4l2.1: Before finishing with S_FMT:
layer.pix_fmt.bytesperline = 1440,
layer.pix_fmt.width = 720,
layer.pix_fmt.height = 480,
layer.pix_fmt.sizeimage =691200
davinci_v4l2 davinci_v4l2.1: pixfmt->width = 720,
layer->layer_info.config.line_length= 1440
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Performance issue is not very important in this phase, because it shows that if playbin2 is able to construct the pipeline, we can easily do it with our favorite decoders and ques and buffers.
All I need to know now is which plugins/filters are used for playing the file on my Linux machine (dependencies) and how to add the missing plugins into RidgeRunSDK?
I appreciate your help.
Regards,
Morteza
Here is a screenshot of the file with the subtitle on my Linux machine:
Hi Again Todd, Just a quick note:
I managed to find the correct pipeline without using playbin under my Linux Machine.
Here it is:
gst-launch filesrc location=sims.mkv ! matroskademux name=demux ! queue ! decodebin2 ! subtitleoverlay name=overlay ! ffmpegcolorspace ! autovideosink demux. ! queue ! overlay.
I also managed to change the font property to change the subtitle's font and make it bigger by adding "font-desc" property (Which is still undocumented in GSTreamer website!!)
gst-launch filesrc location=sims.mkv ! matroskademux name=demux ! queue ! decodebin2 ! subtitleoverlay name=overlay font-desc="FreeSerif 40px" ! ffmpegcolorspace ! autovideosink demux. ! queue ! overlay.
I think we just need to add some fonts to RRSDK and add the missing plugins.
Hi Morteza,
> I wonder why I have never seen them [playbin and playbin2] in the installation guide or the wikis about RidgeRunSDK
In embedded devices, you typically want to control everything so you don't get any surprises out in the field. I have used playbin in the past to help me construct pipelines. I would turn on debug output and then I had a script to filter out from all that debug output the pipeline being used. Unfortunately I didn't create a wiki page before forgetting my filter trick.
I have always wondered why playbin doesn't have a parameter printpipeline=true.
Once you get the actual pipeline used, the community can provide some hints on how to replace various elements to use the hardware accelerated version in gst-dmai plug-in.
Here is the pipeline I used for playing the video with the subtitle correctly. (As I mentioned above)
gst-launch filesrc location=panda3.mkv ! matroskademux name=demux ! queue ! decodebin ! subtitleoverlay name=overlay ! ffmpegcolorspace ! autovideosink demux. ! queue ! overlay.
You can find the file I used for this test here: http://www.mediafire.com/?nzhrwfwht757h4c
Thanks
> I have always wondered why playbin doesn't have a parameter printpipeline=true.
I found an amazing way to get a graph out of the debug output of gst-launch (As pointed out by Andreas Rödig Here)
It is also useful to see the pipeline made by playbin and playbin2
Here are the steps to see which filters are used to construct the pipeline in GStreamer: (Sorry Todd, I write them in a way that they can be useful for beginners too)
Here are two example graphs I created with this method:
(Click on the picture for the larger version)
Marteza,
This is fantastic. I have seen GST_DEBUG_DUMP_DOT_DIR before, but the documentation I saw at gstreamer.freedesktop.org/.../gst-running.html describing all the environment variables didn't describe how GST_DEBUG_DUMP_DOT_DIR was really useful.
I appreciate you giving back to the community. It seems so many requests for help never rebound as good information back to the community. I will create a wiki page describing GST_DEBUG_DUMP_DOT_DIR and how to use it with playbin.
Thanks for the comment.
I think I found the missing plugin. It is called "GStreamer plugins for X11 and Pango" under my Linux machine. I need to know how I can port this plugin to my LeopardBoard and integrate it into the build process.
Can you guide me on how to integrate a new plugin (in my case "GStreamer plugins for X11 and Pango") into my RRSDK and LeopardBoard.
You would start something like this
mkdir $DEVDIR/fs/apps/gstreamer-plugins-pango
cd $DEVDIR/fs/apps/gstreamer-plugins-pango
cp ../gst-plugins-good-0.10.25/{Makefile,Config,metainfo} .
geany Makefile Config metainfo &
Adjust those three files for your needs. Hints on how to do this at
www.ridgerun.com/.../RidgeRun_2011Q2_SDK_Development_and_Integration_Guide
You will likely need to create some patches to get the cross compile to succeed. Look at the patches in $DEVDIR/fs/apps/gst*/patches for examples.
Hi Todd and thanks for the answer.
I studied the page you mentioned and it was a very good source.
I was in the middle of transferring the plugin, that I realized it is already a part of gst-plugins-base-0.10.32 in /src/ext/pango
How can I enable this plugin, because it seems that the make file and all the settings are already configured.
As I have mentioned earlier, I am a windows and embedded developer and very new in the world of Linux, and sometimes the question might seem lame :)
Thanks for any help in advance.