This sample allows to extract teletext subtitles to mov_text in MP4 using ffmpeg with libzvbi support (libzvbi_teletextdec decoder). It was recorded by a PVR from a DVB-S2 satellite signal of German TV channel ZDF. (The PVR only dumps one "Program" to disc.) The sample was taken out of the middle of the recording using dd. Teletext subtitles are on page 777 in this sample. POC command line used (successfully): $ ffmpeg -fix_sub_duration -txt_format text -txt_page 777 -i DVB-S.teletext_subtitles_777.ts -map 0:v -map 0:2 -map 0:5 -c:v libx264 -c:a libfdk_aac -c:s mov_text -t 60 mov_text_from_DVB.02.mp4 Note that only with the use of "-fix_sub_duration" do the subtitles come with the correct timing in the resulting file. Without they come extremely too slowly. Console output of a conversion which can be played successfully, with obviously correct subtitles, in VLC: barsnick@sunshine:~/tmp > ffmpeg -fix_sub_duration -txt_format text -txt_page 777 -i DVB-S.teletext_subtitles_777.ts -map 0:v -map 0:2 -map 0:5 -c:v libx264 -c:a libfdk_aac -c:s mov_text -t 60 mov_text_from_DVB.02.mp4 ffmpeg version N-78344-g0bcffc7 Copyright (c) 2000-2016 the FFmpeg developers built with icc (ICC) 14.0.3 20140422 configuration: --prefix=/usr/new/tools/video/install/ffmpeg/2016-02-07 --cc=icc --cxx=icpc --enable-gpl --enable-version3 --enable-nonfree --disable-shared --enable-gnutls --enable-libcdio --enable-libfreetype --enable-libx264 --enable-libvpx --enable-libmp3lame --enable-openal --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtwolame --enable-libopenjpeg --enable-librtmp --enable-libass --enable-libv4l2 --enable-libvidstab --enable-libfdk-aac --enable-libsmbclient --enable-libzvbi --enable-libtesseract --enable-libzmq libavutil 55. 17.100 / 55. 17.100 libavcodec 57. 24.101 / 57. 24.101 libavformat 57. 24.101 / 57. 24.101 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 30.100 / 6. 30.100 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 [h264 @ 0xa40ce20] non-existing SPS 0 referenced in buffering period [h264 @ 0xa40ce20] non-existing PPS 0 referenced [h264 @ 0xa40ce20] non-existing SPS 0 referenced in buffering period [h264 @ 0xa40ce20] non-existing PPS 0 referenced [h264 @ 0xa40ce20] decode_slice_header error [h264 @ 0xa40ce20] no frame! [h264 @ 0xa40ce20] non-existing SPS 0 referenced in buffering period [h264 @ 0xa40ce20] non-existing PPS 0 referenced [h264 @ 0xa40ce20] non-existing SPS 0 referenced in buffering period [h264 @ 0xa40ce20] non-existing PPS 0 referenced [h264 @ 0xa40ce20] decode_slice_header error [h264 @ 0xa40ce20] no frame! [h264 @ 0xa40ce20] non-existing SPS 0 referenced in buffering period [h264 @ 0xa40ce20] non-existing PPS 0 referenced [h264 @ 0xa40ce20] non-existing SPS 0 referenced in buffering period [h264 @ 0xa40ce20] non-existing PPS 0 referenced [h264 @ 0xa40ce20] decode_slice_header error [h264 @ 0xa40ce20] no frame! [h264 @ 0xa40ce20] non-existing SPS 0 referenced in buffering period [h264 @ 0xa40ce20] non-existing PPS 0 referenced [h264 @ 0xa40ce20] non-existing SPS 0 referenced in buffering period [h264 @ 0xa40ce20] non-existing PPS 0 referenced [h264 @ 0xa40ce20] decode_slice_header error [h264 @ 0xa40ce20] no frame! [h264 @ 0xa40ce20] non-existing SPS 0 referenced in buffering period [h264 @ 0xa40ce20] non-existing PPS 0 referenced [h264 @ 0xa40ce20] non-existing SPS 0 referenced in buffering period [h264 @ 0xa40ce20] non-existing PPS 0 referenced [h264 @ 0xa40ce20] decode_slice_header error [h264 @ 0xa40ce20] no frame! [h264 @ 0xa40ce20] non-existing SPS 0 referenced in buffering period [h264 @ 0xa40ce20] non-existing PPS 0 referenced [h264 @ 0xa40ce20] non-existing SPS 0 referenced in buffering period [h264 @ 0xa40ce20] non-existing PPS 0 referenced [h264 @ 0xa40ce20] decode_slice_header error [h264 @ 0xa40ce20] no frame! [h264 @ 0xa40ce20] non-existing SPS 0 referenced in buffering period [h264 @ 0xa40ce20] non-existing PPS 0 referenced [h264 @ 0xa40ce20] non-existing SPS 0 referenced in buffering period [h264 @ 0xa40ce20] non-existing PPS 0 referenced [h264 @ 0xa40ce20] decode_slice_header error [h264 @ 0xa40ce20] no frame! [h264 @ 0xa40ce20] Increasing reorder buffer to 1 [h264 @ 0xa40ce20] Increasing reorder buffer to 2 [NULL @ 0xa4232a0] start time for stream 7 is not set in estimate_timings_from_pts [mpegts @ 0xa4069a0] PES packet size mismatch Last message repeated 4 times [mpegts @ 0xa4069a0] Could not find codec parameters for stream 8 (Unknown: none ([5][0][0][0] / 0x0005)): unknown codec Consider increasing the value for the 'analyzeduration' and 'probesize' options Input #0, mpegts, from 'DVB-S.teletext_subtitles_777.ts': Duration: 00:01:01.53, start: 94861.672278, bitrate: 13632 kb/s Program 11110 Stream #0:0[0x17de]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 100 tbc Stream #0:1[0x17e8](deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 256 kb/s Stream #0:2[0x17e9](mis): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s Stream #0:3[0x17ea](deu): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz, stereo, fltp, 448 kb/s Stream #0:4[0x17eb](mul): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s Stream #0:5[0x17f2](deu): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006) Stream #0:6[0x17f3](deu): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006) (hearing impaired) Stream #0:7[0x17f4]: Data: bin_data ([6][0][0][0] / 0x0006) Stream #0:8[0x181a]: Unknown: none ([5][0][0][0] / 0x0005) Program 11130 Program 11140 [libx264 @ 0xa474a40] using SAR=1/1 [libx264 @ 0xa474a40] using cpu capabilities: MMX2 SSE2 Cache64 [libx264 @ 0xa474a40] profile High, level 3.2 [libx264 @ 0xa474a40] 264 - core 146 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00 Output #0, mp4, to 'mov_text_from_DVB.02.mp4': Metadata: encoder : Lavf57.24.101 Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 50 fps, 50 tbn, 50 tbc Metadata: encoder : Lavc57.24.101 libx264 Side data: unknown side data type 10 (24 bytes) Stream #0:1(mis): Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16, 139 kb/s Metadata: encoder : Lavc57.24.101 libfdk_aac Stream #0:2(deu): Subtitle: mov_text ([8][0][0][0] / 0x0008) Metadata: encoder : Lavc57.24.101 mov_text Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Stream #0:2 -> #0:1 (mp2 (native) -> aac (libfdk_aac)) Stream #0:5 -> #0:2 (dvb_teletext (libzvbi_teletextdec) -> mov_text (native)) Press [q] to stop, [?] for help [h264 @ 0xa9b7220] co located POCs unavailable [h264 @ 0xaa53280] co located POCs unavailable vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=24 vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=24 0.0kbits/s dup=36 drop=0 speed=0.134x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=24 261.2kbits/s dup=36 drop=0 speed=0.129x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=24 153.8kbits/s dup=36 drop=0 speed=0.111x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=24 798.8kbits/s dup=36 drop=0 speed=0.111x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=24 558.1kbits/s dup=36 drop=0 speed=0.112x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=24 vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=24 841.2kbits/s dup=36 drop=0 speed=0.109x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241150.4kbits/s dup=36 drop=0 speed=0.109x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=24 837.3kbits/s dup=36 drop=0 speed=0.105x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=24 vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=24 902.6kbits/s dup=36 drop=0 speed=0.102x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=24 vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241112.7kbits/s dup=36 drop=0 speed=0.101x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=24 vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241107.3kbits/s dup=36 drop=0 speed=0.0985x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241300.4kbits/s dup=36 drop=0 speed=0.0987x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241198.7kbits/s dup=36 drop=0 speed=0.0968x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=24 vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241332.1kbits/s dup=36 drop=0 speed=0.0959x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241390.8kbits/s dup=36 drop=0 speed=0.0969x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241317.2kbits/s dup=36 drop=0 speed=0.0969x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=24 vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241481.0kbits/s dup=36 drop=0 speed=0.0968x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241554.8kbits/s dup=36 drop=0 speed=0.0969x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241423.1kbits/s dup=36 drop=0 speed=0.0961x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=24 vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241303.3kbits/s dup=36 drop=0 speed=0.0945x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=24 vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241399.9kbits/s dup=36 drop=0 speed=0.0947x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241649.9kbits/s dup=36 drop=0 speed=0.0945x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241567.9kbits/s dup=36 drop=0 speed=0.0948x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241678.3kbits/s dup=36 drop=0 speed=0.0946x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241580.4kbits/s dup=36 drop=0 speed=0.0948x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=24 vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241496.3kbits/s dup=36 drop=0 speed=0.0945x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241574.2kbits/s dup=36 drop=0 speed=0.0946x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241531.9kbits/s dup=36 drop=0 speed=0.0947x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241691.6kbits/s dup=36 drop=0 speed=0.0945x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241648.0kbits/s dup=36 drop=0 speed=0.0942x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=24 vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241619.0kbits/s dup=36 drop=0 speed=0.0943x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241656.3kbits/s dup=36 drop=0 speed=0.0947x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241595.4kbits/s dup=36 drop=0 speed=0.0946x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241720.6kbits/s dup=36 drop=0 speed=0.0947x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241609.7kbits/s dup=36 drop=0 speed=0.0952x vbi_print_page_region 'UTF-8' table=1 col=0 row=1 width=41 height=241631.3kbits/s dup=36 drop=0 speed=0.0957x [mpegts @ 0xa4069a0] PES packet size mismatchme=00:00:59.96 bitrate=1560.5kbits/s dup=36 drop=0 speed=0.0968x Last message repeated 1 times [h264 @ 0xaa0f6e0] error while decoding MB 60 12, bytestream -8 [h264 @ 0xaa0f6e0] concealing 2629 DC, 2629 AC, 2629 MV errors in B frame frame= 3000 fps=4.8 q=-1.0 Lsize= 12604kB time=00:01:00.01 bitrate=1720.5kbits/s dup=36 drop=0 speed=0.0959x video:11506kB audio:1023kB subtitle:1kB other streams:0kB global headers:0kB muxing overhead: 0.590850% [libx264 @ 0xa474a40] frame I:20 Avg QP:19.94 size: 54391 [libx264 @ 0xa474a40] frame P:889 Avg QP:23.84 size: 9329 [libx264 @ 0xa474a40] frame B:2091 Avg QP:26.55 size: 1148 [libx264 @ 0xa474a40] consecutive B-frames: 6.2% 1.2% 4.5% 88.1% [libx264 @ 0xa474a40] mb I I16..4: 10.3% 73.5% 16.2% [libx264 @ 0xa474a40] mb P I16..4: 1.3% 4.6% 0.4% P16..4: 34.9% 9.5% 4.3% 0.0% 0.0% skip:45.0% [libx264 @ 0xa474a40] mb B I16..4: 0.1% 0.1% 0.0% B16..8: 22.8% 0.7% 0.1% direct: 0.2% skip:76.0% L0:52.2% L1:45.4% BI: 2.4% [libx264 @ 0xa474a40] 8x8 transform intra:72.8% inter:81.0% [libx264 @ 0xa474a40] coded y,uvDC,uvAC intra: 52.1% 59.1% 20.0% inter: 4.9% 5.9% 0.2% [libx264 @ 0xa474a40] i16 v,h,dc,p: 34% 27% 8% 31% [libx264 @ 0xa474a40] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 12% 23% 4% 8% 10% 6% 8% 5% [libx264 @ 0xa474a40] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 30% 12% 13% 5% 10% 13% 6% 7% 4% [libx264 @ 0xa474a40] i8c dc,h,v,p: 53% 15% 26% 6% [libx264 @ 0xa474a40] Weighted P-Frames: Y:0.0% UV:0.0% [libx264 @ 0xa474a40] ref P L0: 63.6% 16.8% 14.2% 5.4% [libx264 @ 0xa474a40] ref B L0: 92.5% 6.2% 1.3% [libx264 @ 0xa474a40] ref B L1: 97.5% 2.5% [libx264 @ 0xa474a40] kb/s:1570.85