Opened 8 years ago

Last modified 3 years ago

#5846 open enhancement

Support writing BOM in SRT muxer

Reported by: edumj Owned by:
Priority: wish Component: avformat
Version: git-master Keywords: srt
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

I can add srt subs (UTF-8) to a MP4 file (ttxt subs) with:

-c:s mov_text

but when I extract them from the same MP4 file with:

ffmpeg 	-i input.mp4 -c:s text	 output.srt

apart from they have no break lines (opened in Notepad) it seems Ok in Notepad++, but it says it's UTF-8 but whithout BOM, and if I try to convert them to IDX/SUB with Txt2VobSub, all special characters (like accents) are wrong.

Here http://www.trustfm.net/software/video/Txt2Vobsub.php?page=Features it says Txt2Vobsub does not support UTF8 without BOM (it does, but wrong), so I need no add that BOM manually with Nopetad++, and then accents are back!

According to this http://forum.doom9.org/showthread.php?t=152419 -bom option existed before??

I haven't tried yet, but if I extract subtitles from a MKV file, it also would be whitout BOM?

How to reproduce:

% ffmpeg -i input ... output
ffmpeg version
built on ...

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Change History (19)

comment:1 by Carl Eugen Hoyos, 8 years ago

Resolution: needs_more_info
Status: newclosed

I don't think this is a valid ticket: We of course do not add random characters in front of text files that are meant to be utf-8.
If you can point to a specification that disagrees, please do so!

In any case: This is missing the command line you tested together with the complete, uncut console output (and a sample).

comment:2 by edumj, 8 years ago

Ok,

I have this DVB recording 20131121_2345 Espinete en Torres y Reyes.ts, and it has DVB Subtitles and

Tetelext Subtitles:

General
ID                                       : 1008 (0x3F0)
Nombre completo                          : E:\Mis Documentos\Convertir a Xvid\+Pa Convertir a XviD\MediaInfo para sacar Info\ffmpeg Subtitulos\DVB_Teletext con ffmpeg¿

\20131121_2345 Espinete en Torres y Reyes.ts
Formato                                  : MPEG-TS
Tamaño del archivo                       : 34,6MB
Duración                                 : 1min.
Duration_Start                           : UTC 2013-11-21 22:49:48
Duration_End                             : UTC 2013-11-21 22:50:53
Modo de tasa de bits                     : Variable
Tasa de bits total                       : 4 205Kbps
NetworkName                              : RGE CAT
OriginalNetworkName                      : Spanish Digital Terrestrial Television
País                                     : ESP (1) / ESP (2)
TimeZone                                 : +01:00:00 / +00:00:00

Video
ID                                       : 201 (0xC9)
ID Menú                                  : 491 (0x1EB)
Formato                                  : MPEG Video
Formato de la versión                    : Version 2
Formato del perfil                       : Main@Main
Ajustes del formato, BVOP                : Si
Ajustes del formato, Matrix              : Personlizado
Format_Settings_GOP                      : Variable
ID Códec                                 : 2
Duración                                 : 1min.
Tipo de tasa de bits                     : Variable
Tasa de bits                             : 3 640Kbps
Ancho                                    : 720pixeles
Alto                                     : 576pixeles
Relación de aspecto                      : 16:9
Velocidad de cuadro                      : 25,000fps
Estándar                                 : PAL
ColorSpace                               : YUV
ChromaSubsampling                        : 4:2:0
BitDepth/String                          : 8bits
Tipo de exploración                      : Entrelazado
Orden de la exploración                  : Campo superior primero
Bits/(Pixel*cuadro)                      : 0.351
Tamaño de pista                          : 29,2MB (84%)

Audio #1
ID                                       : 203 (0xCB)
ID Menú                                  : 491 (0x1EB)
Formato                                  : MPEG Audio
Formato de la versión                    : Version 1
Formato del perfil                       : Layer 2
ID Códec                                 : 3
Duración                                 : 1min.
Tipo de tasa de bits                     : Constante
Tasa de bits                             : 192Kbps
Canal(es)                                : 2canales
Velocidad de muestreo                    : 48,0KHz
Demora del video                         : -592ms
Tamaño de pista                          : 1,56MB (5%)
Idioma                                   : Español

Audio #2
ID                                       : 204 (0xCC)
ID Menú                                  : 491 (0x1EB)
Formato                                  : MPEG Audio
Formato de la versión                    : Version 1
Formato del perfil                       : Layer 2
ID Códec                                 : 3
Duración                                 : 1min.
Tipo de tasa de bits                     : Constante
Tasa de bits                             : 192Kbps
Canal(es)                                : 2canales
Velocidad de muestreo                    : 48,0KHz
Demora del video                         : -592ms
Tamaño de pista                          : 1,56MB (5%)
Idioma                                   : qaa

Texto #1
ID                                       : 202 (0xCA)-100
ID Menú                                  : 491 (0x1EB)
Formato                                  : Teletext
Idioma                                   : Español

Texto #2
ID                                       : 202 (0xCA)-888
ID Menú                                  : 491 (0x1EB)
Formato                                  : Teletext Subtitle
Idioma                                   : Español

Texto #3
ID                                       : 211 (0xD3)
ID Menú                                  : 491 (0x1EB)
Formato                                  : DVB Subtitle
ID Códec                                 : 6
Duración                                 : 1min.
Demora del video                         : 1seg.
Idioma                                   : Español

Menú
ID                                       : 200 (0xC8)
ID Menú                                  : 491 (0x1EB)
Duración                                 : 1min.
Lista                                    : 201 (0xC9) (MPEG Video) / 202 (0xCA) () / 203 (0xCB) (MPEG Audio, Español) / 204 (0xCC) (MPEG Audio, qaa) / 205 (0xCD) (MPEG Audio) 

/ 211 (0xD3) (DVB Subtitle, Español) / 215 (0xD7) () / 8120 (0x1FB8) (SCTE 35)
Idioma                                   :  /  / Español / qaa /  / Español
Nombre del servicio                      : La 2
Proveedor de servicios                   : RTVE
Tipo de servicio                         : digital television
UTC 2013-11-21 00:12:42                  : es:Remando Al Viento / es: / movie/drama /  / 01:33:45 / 
UTC 2013-11-21 01:46:27                  : es:Conciertos Radio 3 2013 / es: / rock/pop /  / 00:27:19 / 
UTC 2013-11-21 02:13:46                  : es:Noche Tematica / es: / education/science/factual topics /  / 00:55:59 / 
UTC 2013-11-21 03:09:45                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:15:13 / 
UTC 2013-11-21 03:24:58                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:14:54 / 
UTC 2013-11-21 03:39:52                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:15:00 / 
UTC 2013-11-21 03:54:52                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:15:23 / 
UTC 2013-11-21 04:10:15                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:15:03 / 
UTC 2013-11-21 04:25:18                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:14:45 / 
UTC 2013-11-21 04:40:03                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:12:57 / 
UTC 2013-11-21 04:53:00                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:01:00 / 
UTC 2013-11-21 04:54:00                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:01:00 / 
UTC 2013-11-21 04:55:00                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:01:00 / 
UTC 2013-11-21 04:56:00                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:01:00 / 
UTC 2013-11-21 04:57:00                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:01:00 / 
UTC 2013-11-21 04:58:00                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:01:00 / 
UTC 2013-11-21 04:59:00                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:01:00 / 
UTC 2013-11-21 05:00:00                  : es:Tve Es Musica / es: / undefined /  / 00:35:00 / 
UTC 2013-11-21 05:35:00                  : es:That'S English / es: / education/science/factual topics /  / 00:21:10 / 
UTC 2013-11-21 05:56:10                  : es:That`s English / es: / film/cinema /  / 00:14:27 / 
UTC 2013-11-21 06:10:37                  : es:Presentación Vaughan / es: / education/science/factual topics /  / 00:00:46 / 
UTC 2013-11-21 06:11:23                  : es:El Canal De Kazinga: Paraiso De Hipopota / es: / social/political issues/economics /  / 00:48:40 / 
UTC 2013-11-21 07:00:03                  : es:Tve English / es: / education/science/factual topics /  / 00:26:49 / 
UTC 2013-11-21 07:26:52                  : es:Zoom Net / es: / news/current affairs /  / 00:17:03 / 
UTC 2013-11-21 07:43:55                  : es:Camara Abierta / es: / news/current affairs /  / 00:15:14 / 
UTC 2013-11-21 07:59:09                  : es:Pueblo De Dios / es: / education/science/factual topics /  / 00:30:51 / 
UTC 2013-11-21 08:30:00                  : es:Aqui Hay Trabajo / es: / education/science/factual topics /  / 00:26:07 / 
UTC 2013-11-21 08:56:07                  : es:La Aventura Del Saber / es: / film/cinema /  / 01:00:21 / 
UTC 2013-11-21 09:56:28                  : es:Mississippi Salvaje / es: / social/political issues/economics /  / 00:54:18 / 
UTC 2013-11-21 10:50:46                  : es:Para Todos La 2 / es: / education/science/factual topics /  / 01:50:16 / 
UTC 2013-11-21 12:41:02                  : es:Don Matteo / es: / serious/classical/religious/historical movie/drama /  / 00:58:58 / 
UTC 2013-11-21 13:40:00                  : es:El Continente Perdido Del Pacificio / es: / social/political issues/economics /  / 00:50:00 / 
UTC 2013-11-21 14:30:00                  : es:Saber Y Ganar 2013 / es: / game show/quiz/contest /  / 00:42:04 / 
UTC 2013-11-21 15:12:04                  : es:Un Original Documental De Patos / es: / social/political issues/economics /  / 00:53:37 / 
UTC 2013-11-21 16:05:41                  : es:Polonia Salvaje / es: / social/political issues/economics /  / 00:51:31 / 
UTC 2013-11-21 16:57:12                  : es:Invasion Alienigena: ¿estamos Preparados / es: / social/political issues/economics /  / 00:46:38 / 
UTC 2013-11-21 17:43:50                  : es:Con Ciencia / es: / education/science/factual topics /  / 00:03:12 / 
UTC 2013-11-21 17:47:02                  : es:Vespre A La 2 / es: / education/science/factual topics /  / 00:00:07 / 
UTC 2013-11-21 17:47:09                  : es:Niños Trabajadores En Bangladesh / es: / social/political issues/economics /  / 00:27:54 / 
UTC 2013-11-21 18:15:03                  : es:Para Todos La 2 / es: / education/science/factual topics /  / 00:45:09 / 
UTC 2013-11-21 19:00:12                  : es:Don Matteo / es: / serious/classical/religious/historical movie/drama /  / 00:57:18 / 
UTC 2013-11-21 19:57:30                  : es:Ajuste Zoom Tendencias Una Escapada De P / es: / news/current affairs /  / 00:10:31 / 
UTC 2013-11-21 20:08:01                  : es:Jfk: La Bala Perdida / es: / social/political issues/economics /  / 00:52:49 / 
UTC 2013-11-21 21:00:50                  : es:La Historia Del Mundo / es: / social/political issues/economics /  / 00:49:10 / 
UTC 2013-11-21 21:50:00                  : es:Torres Y Reyes / es: / social/political issues/economics /  / 01:19:46 / Running
UTC 2013-11-21 23:09:46                  : es:Crónicas / es: / news magazine /  / 00:44:22 / Not running
UTC 2013-11-21 23:54:08                  : es:La 2 Noticias / es: / news/current affairs /  / 00:29:26 / 
UTC 2013-11-22 00:23:34                  : es:Dias De Cine 2013 / es: / leisure hobbies /  / 01:00:00 / 
UTC 2013-11-22 01:23:34                  : es:Conciertos Radio 3 2013 / es: / rock/pop /  / 00:26:44 / 
UTC 2013-11-22 01:50:18                  : es:Documentos Tv / es: / education/science/factual topics /  / 01:01:34 / 
UTC 2013-11-22 02:51:52                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:15:49 / 
UTC 2013-11-22 03:07:41                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:15:41 / 
UTC 2013-11-22 03:23:22                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:15:25 / 
UTC 2013-11-22 03:38:47                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:15:21 / 
UTC 2013-11-22 03:54:08                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:15:42 / 
UTC 2013-11-22 04:09:50                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:15:26 / 
UTC 2013-11-22 04:25:16                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:15:40 / 
UTC 2013-11-22 04:40:56                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:13:11 / 
UTC 2013-11-22 04:54:07                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:00:53 / 
UTC 2013-11-22 04:55:00                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:01:00 / 
UTC 2013-11-22 04:56:00                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:01:00 / 
UTC 2013-11-22 04:57:00                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:01:00 / 
UTC 2013-11-22 04:58:00                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:01:00 / 
UTC 2013-11-22 04:59:00                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:01:00 / 
UTC 2013-11-22 05:00:00                  : es:Tve Es Musica / es: / undefined /  / 00:35:00 / 
UTC 2013-11-22 05:35:00                  : es:That'S English / es: / education/science/factual topics /  / 00:18:51 / 
UTC 2013-11-22 05:53:51                  : es:That`s English / es: / film/cinema /  / 00:14:52 / 
UTC 2013-11-22 06:08:43                  : es:Visto En La Tierra / es: / social/political issues/economics /  / 00:51:23 / 
UTC 2013-11-22 07:00:06                  : es:Tve English / es: / education/science/factual topics /  / 00:27:09 / 
UTC 2013-11-22 07:27:15                  : es:Al Filo De Lo Imposible / es: / leisure hobbies /  / 00:33:08 / 
UTC 2013-11-22 08:00:23                  : es:Oficios De La Cultura 2013 / es: / education/science/factual topics /  / 00:29:37 / 
UTC 2013-11-22 08:30:00                  : es:Aqui Hay Trabajo / es: / education/science/factual topics /  / 00:30:37 / 
UTC 2013-11-22 09:00:37                  : es:Uned / es: / education/science/factual topics /  / 01:02:01 / 
UTC 2013-11-22 10:02:38                  : es:Polonia Salvaje / es: / social/political issues/economics /  / 00:52:07 / 
UTC 2013-11-22 10:54:45                  : es:Para Todos La 2 / es: / education/science/factual topics /  / 01:21:49 / 
UTC 2013-11-22 12:16:34                  : es:La Casa Encendida 2013 / es: / social/political issues/economics /  / 00:20:28 / 
UTC 2013-11-22 12:37:02                  : es:Mundos Perdidos / es: / social/political issues/economics /  / 00:56:00 / 
UTC 2013-11-22 13:33:02                  : es:Futuro / es: / social/political issues/economics /  / 00:57:09 / 
UTC 2013-11-22 14:30:11                  : es:Saber Y Ganar 2013 / es: / game show/quiz/contest /  / 00:41:10 / 
UTC 2013-11-22 15:11:21                  : es:Visto En La Tierra / es: / social/political issues/economics /  / 00:53:39 / 
UTC 2013-11-22 16:05:00                  : es:Trotamundos / es: / social/political issues/economics /  / 00:51:57 / 
UTC 2013-11-22 16:56:57                  : es:Jara Y Sedal / es: / sports /  / 00:25:45 / 
UTC 2013-11-22 17:22:42                  : es:El Escarabajo Verde / es: / education/science/factual topics /  / 00:31:16 / 
UTC 2013-11-22 17:53:58                  : es:Vespre A La 2 / es: / education/science/factual topics /  / 00:02:45 / 
UTC 2013-11-22 17:56:43                  : es:Invasores (Fauna Invasora) / es: / movie/drama /  / 01:03:22 / 
UTC 2013-11-22 19:00:05                  : es:Atención Obras / es: / education/science/factual topics /  / 01:03:45 / 
UTC 2013-11-22 20:03:50                  : es:Cachitos De Hierro Y Cromo / es: / rock/pop /  / 00:56:15 / 
UTC 2013-11-22 21:00:05                  : es:La Suerte En Tus Manos 2013 / es: / education/science/factual topics /  / 00:19:47 / 
UTC 2013-11-22 21:19:52                  : es:El Cine De La 2 2013 / es: / leisure hobbies /  / 00:02:51 / 
UTC 2013-11-22 21:22:43                  : es:Ni Un Pelo De Tonto / es: / movie/drama /  / 01:46:46 / 
UTC 2013-11-22 23:09:29                  : es:El Cine De La 2 2013 / es: / leisure hobbies /  / 00:02:13 / 
UTC 2013-11-22 23:11:42                  : es:Lo Que Jackie Sabia / es: / social/political issues/economics /  / 00:59:45 / 
UTC 2013-11-23 00:11:27                  : es:Los Verdaderos Revolucionarios / es: / social/political issues/economics /  / 00:47:55 / 
UTC 2013-11-23 00:59:22                  : es:La Seduccion De Las Compras / es: / social/political issues/economics /  / 00:52:27 / 
UTC 2013-11-23 01:51:49                  : es:La Seduccion De Las Compras / es: / social/political issues/economics /  / 00:52:31 / 
UTC 2013-11-23 02:44:20                  : es:Oficios De La Cultura 2013 / es: / education/science/factual topics /  / 00:34:03 / 
UTC 2013-11-23 03:18:23                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:12:06 / 
UTC 2013-11-23 03:30:29                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:15:47 / 
UTC 2013-11-23 03:46:16                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:12:15 / 
UTC 2013-11-23 03:58:31                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:12:13 / 
UTC 2013-11-23 04:10:44                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:13:44 / 
UTC 2013-11-23 04:24:28                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:13:05 / 
UTC 2013-11-23 04:37:33                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:13:33 / 
UTC 2013-11-23 04:51:06                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:02:54 / 
UTC 2013-11-23 04:54:00                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:01:00 / 
UTC 2013-11-23 04:55:00                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:01:00 / 
UTC 2013-11-23 04:56:00                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:01:00 / 
UTC 2013-11-23 04:57:00                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:01:00 / 
UTC 2013-11-23 04:58:00                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:01:00 / 
UTC 2013-11-23 04:59:00                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:01:00 / 
UTC 2013-11-23 05:00:00                  : es:Tve Es Musica / es: / undefined /  / 00:30:00 / 
UTC 2013-11-23 05:30:00                  : es:That'S English / es: / education/science/factual topics /  / 00:15:00 / 
UTC 2013-11-23 05:45:00                  : es:That¿s English / es: / education/science/factual topics /  / 00:15:00 / 
UTC 2013-11-23 06:00:00                  : es:That¿s English / es: / education/science/factual topics /  / 00:15:00 / 
UTC 2013-11-23 06:15:00                  : es:That¿s English / es: / education/science/factual topics /  / 00:15:00 / 
UTC 2013-11-23 06:30:00                  : es:Uned / es: / education/science/factual topics /  / 00:30:00 / 
UTC 2013-11-23 07:00:00                  : es:Los Conciertos De La 2 / es: / serious music/classical music /  / 01:40:00 / 
UTC 2013-11-23 08:40:00                  : es:Agrosfera / es: / news/current affairs /  / 00:50:00 / 
UTC 2013-11-23 09:30:00                  : es:España En Comunidad / es: / news magazine /  / 00:30:00 / 
UTC 2013-11-23 10:00:00                  : es:En Lengua De Signos / es: / news/current affairs /  / 00:30:00 / 
UTC 2013-11-23 10:30:00                  : es:Piensa En Positivo / es: / education/science/factual topics /  / 00:30:00 / 
UTC 2013-11-23 11:00:00                  : es:A La Carrera / es: / social/political issues/economics /  / 00:30:00 / 
UTC 2013-11-23 11:30:00                  : es:La Fabrica De Ideas / es: / education/science/factual topics /  / 00:30:00 / 
UTC 2013-11-23 12:00:00                  : es:Trotamundos / es: / social/political issues/economics /  / 01:00:00 / 
UTC 2013-11-23 13:00:00                  : es:Tendido Cero / es: / social/political issues/economics /  / 01:05:00 / 
UTC 2013-11-23 14:05:00                  : es:Ruta Quetzal / es: / social/political issues/economics /  / 00:30:00 / 
UTC 2013-11-23 14:35:00                  : es:Saber Y Ganar Fin De Semana / es: / game show/quiz/contest /  / 00:45:00 / 
UTC 2013-11-23 15:20:00                  : es:Mississippi Salvaje / es: / social/political issues/economics /  / 00:55:00 / 
UTC 2013-11-23 16:15:00                  : es:La Historia Del Mundo / es: / social/political issues/economics /  / 00:55:00 / 
UTC 2013-11-23 17:10:00                  : es:Mundos Perdidos / es: / social/political issues/economics /  / 00:50:00 / 
UTC 2013-11-23 18:00:00                  : es:Dias De Cine 2013 / es: / leisure hobbies /  / 01:00:00 / 
UTC 2013-11-23 19:00:00                  : es:La Mitad Invisible / es: / social/political issues/economics /  / 00:30:00 / 
UTC 2013-11-23 19:30:00                  : es:Los Superpoderes De Los Alimentos / es: / social/political issues/economics /  / 00:55:00 / 
UTC 2013-11-23 20:25:00                  : es:Maria Wern / es: / serious/classical/religious/historical movie/drama /  / 01:25:00 / 
UTC 2013-11-23 21:50:00                  : es:La Noche Tematica / es: / education/science/factual topics /  / 01:22:00 / 
UTC 2013-11-23 23:12:00                  : es:Noche Tematica / es: / education/science/factual topics /  / 01:33:00 / 
UTC 2013-11-24 00:45:00                  : es:La Casa Encendida / es: / social/political issues/economics /  / 00:30:00 / 
UTC 2013-11-24 01:15:00                  : es:Gala De Clausura Festival De Cine De Hue / es: / education/science/factual topics /  / 01:00:00 / 
UTC 2013-11-24 02:15:00                  : es:Atención Obras / es: / education/science/factual topics /  / 01:00:00 / 
UTC 2013-11-24 03:15:00                  : es:Dias De Cine 2013 / es: / leisure hobbies /  / 01:00:00 / 
UTC 2013-11-24 04:15:00                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:02:00 / 
UTC 2013-11-24 04:17:00                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:02:00 / 
UTC 2013-11-24 04:19:00                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:02:00 / 
UTC 2013-11-24 04:21:00                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:02:00 / 
UTC 2013-11-24 04:23:00                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:02:00 / 
UTC 2013-11-24 04:25:00                  : es:Tve Es Musica / es: / music/ballet/dance /  / 00:02:00 / 
UTC 2013-11-25 03:00:00                  : es:Sin información / es: / news/current affairs /  / 24:00:00 / 
UTC 2013-11-26 03:00:00                  : es:Sin información / es: / news/current affairs /  / 24:00:00 / 
UTC 2013-11-27 03:00:00                  : es:Sin información / es: / news/current affairs /  / 66:40:00 / 


Then I can extract Teletext Subtitles with ccextractorwin.exe or with ffmpeg.zvbi.exe (the only ffmpeg version I found wich was compiled with libzvbi, otherwise I can't extract Teletext with ffmpeg)

If I extract Teletext Subtitles with ccextractorwin.exe with:

"ccextractorwin.exe" "20131121_2345 Espinete en Torres y Reyes.ts" --goptime -autoprogram --nofontcolor -tpage 888 -out=srt -o "pag_888 (ccextractorwin).srt"

The ouptut is:

CCExtractor 0.77, Carlos Fernandez Sanz, Volker Quetschke.
Teletext portions taken from Petr Kutalek's telxcc
--------------------------------------------------------------------------
Input: 20131121_2345 Espinete en Torres y Reyes.ts
[Extract: 1] [Stream mode: Autodetect]
[Program : 0 ] [Hauppage mode: No] [Use MythTV code: Auto]

[Timing mode: GOP (forced)] [Debug: No] [Buffer input: Yes]
[Use pic_order_cnt_lsb for H.264: No] [Print CC decoder traces: No]
[Target format: .srt] [Encoding: UTF-8] [Delay: 0] [Trim lines: No]
[Add font color data: No] [Add font typesetting: Yes]
[Convert case: No] [Video-edit join: No]
[Extraction start time: not set (from start)]
[Extraction end time: not set (to end)]
[Live stream: No] [Clock frequency: 90000]
Teletext page: [888]
Start credits text: [None]
Creating pag_888 (ccextractorwin).srt


-----------------------------------------------------------------

Opening file: 20131121_2345 Espinete en Torres y Reyes.ts
Detected MP4 box with name: meta

File seems to be a transport stream, enabling TS mode

Analyzing data in general mode

Problem: No TS header mark (filepos=96444). Received bytes:
00000000 | 3A 29 83 72                                      | :)ƒr            
Skip forward to the next TS header mark.

The program you selected (0) wasn't found in the first Program Association Table in the stream.
I will continue reading the stream in case the program appears later.


This TS file has more than one program. These are the program numbers found: 
490
491
492
493
495
496
497
Still unsupported MPEG descriptor type=2 (02)
Still unsupported MPEG descriptor type=3 (03)
Still unsupported MPEG descriptor type=3 (03)
Still unsupported MPEG descriptor type=3 (03)
VBI/teletext stream ID 202 (0xca) for SID 491 (0x1eb)

  0%  |  00:00
  1%  |  00:00- Programme Identification Data = La 2                
- Universal Time Co-ordinated = Thu Nov 21 23:47:47 2013

  2%  |  00:01
  3%  |  00:01
  4%  |  00:02
Notice: Teletext page with possible subtitles detected: 888

  5%  |  00:03
  6%  |  00:03
  7%  |  00:04
  8%  |  00:05
  9%  |  00:05
 10%  |  00:06
 11%  |  00:07
 12%  |  00:08
 13%  |  00:08
 14%  |  00:09
 15%  |  00:10
 16%  |  00:11
 17%  |  00:11
 18%  |  00:12
 19%  |  00:13
 20%  |  00:13
 21%  |  00:14
 22%  |  00:15
 23%  |  00:15
 24%  |  00:16
 25%  |  00:17
 26%  |  00:18
 27%  |  00:18
 28%  |  00:19
 29%  |  00:20
 30%  |  00:20
 31%  |  00:21
 32%  |  00:22
 33%  |  00:22
 34%  |  00:23
 35%  |  00:24
 36%  |  00:25
 37%  |  00:25
 38%  |  00:26
 39%  |  00:27
 40%  |  00:27
 41%  |  00:28
 42%  |  00:29
 43%  |  00:29
 44%  |  00:30
 45%  |  00:31
 46%  |  00:32
 47%  |  00:32
 48%  |  00:33
 49%  |  00:34
 50%  |  00:35
 51%  |  00:35
 52%  |  00:36
 53%  |  00:37
 54%  |  00:37
 55%  |  00:38
 56%  |  00:39
 57%  |  00:39
 58%  |  00:40
 59%  |  00:41
 60%  |  00:41
 61%  |  00:42
 62%  |  00:43
 63%  |  00:43
 64%  |  00:44
 65%  |  00:45
 66%  |  00:45
 67%  |  00:46
 68%  |  00:47
 69%  |  00:47
 70%  |  00:48
 71%  |  00:49
 72%  |  00:49
 73%  |  00:50
 74%  |  00:51
 75%  |  00:51
 76%  |  00:52
 77%  |  00:53
 78%  |  00:53
 79%  |  00:54
 80%  |  00:55
 81%  |  00:55
 82%  |  00:56
 83%  |  00:57
 84%  |  00:57
 85%  |  00:58
 86%  |  00:59
 87%  |  00:59
 88%  |  01:00
 89%  |  01:01
 90%  |  01:02
 91%  |  01:02
 92%  |  01:03
 93%  |  01:04
 94%  |  01:04
 95%  |  01:05
 96%  |  01:06
 97%  |  01:06
 98%  |  01:07
 99%  |  01:08
100%  |  01:08
Number of NAL_type_7: 0
Number of VCL_HRD: 0
Number of NAL HRD: 0
Number of jump-in-frames: 0
Number of num_unexpected_sei_length: 0

Total frames time:	  00:00:00:000  (0 frames at 29.97fps)

Done, processing time = 0 seconds
Teletext decoder: 1710 packets processed, 17 SRT frames written.
This is beta software. Report issues to carlos at ccextractor org...

And the result is this UTF-8 encoded SRT file pag_888 (ccextractorwin).srt.

But, if I extract them with ffmpeg.zvbi.exe with:

"ffmpeg.zvbi.exe" -txt_page 888 -txt_format text -fix_sub_duration -i "20131121_2345 Espinete en Torres y Reyes.ts" "pag_888 (ffmpeg.zvbi).srt"

The output is:

ffmpeg version N-80123-gd74cc61 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (GCC)
  configuration: --arch=x86 --target-os=mingw32 --cross-prefix=/home/rdp/dev/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32- --pkg-

config=pkg-config --disable-w32threads --enable-gpl --enable-libsoxr --enable-fontconfig --enable-libass --disable-libutvideo --enable-libbluray --enable-iconv --enable-

libtwolame --extra-cflags=-DLIBTWOLAME_STATIC --enable-libzvbi --enable-libcaca --enable-libmodplug --extra-libs=-lstdc++ --extra-libs=-lpng --enable-libvidstab --enable-

libx265 --enable-decklink --extra-libs=-loleaut32 --enable-libx264 --enable-libxvid --enable-libmp3lame --enable-version3 --enable-zlib --enable-librtmp --enable-libvorbis --

enable-libtheora --enable-libspeex --enable-libopenjpeg --enable-gnutls --enable-libgsm --enable-libfreetype --enable-libopus --enable-frei0r --enable-filter=frei0r --enable-

bzlib --enable-libxavs --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libschroedinger --enable-libvpx --enable-libilbc --enable-

libwavpack --enable-libwebp --enable-libgme --enable-dxva2 --enable-avisynth --enable-gray --enable-libopenh264 --enable-libmfx --extra-libs=-lpsapi --extra-cflags= --enable-

static --disable-shared --prefix=/home/rdp/dev/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32 --enable-runtime-cpudetect
  libavutil      55. 24.100 / 55. 24.100
  libavcodec     57. 43.100 / 57. 43.100
  libavformat    57. 37.101 / 57. 37.101
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 46.100 /  6. 46.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[mp3 @ 006b31e0] Header missing
[mp3 @ 006c9aa0] Header missing
[mpeg2video @ 006aff00] Invalid frame dimensions 0x0.
    Last message repeated 1 times
[mpegts @ 006aa880] start time for stream 4 is not set in estimate_timings_from_pts
[mpegts @ 006aa880] PES packet size mismatch
[mpegts @ 006aa880] Could not find codec parameters for stream 4 (Audio: mp3 ([3][0][0][0] / 0x0003), 0 channels, s16p): unspecified frame size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 006aa880] Could not find codec parameters for stream 6 (Unknown: none ([5][0][0][0] / 0x0005)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 006aa880] Could not find codec parameters for stream 7 (Unknown: none ([134][0][0][0] / 0x0086)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from '20131121_2345 Espinete en Torres y Reyes.ts':
  Duration: 00:01:09.22, start: 74195.554133, bitrate: 4198 kb/s
  Program 490 
    Metadata:
      service_name    : La 1
      service_provider: RTVE
  Program 491 
    Metadata:
      service_name    : La 2
      service_provider: RTVE
    Stream #0:0[0xc9]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn
    Stream #0:1[0xca](spa,spa): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Stream #0:2[0xcb](spa): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #0:3[0xcc](qaa): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #0:4[0xcd](spa): Audio: mp3 ([3][0][0][0] / 0x0003), 0 channels, s16p (visual impaired)
    Stream #0:5[0xd3](spa): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
    Stream #0:6[0xd7]: Unknown: none ([5][0][0][0] / 0x0005)
    Stream #0:7[0x1fb8]: Unknown: none ([134][0][0][0] / 0x0086)
  Program 492 
    Metadata:
      service_name    : 24h
      service_provider: RTVE
  Program 493 
    Metadata:
      service_name    : Clan
      service_provider: RTVE
  Program 495 
    Metadata:
      service_name    : Radio Nacional Catalunya
      service_provider: RNE
  Program 496 
    Metadata:
      service_name    : Radio 5
      service_provider: RNE
  Program 497 
    Metadata:
      service_name    : ?Ràdio 4
      service_provider: RNE
[srt @ 054f03a0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
[null @ 052f4680] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
    Last message repeated 1 times
Output #0, srt, to 'pag_888 (ffmpeg.zvbi).srt':
  Metadata:
    encoder         : Lavf57.37.101
    Stream #0:0(spa,spa): Subtitle: subrip
    Metadata:
      encoder         : Lavc57.43.100 srt
Output #1, null, to 'nul':
  Metadata:
    encoder         : Lavf57.37.101
    Stream #1:0: Video: wrapped_avframe, yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 25 tbn
    Metadata:
      encoder         : Lavc57.43.100 wrapped_avframe
    Stream #1:1(spa): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
    Metadata:
      encoder         : Lavc57.43.100 pcm_s16le
Stream mapping:
  Stream #0:1 -> #0:0 (dvb_teletext (libzvbi_teletextdec) -> subrip (srt))
  Stream #0:0 -> #1:0 (mpeg2video (native) -> wrapped_avframe (native))
  Stream #0:2 -> #1:1 (mp2 (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
[mp2 @ 056c6a80] Header missing
Error while decoding stream #0:2: Invalid data found when processing input
frame=  650 fps=0.0 q=-0.0 size=       0kB time=00:00:26.68 bitrate=   0.1kbits/s speed=53.4x    
frame= 1564 fps=1564 q=-0.0 size=       1kB time=00:01:03.24 bitrate=   0.1kbits/s speed=63.2x    
[mpegts @ 006aa880] PES packet size mismatch
[mpeg2video @ 0561c260] ac-tex damaged at 25 16
[mpeg2video @ 0561c260] Warning MVs not available
[mpeg2video @ 0561c260] concealing 900 DC, 900 AC, 900 MV errors in P frame
frame= 1712 fps=1528 q=-0.0 Lsize=       1kB time=00:01:09.24 bitrate=   0.1kbits/s speed=61.8x    
video:642kB audio:12874kB subtitle:1kB other streams:0kB global headers:0kB muxing overhead: unknown

And the result is this UTF-8 encoded SRT file pag_888 (ffmpeg.zvbi).srt, but without BOM (reported by

Notepad++).

Now, I convert both SRT's to IDX/SUB with Txt2Vobsub.exe:

"Txt2Vobsub.exe" "pag_888 (ffmpeg.zvbi).srt"	Microsoft_Sans_Serif 0 1 20 0 130 -4 0 1 0 2 108 2 2
"Txt2Vobsub.exe" "pag_888 (ccextractorwin).srt"	Microsoft_Sans_Serif 0 1 20 0 130 -4 0 1 0 2 108 2 2

No console output for this, it opens, converts and auto closes.

At last, I convert original DVB recording to AVI (XviD) with idx/sub created with Txt2Vobsub.exe from SRT's extracted with ccextractorwin.exe and with subs extracted with

ffmpeg:

If I convert IDX/SUB from SRT's extracted with ccextractorwin.exe:

"ffmpeg.exe" -palette "000000,000000,ffffff,000000,ffffff,ffffff,ffffff,ffffff,ffffff,ffffff,ffffff,ffffff,ffffff,ffffff,ffffff,ffffff" -i "pag_888 (ccextractorwin).idx" -i "20131121_2345 Espinete en Torres y Reyes.ts" -map 1:v:0 -map 1:a:0 -map 0:s:0 -scodec xsub -c:v libxvid -b:v 1500k -vtag XVID -c:a libmp3lame -b:a 128k   "ffmpeg xsub (ccextractorwin subs).avi"

The output is:

ffmpeg version N-81452-g01aee81 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --

enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --

enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --

enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --

enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-

libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 29.100 / 55. 29.100
  libavcodec     57. 54.100 / 57. 54.100
  libavformat    57. 48.100 / 57. 48.100
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 54.100 /  6. 54.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, vobsub, from 'pag_888 (ccextractorwin).idx':
  Duration: N/A, bitrate: N/A
    Stream #0:0[0x0](es): Subtitle: dvd_subtitle, 720x576 (default)
[mp3 @ 04a6a6c0] Header missing
[mp3 @ 04a6b4e0] Header missing
[mpeg2video @ 04a525c0] Invalid frame dimensions 0x0.
    Last message repeated 1 times
[mpegts @ 04a4b5a0] start time for stream 4 is not set in estimate_timings_from_pts
[mpegts @ 04a4b5a0] PES packet size mismatch
[mpegts @ 04a4b5a0] Could not find codec parameters for stream 4 (Audio: mp3 ([3][0][0][0] / 0x0003), 0 channels, s16p): unspecified frame size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 04a4b5a0] Could not find codec parameters for stream 6 (Unknown: none ([5][0][0][0] / 0x0005)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 04a4b5a0] Could not find codec parameters for stream 7 (Unknown: none ([134][0][0][0] / 0x0086)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #1, mpegts, from '20131121_2345 Espinete en Torres y Reyes.ts':
  Duration: 00:01:09.22, start: 74195.554133, bitrate: 4198 kb/s
  Program 490 
    Metadata:
      service_name    : La 1
      service_provider: RTVE
  Program 491 
    Metadata:
      service_name    : La 2
      service_provider: RTVE
    Stream #1:0[0xc9]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #1:1[0xca](spa,spa): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Stream #1:2[0xcb](spa): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #1:3[0xcc](qaa): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #1:4[0xcd](spa): Audio: mp3 ([3][0][0][0] / 0x0003), 0 channels, s16p (visual impaired)
    Stream #1:5[0xd3](spa): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
    Stream #1:6[0xd7]: Unknown: none ([5][0][0][0] / 0x0005)
    Stream #1:7[0x1fb8]: Unknown: none ([134][0][0][0] / 0x0086)
  Program 492 
    Metadata:
      service_name    : 24h
      service_provider: RTVE
  Program 493 
    Metadata:
      service_name    : Clan
      service_provider: RTVE
  Program 495 
    Metadata:
      service_name    : Radio Nacional Catalunya
      service_provider: RNE
  Program 496 
    Metadata:
      service_name    : Radio 5
      service_provider: RNE
  Program 497 
    Metadata:
      service_name    : ?Ràdio 4
      service_provider: RNE
[avi @ 04f67060] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
    Last message repeated 2 times
[null @ 04addf20] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
    Last message repeated 1 times
Output #0, avi, to 'ffmpeg xsub (ccextractorwin subs).avi':
  Metadata:
    ISFT            : Lavf57.48.100
    Stream #0:0: Video: mpeg4 (libxvid) (XVID / 0x44495658), yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=2-31, 1500 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.54.100 libxvid
    Stream #0:1(spa): Audio: mp3 (libmp3lame) (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p, delay 1105, padding 0, 128 kb/s
    Metadata:
      encoder         : Lavc57.54.100 libmp3lame
    Stream #0:2(es): Subtitle: xsub (DXSB / 0x42535844), 720x576 (default)
    Metadata:
      encoder         : Lavc57.54.100 xsub
Output #1, null, to 'nul':
  Metadata:
    encoder         : Lavf57.48.100
    Stream #1:0: Video: wrapped_avframe, yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.54.100 wrapped_avframe
    Stream #1:1(spa): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
    Metadata:
      encoder         : Lavc57.54.100 pcm_s16le
Stream mapping:
  Stream #1:0 -> #0:0 (mpeg2video (native) -> mpeg4 (libxvid))
  Stream #1:2 -> #0:1 (mp2 (native) -> mp3 (libmp3lame))
  Stream #0:0 -> #0:2 (dvd_subtitle (dvdsub) -> xsub (native))
  Stream #1:0 -> #1:0 (mpeg2video (native) -> wrapped_avframe (native))
  Stream #1:2 -> #1:1 (mp2 (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
[mp2 @ 04a6fc60] Header missing
Error while decoding stream #1:2: Invalid data found when processing input
frame=   91 fps=0.0 q=8.0 q=-0.0 size=     811kB time=00:00:04.32 bitrate=1538.8kbits/s speed=8.57x    
frame=  188 fps=187 q=7.0 q=-0.0 size=    1666kB time=00:00:11.08 

bitrate=1231.5kbits/s speed=  11x    
frame=  276 fps=183 q=9.0 q=-0.0 size=    2482kB time=00:00:15.16 bitrate=1341.4kbits/s speed=10.1x    
frame=  375 fps=187 q=6.0 q=-0.0 

size=    3277kB time=00:00:15.68 bitrate=1712.3kbits/s speed=7.81x    
frame=  475 fps=189 q=9.0 q=-0.0 size=    4186kB time=00:00:24.08 bitrate=1424.2kbits/s speed=9.59x    


frame=  569 fps=189 q=10.0 q=-0.0 size=    4960kB time=00:00:24.08 bitrate=1687.2kbits/s speed=   8x    
frame=  673 fps=192 q=9.0 q=-0.0 size=    5788kB time=00:00:27.60 

bitrate=1717.9kbits/s speed=7.86x    
frame=  764 fps=190 q=9.0 q=-0.0 size=    6523kB time=00:00:36.16 bitrate=1477.9kbits/s speed=9.01x    
frame=  859 fps=190 q=8.0 q=-0.0 

size=    7257kB time=00:00:36.16 bitrate=1644.0kbits/s speed=8.01x    
frame=  946 fps=189 q=13.0 q=-0.0 size=    7977kB time=00:00:39.12 bitrate=1670.3kbits/s speed= 7.8x    


frame= 1031 fps=187 q=14.0 q=-0.0 size=    8687kB time=00:00:44.36 bitrate=1604.3kbits/s speed=8.04x    
frame= 1121 fps=186 q=14.0 q=-0.0 size=    9464kB time=00:00:48.88 

bitrate=1586.1kbits/s speed=8.12x    
frame= 1217 fps=187 q=20.0 q=-0.0 size=   10174kB time=00:00:49.36 bitrate=1688.5kbits/s speed=7.57x    
frame= 1299 fps=185 q=9.0 q=-0.0 

size=   10803kB time=00:00:52.64 bitrate=1681.2kbits/s speed= 7.5x    
frame= 1391 fps=185 q=10.0 q=-0.0 size=   11520kB time=00:00:59.64 bitrate=1582.3kbits/s speed=7.93x    


frame= 1478 fps=184 q=10.0 q=-0.0 size=   12183kB time=00:00:59.80 bitrate=1669.0kbits/s speed=7.45x    
frame= 1558 fps=183 q=11.0 q=-0.0 size=   12827kB time=00:01:03.00 

bitrate=1667.9kbits/s speed=7.39x    
frame= 1642 fps=182 q=13.0 q=-0.0 size=   13099kB time=00:01:06.36 bitrate=1617.1kbits/s speed=7.35x    
[mpeg2video @ 04a6f3e0] ac-tex 

damaged at 25 16
[mpeg2video @ 04a6f3e0] Warning MVs not available
[mpeg2video @ 04a6f3e0] concealing 900 DC, 900 AC, 900 MV errors in P frame
frame= 1712 fps=182 q=13.0 Lq=-0.0 size=   14303kB time=00:01:09.24 bitrate=1692.2kbits/s speed=7.35x    
video:13719kB audio:13948kB subtitle:30kB other streams:0kB global headers:0kB muxing overhead: unknown

If I convert IDX/SUB from SRT's extracted with ffmpeg (without BOM):

"ffmpeg.exe" -palette "000000,000000,ffffff,000000,ffffff,ffffff,ffffff,ffffff,ffffff,ffffff,ffffff,ffffff,ffffff,ffffff,ffffff,ffffff" -i "pag_888 (ffmpeg.zvbi).idx" -i "20131121_2345 Espinete en Torres y Reyes.ts" -map 1:v:0 -map 1:a:0 -map 0:s:0 -scodec xsub -c:v libxvid -b:v 1500k -vtag XVID -c:a libmp3lame -b:a 128k   "ffmpeg xsub (ffmpeg subs).avi"

The output is:

ffmpeg version N-81452-g01aee81 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --

enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --

enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --

enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --

enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-

libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 29.100 / 55. 29.100
  libavcodec     57. 54.100 / 57. 54.100
  libavformat    57. 48.100 / 57. 48.100
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 54.100 /  6. 54.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, vobsub, from 'pag_888 (ffmpeg.zvbi).idx':
  Duration: N/A, bitrate: N/A
    Stream #0:0[0x0](es): Subtitle: dvd_subtitle, 720x576 (default)
[mp3 @ 0315a6e0] Header missing
[mp3 @ 0315b500] Header missing
[mpeg2video @ 03142480] Invalid frame dimensions 0x0.
    Last message repeated 1 times
[mpegts @ 0313b580] start time for stream 4 is not set in estimate_timings_from_pts
[mpegts @ 0313b580] PES packet size mismatch
[mpegts @ 0313b580] Could not find codec parameters for stream 4 (Audio: mp3 ([3][0][0][0] / 0x0003), 0 channels, s16p): unspecified frame size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0313b580] Could not find codec parameters for stream 6 (Unknown: none ([5][0][0][0] / 0x0005)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0313b580] Could not find codec parameters for stream 7 (Unknown: none ([134][0][0][0] / 0x0086)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #1, mpegts, from '20131121_2345 Espinete en Torres y Reyes.ts':
  Duration: 00:01:09.22, start: 74195.554133, bitrate: 4198 kb/s
  Program 490 
    Metadata:
      service_name    : La 1
      service_provider: RTVE
  Program 491 
    Metadata:
      service_name    : La 2
      service_provider: RTVE
    Stream #1:0[0xc9]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #1:1[0xca](spa,spa): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Stream #1:2[0xcb](spa): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #1:3[0xcc](qaa): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #1:4[0xcd](spa): Audio: mp3 ([3][0][0][0] / 0x0003), 0 channels, s16p (visual impaired)
    Stream #1:5[0xd3](spa): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
    Stream #1:6[0xd7]: Unknown: none ([5][0][0][0] / 0x0005)
    Stream #1:7[0x1fb8]: Unknown: none ([134][0][0][0] / 0x0086)
  Program 492 
    Metadata:
      service_name    : 24h
      service_provider: RTVE
  Program 493 
    Metadata:
      service_name    : Clan
      service_provider: RTVE
  Program 495 
    Metadata:
      service_name    : Radio Nacional Catalunya
      service_provider: RNE
  Program 496 
    Metadata:
      service_name    : Radio 5
      service_provider: RNE
  Program 497 
    Metadata:
      service_name    : ?Ràdio 4
      service_provider: RNE
[avi @ 051a5360] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
    Last message repeated 2 times
[null @ 04ec00e0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
    Last message repeated 1 times
Output #0, avi, to 'ffmpeg xsub (ffmpeg subs).avi':
  Metadata:
    ISFT            : Lavf57.48.100
    Stream #0:0: Video: mpeg4 (libxvid) (XVID / 0x44495658), yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=2-31, 1500 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.54.100 libxvid
    Stream #0:1(spa): Audio: mp3 (libmp3lame) (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p, delay 1105, padding 0, 128 kb/s
    Metadata:
      encoder         : Lavc57.54.100 libmp3lame
    Stream #0:2(es): Subtitle: xsub (DXSB / 0x42535844), 720x576 (default)
    Metadata:
      encoder         : Lavc57.54.100 xsub
Output #1, null, to 'nul':
  Metadata:
    encoder         : Lavf57.48.100
    Stream #1:0: Video: wrapped_avframe, yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.54.100 wrapped_avframe
    Stream #1:1(spa): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
    Metadata:
      encoder         : Lavc57.54.100 pcm_s16le
Stream mapping:
  Stream #1:0 -> #0:0 (mpeg2video (native) -> mpeg4 (libxvid))
  Stream #1:2 -> #0:1 (mp2 (native) -> mp3 (libmp3lame))
  Stream #0:0 -> #0:2 (dvd_subtitle (dvdsub) -> xsub (native))
  Stream #1:0 -> #1:0 (mpeg2video (native) -> wrapped_avframe (native))
  Stream #1:2 -> #1:1 (mp2 (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
[mp2 @ 0315fc00] Header missing
Error while decoding stream #1:2: Invalid data found when processing input
frame=   86 fps=0.0 q=10.0 q=-0.0 size=     757kB time=00:00:04.62 bitrate=1341.1kbits/s speed=9.23x    
frame=  182 fps=182 q=7.0 q=-0.0 size=    1603kB time=00:00:11.46 

bitrate=1145.7kbits/s speed=11.4x    
frame=  272 fps=181 q=8.0 q=-0.0 size=    2434kB time=00:00:11.56 bitrate=1724.9kbits/s speed=7.68x    
frame=  371 fps=185 q=5.0 q=-0.0 

size=    3251kB time=00:00:15.54 bitrate=1713.6kbits/s speed=7.75x    
frame=  470 fps=187 q=9.0 q=-0.0 size=    4135kB time=00:00:19.48 bitrate=1738.8kbits/s speed=7.76x    


frame=  568 fps=189 q=10.0 q=-0.0 size=    4956kB time=00:00:24.42 bitrate=1662.2kbits/s speed=8.11x    
frame=  670 fps=191 q=9.0 q=-0.0 size=    5768kB time=00:00:27.54 

bitrate=1715.5kbits/s speed=7.84x    
frame=  771 fps=192 q=9.0 q=-0.0 size=    6604kB time=00:00:36.54 bitrate=1480.5kbits/s speed= 9.1x    
frame=  868 fps=192 q=8.0 q=-0.0 

size=    7327kB time=00:00:36.54 bitrate=1642.4kbits/s speed=8.09x    
frame=  955 fps=190 q=14.0 q=-0.0 size=    8066kB time=00:00:39.46 bitrate=1674.3kbits/s speed=7.87x    


frame= 1037 fps=188 q=14.0 q=-0.0 size=    8734kB time=00:00:44.70 bitrate=1600.5kbits/s speed= 8.1x    
frame= 1126 fps=187 q=15.0 q=-0.0 size=    9479kB time=00:00:49.22 

bitrate=1577.5kbits/s speed=8.18x    
frame= 1217 fps=187 q=20.0 q=-0.0 size=   10180kB time=00:00:49.36 bitrate=1689.5kbits/s speed=7.57x    
frame= 1295 fps=184 q=9.0 q=-0.0 

size=   10761kB time=00:00:52.78 bitrate=1670.0kbits/s speed=7.52x    
frame= 1379 fps=183 q=11.0 q=-0.0 size=   11415kB time=00:00:59.98 bitrate=1559.0kbits/s speed=7.97x    


frame= 1463 fps=182 q=11.0 q=-0.0 size=   12113kB time=00:00:59.98 bitrate=1654.3kbits/s speed=7.47x    
frame= 1546 fps=181 q=11.0 q=-0.0 size=   12716kB time=00:01:02.86 

bitrate=1657.0kbits/s speed=7.37x    
frame= 1634 fps=181 q=12.0 q=-0.0 size=   13171kB time=00:01:06.04 bitrate=1633.8kbits/s speed=7.31x    
[mpeg2video @ 0315f360] ac-tex 

damaged at 25 16
[mpeg2video @ 0315f360] Warning MVs not available
[mpeg2video @ 0315f360] concealing 900 DC, 900 AC, 900 MV errors in P frame
frame= 1712 fps=181 q=13.0 Lq=-0.0 size=   14304kB time=00:01:09.24 bitrate=1692.4kbits/s speed=7.31x    
video:13719kB audio:13948kB subtitle:32kB other streams:0kB global headers:0kB muxing overhead: unknown

And, if you open both converted videos, you will see that the one made form SRT without BOM (by ffmpeg) has "special characters" like accents, wrong:

SRT in UTF-8 ffmpeg xsub (ccextractorwin subs).avi -> Ok!

SRT in UTF-8 without BOM ffmpeg xsub (ffmpeg subs).avi -> BAD!

I don't think BOM are random chars (0xEF,0xBB,0xBF), if I understood this, it says its meant to tell that it is Unicode "its only use in UTF-8 is to signal at the start that the text stream is encoded in UTF-8".

here I found a way to add BOM whith a .bat file, but it would be very usefull to could do it just with ffmpeg, so non english subs will have no problem with Unicode or 'special' characters. Something like that "-bom" option that already existed??

PD: The result is the same if this was a MKV video with UTF-8 Text subtitle (no problem with ANSI).

Last edited 8 years ago by edumj (previous) (diff)

comment:3 by edumj, 8 years ago

Some caps:

SRT in UTF-8 ffmpeg xsub (ccextractorwin subs).avi -> Ok!
http://i47.photobucket.com/albums/f169/edumj/ffmpeg%20xsub%20ccextractorwin%20subs.png

SRT in UTF-8 without BOM ​ffmpeg xsub (ffmpeg subs).avi -> BAD!
http://i47.photobucket.com/albums/f169/edumj/ffmpeg%20xsub%20ffmpeg%20subs.png

comment:4 by Carl Eugen Hoyos, 8 years ago

Did you at any point test the original SupRip executable to verify if it puts a BOM in front of text files?

comment:5 by Clément Bœsch, 8 years ago

Component: undeterminedavformat
Resolution: needs_more_info
Status: closedreopened
Summary: Extract text subtitles in UTF-8 with BOMSupport writing BOM in SRT muxer

I think it makes sense to add an option to do that in the muxer.

comment:6 by Carl Eugen Hoyos, 8 years ago

Keywords: srt added
Priority: normalwish
Status: reopenedopen
Version: unspecifiedgit-master

comment:7 by edumj, 8 years ago

I've just tested extracting subs from one DVD with Subrip.exe (with OCR) and I can choose between Unicode Little Endian or ANSI (no UTF-8). Even it says it must be Unicode because of special characters, but with ANSI it seems Ok.

ubitux, you mean add it to muxer or demuxer?

in reply to:  7 ; comment:8 by Carl Eugen Hoyos, 8 years ago

Replying to edumj:

I've just tested extracting subs from one DVD with Subrip.exe (with OCR) and I can choose between Unicode Little Endian or ANSI (no UTF-8). Even it says it must be Unicode because of special characters, but with ANSI it seems Ok.

Does Suprip.exe write a BOM or not?

in reply to:  7 ; comment:9 by Clément Bœsch, 8 years ago

Replying to edumj:

ubitux, you mean add it to muxer or demuxer?

Muxer since you want to produce srt files with a BOM. Text subtitles demuxers already handle them.

in reply to:  8 ; comment:10 by edumj, 8 years ago

Replying to cehoyos:

Replying to edumj:

I've just tested extracting subs from one DVD with Subrip.exe (with OCR) and I can choose between Unicode Little Endian or ANSI (no UTF-8). Even it says it must be Unicode because of special characters, but with ANSI it seems Ok.

Does Suprip.exe write a BOM or not?

Subrip.exe doesn't seem to write UTF-8, and AFAIK BOM is only for UTF, so the answer is not.

Anyway, why you ask me about Subrip.exe? It has nothing to do with this workflow, since I'm not ripping Dvd subs to text.

in reply to:  9 comment:11 by edumj, 8 years ago

Replying to ubitux:

Replying to edumj:

ubitux, you mean add it to muxer or demuxer?

Muxer since you want to produce srt files with a BOM. Text subtitles demuxers already handle them.

Ok, but I though muxer means join streams, and demuxer means extract them.

in reply to:  10 comment:12 by Carl Eugen Hoyos, 8 years ago

Replying to edumj:

Replying to cehoyos:

Replying to edumj:

I've just tested extracting subs from one DVD with Subrip.exe (with OCR) and I can choose between Unicode Little Endian or ANSI (no UTF-8). Even it says it must be Unicode because of special characters, but with ANSI it seems Ok.

Does Suprip.exe write a BOM or not?

Subrip.exe doesn't seem to write UTF-8, and AFAIK BOM is only for UTF, so the answer is not.

Is there no option to force utf-8?

Anyway, why you ask me about Subrip.exe? It has nothing to do with this workflow, since I'm not ripping Dvd subs to text.

Which other application could be the reference for srt files?

comment:13 by edumj, 8 years ago

I'll try again with other DVDs, but here https://en.m.wikipedia.org/wiki/SubRip it says "A Unicode byte order mark (BOM) can be added to support any Unicode encoding with UTF-8 being preferred for its compatibility with CP-1252" so it should do it.

SubRip formats http://register.titlevision.dk/SM/index.html?srt_format.htm:

Unicode support
 
The Subrip .srt file format supports any text encoding including ANSI, Unicode Little Endian, Unicode Big Endian and UTF-8.
Last edited 8 years ago by edumj (previous) (diff)

comment:14 by edumj, 8 years ago

Also SubtitleWorkshop can do srt, but it makes ANSI by default.

comment:15 by edumj, 8 years ago

I've just tried with latest Subrip.exe, and now it makes UTF-8 with BOM by default! This is the options window:

http://i47.photobucket.com/albums/f169/edumj/Subrip.jpg

But, also now it makes "Unix Line Breaks" by default, I supose that's why no line breaks in notepad.exe. Could ffmpeg do "DOS/Windows Line Breaks"?

comment:16 by Elon Musk, 8 years ago

It could but it is not needed. Use text editor which can handle unix line endings.

in reply to:  16 comment:17 by edumj, 8 years ago

Replying to richardpl:

It could but it is not needed. Use text editor which can handle unix line endings.

You might not need it, but normal people use notepad by default, and it's very difficult to understand or to try to edit a srt with no visible line breaks. I've never seen a srt file without Windows line breaks before, and because SubRip was made only for windows, srt files should have Windows line breaks.

comment:18 by edumj, 8 years ago

Hi,

did you see SubRip.exe options capture? It adds BOM by default.

comment:19 by Balling, 3 years ago

Option -bom never existed before. h264_changesps bitstream filter is not part of official ffmpeg, but part of a fork.

don't think BOM are random chars (0xEF,0xBB,0xBF),

Of course they are not. UTF-8 is variable, so that higher Unicode codepoints are encoded with more bytes. In UTF-8 U+FEFF is encoded as 3 bytes above.

Last edited 3 years ago by Balling (previous) (diff)
Note: See TracTickets for help on using tickets.