[FFmpeg-trac] #3420(undetermined:new): Overlaying / hardcoding subtitles - last subtitle not done correctly

FFmpeg trac at avcodec.org
Fri Feb 28 16:41:59 CET 2014


#3420: Overlaying / hardcoding subtitles - last subtitle not done correctly
-------------------------------------+-------------------------------------
             Reporter:  adamc        |                    Owner:
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
              Version:  git-master   |  undetermined
             Keywords:  vobsub       |               Resolution:
             Blocking:               |               Blocked By:
Analyzed by developer:  0            |  Reproduced by developer:  0
-------------------------------------+-------------------------------------

Comment (by adamc):

 Hi,

 I really don't understand this stuff very much, but I did find something
 that could help you - the source code for Subtitle Edit, which does the
 calculation of the duration.

 The stack trace at the bottom of this comment shows where the calculation
 of the duration (aka 'Delay') is performed, when a .sub is loaded into
 Subtitle Edit.

 In summary however:

 This is where the vob sub packs merging starts:
 https://github.com/SubtitleEdit/subtitleedit/blob/master/src/Forms/VobSubOcr.cs#L954

 Which goes into here:
 https://github.com/SubtitleEdit/subtitleedit/blob/master/src/Logic/VobSub/VobSubParser.cs#L156

 And then into here which constructs a SubPicture class:
 https://github.com/SubtitleEdit/subtitleedit/blob/master/src/Logic/VobSub/VobSubMergedPack.cs#L15

 *******
 And here is where the calculation of the duration/Delay happens, by
 parsing the display control commands, and calculating it from the stop
 display command:

 https://github.com/SubtitleEdit/subtitleedit/blob/master/src/Logic/VobSub/SubPicture.cs#L109

 *******

 Hopefully this helps and will all make sense to you...

 (I don't really have an understanding of how subtitles work... And I am
 not familiar with the ffmpeg code...)


 The full stack trace of Subtitle Edit, in case it helps, when loading the
 .sub and calculating the duration:

 SubtitleEdit.exe!Nikse.SubtitleEdit.Logic.VobSub.SubPicture.ParseDisplayControlCommands(bool
 createBitmap, System.Collections.Generic.List<System.Drawing.Color>
 colorLookUpTable, System.Collections.Generic.List<System.Drawing.Color>
 fourColors, bool useCustomColors) Line 109     C#
 SubtitleEdit.exe!Nikse.SubtitleEdit.Logic.VobSub.SubPicture.SubPicture(byte[]
 data) Line 40 + 0x10 bytes        C#
 SubtitleEdit.exe!Nikse.SubtitleEdit.Logic.VobSub.VobSubMergedPack.VobSubMergedPack(byte[]
 subPictureData, System.TimeSpan presentationTimeStamp, int streamId,
 Nikse.SubtitleEdit.Logic.VobSub.IdxParagraph idxLine) Line 15 + 0x18 bytes
 C#
 SubtitleEdit.exe!Nikse.SubtitleEdit.Logic.VobSub.VobSubParser.MergeVobSubPacks()
 Line 156 + 0x49 bytes  C#
 SubtitleEdit.exe!Nikse.SubtitleEdit.Forms.VobSubOcr.InitializeSubIdx(string
 vobSubFileName) Line 954 + 0x10 bytes       C#
 SubtitleEdit.exe!Nikse.SubtitleEdit.Forms.VobSubOcr.Initialize(string
 vobSubFileName, Nikse.SubtitleEdit.Logic.VobSubOcrSettings
 vobSubOcrSettings, bool useNewSubIdxCode, Nikse.SubtitleEdit.Forms.Main
 main) Line 617 + 0xb bytes     C#
 SubtitleEdit.exe!Nikse.SubtitleEdit.Forms.Main.ImportAndOcrVobSubSubtitleNew(string
 fileName, bool showInTaskbar) Line 10050 + 0x36 bytes       C#
 SubtitleEdit.exe!Nikse.SubtitleEdit.Forms.Main.OpenSubtitle(string
 fileName, System.Text.Encoding encoding, string videoFileName, string
 originalFileName) Line 2208 + 0x16 bytes       C#
 SubtitleEdit.exe!Nikse.SubtitleEdit.Forms.Main.OpenSubtitle(string
 fileName, System.Text.Encoding encoding) Line 2182 + 0x12 bytes      C#
 SubtitleEdit.exe!Nikse.SubtitleEdit.Forms.Main.SubtitleListview1_DragDrop(object
 sender, System.Windows.Forms.DragEventArgs e) Line 9677 + 0xd bytes    C#
 [External Code]
 SubtitleEdit.exe!Nikse.SubtitleEdit.Program.Main() Line 17 + 0x1d bytes C#

--
Ticket URL: <https://trac.ffmpeg.org/ticket/3420#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list