[FFmpeg-trac] #1482(undetermined:new): FFMPEG fails to create a SRT file when extracting Subtitles
FFmpeg
trac at avcodec.org
Sun Aug 26 22:56:19 CEST 2012
#1482: FFMPEG fails to create a SRT file when extracting Subtitles
-------------------------------------+-------------------------------------
Reporter: ramitbhalla | Owner:
Type: defect | Status: new
Priority: normal | Component:
Version: git-master | undetermined
Keywords: cc | Resolution:
Blocking: | Blocked By:
Analyzed by developer: 0 | Reproduced by developer: 0
-------------------------------------+-------------------------------------
Comment (by reimar):
A far larger sample size will be needed to reverse-engineer this format
properly, but for reference below hack to MPlayer makes it mostly display
correctly (using -sid 0 -subcc 1).
However how the whole rollup, rollon, number of lines etc. pp. is encoded
in the format is still quite unclear to me.
{{{
Index: sub/sub_cc.c
===================================================================
--- sub/sub_cc.c (revision 35108)
+++ sub/sub_cc.c (working copy)
@@ -376,11 +381,26 @@
void subcc_process_data(const uint8_t *inputdata, unsigned int len)
{
+ int newline = 0;
int mov_mode = len >= 10 &&
memcmp(inputdata, mov_cc_signature_1,
sizeof(mov_cc_signature_1)) == 0;
if(!subcc_enabled) return;
if(!initialized) subcc_init();
+ cc_mode = CC_ROLLUP;
+ if (len < 2) return;
+ newline = (inputdata[1] & 0xf0) == 0x30;
+ inputdata += 2;
+ len -= 2;
+ channel = 0;
+ while (len >= 2 && (inputdata[0] & 0x60)) {
+ cc_decode_EIA608(inputdata[0] | (inputdata[1] << 8));
+ if (!(inputdata[1] & 0x60)) break;
+ inputdata += 2;
+ len -= 2;
+ }
+ if (newline) append_char('\n');
+ return;
if (mov_mode) {
mov_subcc_decode(inputdata, len);
return;
}}}
--
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/1482#comment:19>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list