Home/News | About | Download | Documentation | Forum | Bug Reports | Contact | Donations | Consulting | Projects | Legal | Security | FATE

This forum has not been maintained for a long time and will probably get deleted in the near future.
For faster responses to your questions, please use StackOverflow instead and tag your questions with "FFmpeg".
If you need a backup of the posts from this forum, please contact me directly.

Transcoding dvb_teletext subtitles to srt (TvHeadend-like)

Discussions about problems encountered using ffmpeg.
Forum rules
FFmpeg is in a state of perpetual development and we do not currently have the person power to backport fixes to official releases. As such, if you wish to query or report a bug, you must try with the latest development branch revision of FFmpeg to confirm the issue still exists. The latest FFmpeg can be downloaded from here: http://www.ffmpeg.org/download.html

Transcoding dvb_teletext subtitles to srt (TvHeadend-like)

Postby Hyperion » Mon Mar 20, 2017 6:29 am


I'm having a live MPEGTS stream that includes dvb_telext subtitles.

I want to perform a transcode "TvHeadend Style" to turn them to .SRT and then embed(not burn) them into an mkv file with the hope that players like kodi will like them better. I've been struggling with this for quite some days now and I haven't gotten very far. A commnd that produces some output is this:

Code: Select all
root@root:~# ffmpeg -txt_format text -i inputfile.ts -map 0:0 -map 0:1 -map 0:2 -c:v h264_nvenc -c:a copy -c:s srt test.mkv

The created file has subtitles but first, all 4 languages appear at the same time and then once they appear, they stay stickied for ever in VLC.

Here is the console output:

Code: Select all
ffmpeg version N-84017-g824d406 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-6) 20170205
  configuration: --enable-libzvbi
  libavutil      55. 48.100 / 55. 48.100
  libavcodec     57. 83.100 / 57. 83.100
  libavformat    57. 66.104 / 57. 66.104
  libavdevice    57.  3.100 / 57.  3.100
  libavfilter     6. 77.100 /  6. 77.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
[mpeg2video @ 0x55596114ae00] Invalid frame dimensions 0x0.
    Last message repeated 2 times
Input #0, mpegts, from 'inputfile.ts':
  Duration: N/A, start: 75830.747022, bitrate: 3992 kb/s
  Program 1306
      service_name    :
    Stream #0:0[0x1007]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv42                                                       0p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 3800 kb/s, 25 fps, 25 tbr, 90k                                                        tbn, 50 tbc
    Stream #0:1[0x1107](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, ster                                                       eo, s16p, 192 kb/s
    Stream #0:2[0x1f07](nor,dan,fin,swe): Subtitle: dvb_teletext ([6][0][0][0] /                                                        0x0006), 492x250
File 'film.mkv' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (h264_nvenc))
  Stream #0:1 -> #0:1 (copy)
  Stream #0:2 -> #0:2 (dvb_teletext (libzvbi_teletextdec) -> subrip (srt))
Press [q] to stop, [?] for help
Output #0, matroska, to 'film.mkv':
    encoder         : Lavf57.66.104
    Stream #0:0: Video: h264 (h264_nvenc) (Main) (H264 / 0x34363248), yuv420p, 7                                                       20x576 [SAR 64:45 DAR 16:9], q=-1--1, 2000 kb/s, 25 fps, 1k tbn, 25 tbc
      encoder         : Lavc57.83.100 h264_nvenc
    Side data:
      cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 4000000 vbv_delay: -1
    Stream #0:1(eng): Audio: mp2 (P[0][0][0] / 0x0050), 48000 Hz, stereo, s16p,                                                        192 kb/s
    Stream #0:2(nor,dan,fin,swe): Subtitle: subrip (srt), 492x250
      encoder         : Lavc57.83.100 srt
frame=  392 fps=0.0 q=24.0 size=    2935kB time=00:00:15.84 bitrate=1518.1kbits/                                                       frame=  749 fps=717 q=21.0 size=    7179kB time=00:00:30.14 bitrate=1951.1kbits/                                                       frame=  763 fps=489 q=21.0 size=    7179kB time=00:00:30.69 bitrate=1916.0kbits/                                                       frame=  776 fps=372 q=28.0 size=    7179kB time=00:00:31.17 bitrate=1886.5kbits/                                                       frame=  788 fps=299 q=27.0 size=    7179kB time=00:00:31.72 bitrate=1853.7kbits/                                                       frame=  801 fps=255 q=27.0 size=    7179kB time=00:00:32.23 bitrate=1824.7kbits/                                                       frame=  815 fps=222 q=28.0 size=    7179kB time=00:00:32.78 bitrate=1794.0kbits/                                                       frame=  826 fps=197 q=28.0 size=    7179kB time=00:00:33.31 bitrate=1765.5kbits/                                                       frame=  839 fps=179 q=27.0 size=    8098kB time=00:00:33.79 bitrate=1963.2kbits/                                                       frame=  842 fps=173 q=27.0 Lsize=    9014kB time=00:00:34.12 bitrate=2164.1kbits                                                       /s speed=7.02x
video:8200kB audio:795kB subtitle:1kB other streams:0kB global headers:0kB muxin                                                       g overhead: 0.197490%

I would kill to find out how does TvHeadend do the transcoding since if someone uses the built-in mkv profile there, you can get all 4 languages as separate srt streams.

Thanks in advance!
Posts: 2
Joined: Wed Mar 15, 2017 9:15 am

Return to ffmpeg

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], Google [Bot] and 4 guests