Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CEA-708] Missing the last subtitle with "Premature end of file" #646

Open
Izaron opened this issue Jan 14, 2017 · 7 comments
Open

[CEA-708] Missing the last subtitle with "Premature end of file" #646

Izaron opened this issue Jan 14, 2017 · 7 comments
Labels

Comments

@Izaron
Copy link
Member

@Izaron Izaron commented Jan 14, 2017

Sometimes we have incomplete ts parts because of cropped .ts files, for example:
Premature end of file - Transport Stream packet is incomplete (expected 188 bytes, got 168).

After work we must flush subtitles in current window:

Done, processing time = 85 seconds
Issues? Open a ticket here
https://github.com/CCExtractor/ccextractor/issues
[CEA-708] Window 0 dump:

00:04:49:623 --> 00:34:57:394
-놳떵볒뾡 낥 맼쇋뢦 샺쇶뢣룩 샚믬쟒 
뿫뇢낡 믽뇢쇶 뻊삻뇮 뷍뻮벭 샚웷샚뇢 
뷉솤삸럎 맼쟠삻 쟟듙냭. 
[CEA-708] Dump done
[CEA-708] Window 1 dump:

00:30:22:755 --> 00:34:57:394
낭뢪뾡벭 몸뎻뗥뢰 욯쇽 뒺붺820 뾩뇢벭 
뢶쒡냚뷀듏듙. 
-(뻞쒿) 뷃쎻쟘쇖뷅 뾩랯뫐, 냭뢿뷀듏듙. 
[CEA-708] Dump done

^ This subtitles are written to the file
But if we have broken .ts file at the end, then we can't flush last sub because of missing show time, but CEA-608 have last sub. Example:

Done, processing time = 12 seconds
Issues? Open a ticket here
https://github.com/CCExtractor/ccextractor/issues
[CEA-708] _dtvcc_decoder_flush: Flushing decoder
[CEA-708] [W-1] hide time updated to 00:09:59:131
[CEA-708] _dtvcc_window_copy_to_screen: W-1
[CEA-708] For window 1: Anchor point -> 0, size 2:32, real position 65:0
[CEA-708] we have top [65] and left [0]
[CEA-708] 2*32 will be copied to the TV.
[CEA-708] Screen show time: -00:00:00:001 -> -00:00:00:001
[CEA-708] Screen hide time: -00:00:00:001 -> 00:09:59:131
[CEA-708] Window 1 dump:

-00:00:00:001 --> 00:09:59:131
Our suspect told Petty
Officer Lynn a co-worker
[CEA-708] Dump done
[CEA-708] _dtvcc_screen_print
[CEA-708] Screen hide time: 00:09:59:131 -> 00:09:59:131
[CEA-708] ccx_dtvcc_writer_output: writing... [D:\USA.p8.svc01.srt][5]
[CEA-708] ccx_dtvcc_write_done: no handling required
[CEA-708] dtvcc_free: cleaning up

^ These subtitles have written in CEA-608 file with correct timing, but have not in CEA-708 file.

@Izaron Izaron changed the title [CEA-708] Missing the last subtitle when [CEA-708] Missing the last subtitle with "Premature end of file" Jan 14, 2017
@cfsmp3

This comment has been minimized.

Copy link
Contributor

@cfsmp3 cfsmp3 commented Jan 20, 2017

GSoC qualification: This issues gives 2 points.

@AlexeyBelezeko

This comment has been minimized.

Copy link

@AlexeyBelezeko AlexeyBelezeko commented Mar 3, 2017

@Izaron can you provide me with some samples for the task?

@Izaron

This comment has been minimized.

Copy link
Member Author

@Izaron Izaron commented Mar 3, 2017

@AlexeyBelezeko https://ccextractor.org/public:general:tvsamples "US TV 10 minutes samples" - "ESPN.ts" last sub is missed as far I remembered.

@Izaron

This comment has been minimized.

Copy link
Member Author

@Izaron Izaron commented Mar 5, 2017

Sample:
https://drive.google.com/drive/folders/0B_61ywKPmI0Ta2diT3l0eTlHc2c - USA.ts
Run as ccextractor <path_to_USA.ts> -svc all
The first file USA.srt is correct

...
222
00:09:54,845 --> 00:09:56,411
     a bogus investigation      
      out of your office.       

223
00:09:56,480 --> 00:09:58,480
         The Lynn case?         

224
00:09:58,548 --> 00:09:59,130
         Our suspect told Petty 
        Officer Lynn a co-worker

The second file USA.p8.svc01.srt is incorrect

...
222
00:09:56,045 --> 00:09:56,479
     <font color="aaaaaa">a bogus investigation</font>      
      <font color="aaaaaa">out of your office.</font>       

223
00:09:57,513 --> 00:09:58,547
         <font color="aaaaaa">The Lynn case?</font>         
@thetransformerr

This comment has been minimized.

Copy link
Contributor

@thetransformerr thetransformerr commented Jul 9, 2018

@cfsmp3

hi all,
I worked on this issue and found that this issue can be solved with modifications in decoder output methods but would like to say that such situation is not a bug , as it only happens in streams that are clipped and packet data is incomplete acc to standard size of ts packet parsing is 188 byte

and error originates from here:

if (result != 188)

from what I see below this line is we are using 188 as hardcoded value for size of remaining data packet as per standard/recommendation defined in ISO 13818:1 , and some of the following functions depend on it , like

tstemp = (unsigned char *) memchr (tspacket+1, 0x47, tslen-1);

so here we can use dynamic size if possible , I have no idea abt that , but if that is right approach I can move in that direction.

thanks.

@cfsmp3 cfsmp3 added GCI19 and removed GSoC-related labels Oct 15, 2018
@T1duS

This comment has been minimized.

Copy link
Contributor

@T1duS T1duS commented Nov 7, 2018

So, basically we need to add a parameter like --croppedts which when called replaces all 188 to 168. Am I right?

@cfsmp3

This comment has been minimized.

Copy link
Contributor

@cfsmp3 cfsmp3 commented Nov 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.