GNOME Bugzilla – Bug 797134
gst-player: Subtitle offset configuration support
Last modified: 2018-11-01 10:47:56 UTC
Sometimes subtitles are not properly synchronized with the movie. Having a property like the av-offset but for subtitles would be great.
I started some patches for playsink, playbin and gst-player for this. Playsink now has a "text-offset" property. Feel free to name-bikeshed :)
Created attachment 374080 [details] [review] subtitleoverlay: Add a subtitle-ts-offset property This property controls the synchronisation offset between text and video in nanoseconds, by updating the parser src pad offset.
Created attachment 374081 [details] [review] playsink: Add text-offset property When the playsink contains a text chain this property controls the synchronisation of the subtitles and video by controlling the underlying subtitleoverlay::subtitle-ts-offset property.
Created attachment 374082 [details] [review] playbin: New text-offset property This new property controls the synchronisation offset between the text and video streams. Positive values make the text ahead of the video and negative values make the text go behind the video.
Created attachment 374083 [details] [review] playbin3: New text-offset property This new property controls the synchronisation offset between the text and video streams. Positive values make the text ahead of the video and negative values make the text go behind the video.
Created attachment 374084 [details] [review] examples/playback-test: New entry for text-offset updates
Created attachment 374085 [details] [review] player: API additions for text-video-offset property This new property contols the synchronisation offset between text and video in nanoseconds.
Review of attachment 374081 [details] [review]: ::: gst/playback/gstplaysink.c @@ +4064,3 @@ + + if (tchain && tchain->overlay) { + g_object_set (tchain->overlay, "subtitle-ts-offset", text_offset, NULL); If a text-sink is set on playsink, you need to set the ts-offset property on it instead
Comment on attachment 374085 [details] [review] player: API additions for text-video-offset property I think everywhere else in GstPlayer we call this "subtitle", not "text". Let's keep it consistent.
Created attachment 374090 [details] [review] playsink: Add text-offset property When the playsink contains a text chain this property controls the synchronisation of the subtitles and video by controlling the underlying subtitleoverlay::subtitle-ts-offset property.
Created attachment 374091 [details] [review] player: API additions for subtitle-video-offset property This new property contols the synchronisation offset between subtitles and video in nanoseconds.
Attachment 374080 [details] pushed as 3cd38be - subtitleoverlay: Add a subtitle-ts-offset property Attachment 374082 [details] pushed as dc5006f - playbin: New text-offset property Attachment 374083 [details] pushed as 610fa16 - playbin3: New text-offset property Attachment 374084 [details] pushed as 07d078e - examples/playback-test: New entry for text-offset updates Attachment 374090 [details] pushed as ea3b074 - playsink: Add text-offset property
Comment on attachment 374091 [details] [review] player: API additions for subtitle-video-offset property Attachment 374091 [details] pushed as de26abc - player: API additions for subtitle-video-offset property
Review of attachment 374091 [details] [review]: ::: docs/libs/gst-plugins-bad-libs-sections.txt @@ +865,3 @@ +gst_player_get_text_video_offset +gst_player_set_text_video_offset sorry for arrive late, but these should be gst_player_{set|get}_subtitle_video_offset ??
Oh yes, sorry about this! I'll fix it. Thanks Víctor!
commit d3fd78084ad07382656d68288331fe62a87aa0b7 (HEAD -> master, origin/master) Author: Philippe Normand <philn@igalia.com> Date: Thu Nov 1 10:44:44 2018 +0000 docs: Follow-up fix for GstPlayer new subtitle-video-offset API These symbols were not renamed after the initial review in Bugzilla. https://bugzilla.gnome.org/show_bug.cgi?id=797134