Pad linking query

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Pad linking query

Andy Robinson
I'm trying to link a subtitle pad offered by decodebin, to the subparse
element. But they won't link because:

decodebin subtitle pad caps (from gst_pad_query_caps):
text/x-raw, format=(string)utf8

subparse sinkpad caps:
application/x-subtitle; application/x-subtitle-sami;
application/x-subtitle-tmplayer; application/x-subtitle-mpl2;
application/x-subtitle-dks; application/x-subtitle-qttext;
application/x-subtitle-lrc; application/x-subtitle-vtt

So there's no overlap. Do I need to insert another element between
decodebin & subparse? Or what? Any help would be welcome.

Regards,
Andy Robinson, Seventh String Software, www.seventhstring.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Pad linking query

gotsring
Can you describe what you are trying to accomplish? Where are the subtitles
coming from and where do you want to use them? Are you just overlaying the
subtitles on a video stream?

Random pipeline to play subtitles from a file and overlay them onto a video.
Subtitles are read from an .srt file (attached for reference)  subtitles.srt
<http://gstreamer-devel.966125.n4.nabble.com/file/t379531/subtitles.srt>  

gst-launch-1.0.exe filesrc location=subtitles.srt ! subparse ! textoverlay
name=to ! autovideosink \
videotestsrc num-buffers=640 ! 'video/x-raw, width=640, height=480,
framerate=20/1' ! to.




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Pad linking query

Andy Robinson
On 25/02/2021 22:21, gotsring wrote:

> Can you describe what you are trying to accomplish? Where are the subtitles
> coming from and where do you want to use them? Are you just overlaying the
> subtitles on a video stream?
>
> Random pipeline to play subtitles from a file and overlay them onto a video.
> Subtitles are read from an .srt file (attached for reference)  subtitles.srt
> <http://gstreamer-devel.966125.n4.nabble.com/file/t379531/subtitles.srt>
>
> gst-launch-1.0.exe filesrc location=subtitles.srt ! subparse ! textoverlay
> name=to ! autovideosink \
> videotestsrc num-buffers=640 ! 'video/x-raw, width=640, height=480,
> framerate=20/1' ! to.

They are coming from decodebin of a video file which has two subtitle
tracks, and yes I want to overlay them on the video. I know how to do it
with an srt file, no problem. But that's not where they are coming from.
I am doing it programatically but the pipeline would look something like
this:

gst-launch-1.0 \
textoverlay name=ov ! autovideosink \
filesrc location=myvideo.mp4 ! decodebin name=d ! queue ! videoconvert !
videoscale ! ov.video_sink \
d. ! queue ! subparse ! ov.text_sink

But this doesn't work: it says "Redistribute latency..." and then
nothing happens.

 From diagnostics in my programatic version, I thnk the problem is

decodebin subtitle pad caps (from gst_pad_query_caps):
text/x-raw, format=(string)utf8

subparse sinkpad caps:
application/x-subtitle; application/x-subtitle-sami;
application/x-subtitle-tmplayer; application/x-subtitle-mpl2;
application/x-subtitle-dks; application/x-subtitle-qttext;
application/x-subtitle-lrc; application/x-subtitle-vtt

They are not compatible. (Incidentally the src caps of a filesrc are
"ANY" which is why we can link an srt file into the subparse).

There surely is some way of linking the subtitle pad presented by
decodebin, into subparse, but how?

Regards,
Andy Robinson, Seventh String Software, www.seventhstring.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Pad linking query

Andy Robinson
On 26/02/2021 10:44, Andy Robinson wrote:

> On 25/02/2021 22:21, gotsring wrote:
>> Can you describe what you are trying to accomplish? Where are the
>> subtitles
>> coming from and where do you want to use them? Are you just overlaying
>> the
>> subtitles on a video stream?
>>
>> Random pipeline to play subtitles from a file and overlay them onto a
>> video.
>> Subtitles are read from an .srt file (attached for reference)  
>> subtitles.srt
>> <http://gstreamer-devel.966125.n4.nabble.com/file/t379531/subtitles.srt>
>>
>> gst-launch-1.0.exe filesrc location=subtitles.srt ! subparse !
>> textoverlay
>> name=to ! autovideosink \
>> videotestsrc num-buffers=640 ! 'video/x-raw, width=640, height=480,
>> framerate=20/1' ! to.
>
> They are coming from decodebin of a video file which has two subtitle
> tracks, and yes I want to overlay them on the video. I know how to do it
> with an srt file, no problem. But that's not where they are coming from.

P.S. I seem to have figured it out: I link the decodebin subtitle pad
directly to the textoverlay element and it works. I don't know, in this
case, where the subtitles are being parsed, but I don't care either!

Regards,
Andy Robinson, Seventh String Software, www.seventhstring.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel