Skip to content

[BUG] No output for mpegts to srt with negative -delay settings #1365

@mass

Description

@mass

CCExtractor version: Latest master branch

CCExtractor 0.91, Carlos Fernandez Sanz, Volker Quetschke.
Teletext portions taken from Petr Kutalek's telxcc
--------------------------------------------------------------------------
CCExtractor detailed version info
        Version: 0.91
        Git commit: 5127da50d14655401c4086e39d8b2d7786c5038f
        Compilation date: 2021-07-28
        File SHA256: 713e7f8a6664cb4a8ce75c62e4e48ab7ce4566dcc6738faf03816b5c6725f889
Libraries used by CCExtractor
        Tesseract Version: 4.1.1
        Leptonica Version: leptonica-1.81.0
        libGPAC Version: 1.0.1
        zlib: 1.2.11
        utf8proc Version: 2.4.0
        protobuf-c Version: 1.3.1
        libpng Version: 1.6.37
        FreeType
        libhash
        nuklear
        libzvbi

In raising this issue, I confirm the following:

  • I have read and understood the contributors guide.
  • I have checked that the bug-fix I am reporting can be replicated, or that the feature I am suggesting isn't already present.
  • I have checked that the issue I'm posting isn't already reported.
  • I have checked that the issue I'm porting isn't already solved and no duplicates exist in closed issues and in opened issues
  • I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion.
  • I have used the latest available version of CCExtractor to verify this issue exists.
  • I have ticked all the boxes in this section and to prove it I'm deleting the section completely to remove boilerplate text.

Necessary information

  • Is this a regression (i.e. did it work before)? Yes
  • What platform did you use? Linux
  • What were the used arguments? ./ccextractor -delay -1400 jeopardy-s37e99-srtissue.ts

Video links

Additional information

I recently noticed that when running ccextractor with negative -delay arguments, I get no output in the SRT file. This used to work for me without any issues. I ran a git-bisect to figure out which commit changed the behavior, and found it was this one:

#1167

I did a little debugging and found that nothing is being printed because of this if check in ccx_encoders_common::encode_sub

    sub->start_time += context->subs_delay;
    sub->end_time += context->subs_delay;
    if (sub->start_time < 0)
      return 0;

It seems the issue is that sub->start_time is always negative. Every time encode_sub is called, sub->start_time is decremented by 1400 (-delay -1400). Nothing else seems to be setting / modifying that value. If I comment out the if check, then I get correct output again.

I am happy to try submitting a PR to fix this, but I would need a little guidance on the intended behavior and what changes (if any?) would be desired.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions