GNOME Bugzilla – Bug 745292
gst-play: load local subtitles
Last modified: 2018-11-03 11:35:15 UTC
I don't want to bloat gst-play, but, at same time, I think this little snippet might be useful as implementation reference. Basically it mimics mplayer's functionality, loading the subtitle file if it is present in the same path of the media file with 'srt' extension.
Created attachment 298101 [details] [review] gst-play: load local subtitles When a new uri is loaded, the new function play_suburi() will look for a subtitle file, the uri is local and the subtitle file has the same name of the media file but with extension 'srt'.
Created attachment 298421 [details] [review] gst-play: load local subtitles When a new uri is loaded, the new function play_suburi() will look for a subtitle file, the uri is local and the subtitle file has the same name of the media file but with extension 'srt'. v2: fix pathological cases of filenames with an ending '.' or no dot at all
Good idea. Maybe do the same for .sub files (or for that matter, any known text subtitle file extension) and add documentation on how the subtitle file is choosen if more than one is found?
I'm not sure how keen I am on having this in gst-play, which should imho demonstrate functionality as it exists. I think a command line argument for the subtitle file would be more appropriate, even if less convenient.
uhm. I have no strong opinion about it but if gst-play is already automating some choices like what audiotrack to play if more than one available or similar, then I think this idea makes sense on the same grounds. Maybe we can add a flag to make the autodetection conditional? I like Tim's idea too but maybe we can still have both without adding a lot of code, and IMHO, it will be useful for some.
It is not gst-play that automates the choice which audio track is played, but playbin.
I understand but would you rather add logic to playbin for subtitle auto-loading / selection than having this done in gst-player? or you just dislike the idea all together?
I like the idea in principle, I just think that it's something that playbin (or elements inside the pipeline) should figure out and then everything will just pick up the subs automagically. That's a bit more hassle to implement than adding it to gst-play of course, not least because of API bikeshedding, but it's where it should be done IMHO.
Cool, think I got it now. Will keep it in mind and see whether I can throw some time at it. Shall we close this one as a wontfix or keep around till a better solution is implemented?
That would be my preference at least.
For reference, this "fork" of gst-play has suburi support already: https://github.com/sdroege/gst-player/tree/master/gst-play
(In reply to Sebastian Dröge (slomo) from comment #11) > For reference, this "fork" of gst-play has suburi support already: > https://github.com/sdroege/gst-player/tree/master/gst-play Nevermind, the GTK UI has, not the commandline player :) Sorry for the confusion
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/166.