[BUG] Empty srt file being generated for a ts file linux #488

Closed
opened 2026-01-29 16:45:13 +00:00 by claunia · 6 comments
Owner

Originally created by @gigatesseract on GitHub (Mar 8, 2019).

Please prefix your issue with one of the following: [BUG]

CCExtractor version (using the --version parameter preferably) : 0.87

In raising this issue, I confirm the following (please check boxes, eg [X] - and delete unchecked ones):

  • 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.

My familiarity with the project is as follows (check one, eg [X] - and delete unchecked ones):

  • I have never used CCExtractor.

Necessary information

  • Is this a regression (did it work before)? [x] NO
  • What platform did you use? [x] Linux
  • What were the used arguments? -autoprogram

**Video links (replace text below with your links) **

sample .ts file

Additional information

I built the linux ccextractor version 0.87. I tried to extract cc in the sample .ts file above (a sample file given by videolan). The command I used was simply ./ccextractor <filename> . Only an empty ts file is generated. However, VLC media player plays it just fine.

Originally created by @gigatesseract on GitHub (Mar 8, 2019). Please prefix your issue with one of the following: [BUG] CCExtractor version (using the --version parameter preferably) : **0.87** **In raising this issue, I confirm the following (please check boxes, eg [X] - and delete unchecked ones):** - [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. **My familiarity with the project is as follows (check one, eg [X] - and delete unchecked ones):** - [x] I have never used CCExtractor. **Necessary information** - Is this a regression (did it work before)? [x] NO - What platform did you use? [x] Linux - What were the used arguments? `-autoprogram` **Video links (replace text below with your links) ** [sample .ts file](http://streams.videolan.org/streams/ts/Closed%20Caption%20EIA.ts) **Additional information** I built the linux ccextractor version 0.87. I tried to extract cc in the sample .ts file above (a sample file given by videolan). The command I used was simply `./ccextractor <filename>` . Only an empty ts file is generated. However, VLC media player plays it just fine.
Author
Owner

@thelastpolaris commented on GitHub (Mar 8, 2019):

Seems that the problem is with .ts decoding stuff in ccextractor, as I converted your .ts file to mp4 and ccextractor extracted subtitles.

@thelastpolaris commented on GitHub (Mar 8, 2019): Seems that the problem is with .ts decoding stuff in ccextractor, as I converted your .ts file to mp4 and ccextractor extracted subtitles.
Author
Owner

@gigatesseract commented on GitHub (Mar 8, 2019):

@thelastpolaris Ah yeah, The srt file is generated properly for .mp4. There is some problem with the .ts decoder 👍 😳

@gigatesseract commented on GitHub (Mar 8, 2019): @thelastpolaris Ah yeah, The srt file is generated properly for .mp4. There is some problem with the .ts decoder :+1: :flushed:
Author
Owner

@thelastpolaris commented on GitHub (Mar 8, 2019):

Ok, so if you try to to convert .mp4 file back to ts without reconverting the video (ffmpeg -i 1077.mp4 -codec copy 1077.ts) it extracts subtitles. Also, if you check with your original file with ffmpeg -i orig_1077.ts you fill find that there are a lot of kinda empty tracks.

@thelastpolaris commented on GitHub (Mar 8, 2019): Ok, so if you try to to convert .mp4 file back to ts without reconverting the video (`ffmpeg -i 1077.mp4 -codec copy 1077.ts`) it extracts subtitles. Also, if you check with your original file with `ffmpeg -i orig_1077.ts` you fill find that there are a lot of kinda empty tracks.
Author
Owner

@thelastpolaris commented on GitHub (Mar 8, 2019):

@gigatesseract So depending on the definition, the problem is either in your sample or in ccextractor way of handling .ts files with strange programs :)
This is ffmpeg -i output for your original sample https://pastebin.com/mW6EhPkC, from which ccextractor can't extract subtitles even if I pass -pn 358 as a parameter (program number for real stream).
https://pastebin.com/MdXAnduG this is description of the file I created with ffmpeg by creating 2 programs and copying video and audio streams to them. Normally, ccextractor will ask you from which program to extract subtitles but in case of your original sample, I guess, ccextractor fails to do that because of No Program program with a lot of empty and unknown streams.
So solution for you is to repack your .ts file with ffmpeg and preserve closed captions (ffmpeg -i 1077.ts -map 0:p:358 -c:v copy 1077_copy.ts).

@cfsmp3 should we consider behavior when ccextractor doesn't work with .ts file that has No Program programs as incorrect one?

@thelastpolaris commented on GitHub (Mar 8, 2019): @gigatesseract So depending on the definition, the problem is either in your sample or in ccextractor way of handling .ts files with strange programs :) This is `ffmpeg -i` output for your original sample https://pastebin.com/mW6EhPkC, from which ccextractor can't extract subtitles even if I pass `-pn 358` as a parameter (program number for real stream). https://pastebin.com/MdXAnduG this is description of the file I created with ffmpeg by creating 2 programs and copying video and audio streams to them. Normally, ccextractor will ask you from which program to extract subtitles but in case of your original sample, I guess, ccextractor fails to do that because of `No Program` program with a lot of empty and unknown streams. So solution for you is to repack your .ts file with ffmpeg and preserve closed captions (`ffmpeg -i 1077.ts -map 0:p:358 -c:v copy 1077_copy.ts`). @cfsmp3 should we consider behavior when ccextractor doesn't work with .ts file that has `No Program` programs as incorrect one?
Author
Owner

@cfsmp3 commented on GitHub (Mar 8, 2019):

@thelastpolaris in general if there's a way to get the subtitles (ffmpeg can do it, VLC can do it, any player can do it, etc) but we are unable to get them, assume it's a problem in CCExtractor.

Saying that the sample doesn't have programs doesn't help the user :-) He just has a sample that contains subtitles and wants CCExtractor to extract them for him.

@cfsmp3 commented on GitHub (Mar 8, 2019): @thelastpolaris in general if there's a way to get the subtitles (ffmpeg can do it, VLC can do it, any player can do it, etc) but we are unable to get them, assume it's a problem in CCExtractor. Saying that the sample doesn't have programs doesn't help the user :-) He just has a sample that contains subtitles and wants CCExtractor to extract them for him.
Author
Owner

@gigatesseract commented on GitHub (Mar 11, 2019):

@thelastpolaris @cfsmp3 Thank you for looking into the issue. 😄

@gigatesseract commented on GitHub (Mar 11, 2019): @thelastpolaris @cfsmp3 Thank you for looking into the issue. :smile:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#488