SubtitleCreator 2.2 can't handle VobSub files containing PACKs with stuffing bytes in their headers.
The attached .zip file contains a VobSub subtitle that has 3 PACKs with 1 stuffing byte each, a .txt file with the timestamp and filepos of the PACKs, and a .md5 file.
In SubtitleCreator 2.2, Tools > Manipulate SUP or VobSub file doesn't load the subtitle, and Tools > Translate SUP or VobSub to SRT shows the message "Index was outside the bounds of the array". The cause of this bug seems to be the code starting at line 1100 in the file SUP.cs: after finding a new 0x00 0x00 0x01 0xBA header (pack_start_code), the next 14 bytes are skipped, and the next 2 bytes are considered to be PES_packet_length. The 14 skipped bytes are supposed to be the bytes 4..13 as described in http://dvd.sourceforge.net/dvdinfo/packhdr.html and bytes 0..3 as described in http://dvd.sourceforge.net/dvdinfo/pes-hdr.html. Table 2-33 in http://neuron2.net/library/mpeg2/iso13818-1.pdf specifies that stuffing bytes (stuffing_byte = 0xFF) are added to the PACK header when pack_stuffing_length is not 0.
In a VobSub .sub file (and DVD VOBs), a PACK is always 0x0800 bytes long. If the subpicture (or video/audio) PES_packet_length is 0x07E6..0x07EB, there can't be a padding stream PES in the current PACK because the minimum length of a padding stream PES packet is 7 (0x00 0x00 0x01 0xBE 0x00 0x01 0xFF). In this case pack_stuffing_length is not 0 and padding bytes are added to the PACK header so that the length of the PACK is 0x0800.
To make SubtitleCreator 2.2 process these PACKs, hex edit the VobSub .sub file, cut the stuffing bytes from the PACK header and paste them before the next PACK header.
Results in other programs using the attached VobSub subtitle:
- VLC 0.8.6c displays all the subpictures when the subtitle is muxed in a .mkv file or is loaded as an external subtitle when opening a .avi file.
- The ZoomPlayer version in CCCP 2007-07-22 displays all the subpictures when the subtitle is muxed in a .mkv file and shows nothing (the subpicture is one PES packet in a PACK with stuffing bytes in header) or random pixels (the last PES packet of the subpicture is in a PACK with stuffing bytes in header) when it is loaded as an external subtitle.
- SubToSup 0.9 can't open the subtitle.
- VobEdit 0.6 lists the PACKs that have a pack_stuffing_length greater than 0 as "LBA n [Unknown Pack], zzzz" (don't click on this line in VobEdit, the program will crash).
- SubRip 1.50b4 with 'Use VOB's subtitle map' and 'Use IDX's file offset' options unchecked skips the subpicture (the subpicture is one PES packet in a PACK with stuffing bytes in header) and causes time overlapping in the .srt file or shows the subpicture interlaced/displays the warning "This subtitle item can't be processed" (the last PES packet of the subpicture is in a PACK with stuffing bytes in header).
Log in to post a comment.