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

Closed
opened 2026-01-29 16:50:10 +00:00 by claunia · 2 comments
Owner

Originally created by @mass on GitHub (Jul 28, 2021).

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:

https://github.com/CCExtractor/ccextractor/pull/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!

Originally created by @mass on GitHub (Jul 28, 2021). 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: - [x] I have read and understood the [contributors guide](https://github.com/CCExtractor/ccextractor/blob/master/.github/CONTRIBUTING.md). - [x] I have checked that the bug-fix I am reporting can be replicated, or that the feature I am suggesting isn't already present. - [x] I have checked that the issue I'm posting isn't already reported. - [x] I have checked that the issue I'm porting isn't already solved and no duplicates exist in [closed issues](https://github.com/CCExtractor/ccextractor/issues?q=is%3Aissue+is%3Aclosed) and in [opened issues](https://github.com/CCExtractor/ccextractor/issues) - [x] I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion. - [x] I have used the latest available version of CCExtractor to verify this issue exists. - [x] 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 * https://www.dropbox.com/s/ayrgx0xqfhljxho/jeopardy-s37e99-srtissue.ts?dl=0 # 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: https://github.com/CCExtractor/ccextractor/pull/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!
Author
Owner

@PunitLodha commented on GitHub (Nov 19, 2021):

This was fixed recently. You can try compiling the code from the master branch

@PunitLodha commented on GitHub (Nov 19, 2021): This was fixed recently. You can try compiling the code from the master branch
Author
Owner

@mass commented on GitHub (Nov 20, 2021):

I can confirm this is fixed for me now when running the latest master branch version. Thanks!

@mass commented on GitHub (Nov 20, 2021): I can confirm this is fixed for me now when running the latest master branch version. Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#651